Sense Energy Monitor

New user! I just got my hubitat up and running.

I have a Sense Energy Monitor. It runs through my wifi and share the same network as my Hubitat. I added it to my home assistant when I was playing around with HA. Any way to add my Sense to my Hubitat?

I do not recall anyone posting an integration for Sense. You may be able to port the following ST custom integration.

Thank you for replying
I had seen that and I tried it out. The driver works fine but the smart app throws the errors. I don't know how to fix those errors.

Lastly this isn't a deal breaker but I'd like to not have to run a node server.

Would trying to look at Home Assistant did easier or?

Looking at the underlying 'Unofficial Sense API' which is used by the NodeJS server, I am somewhat optimistic that Sense could be directly integrated with Hubitat. It appears that the Sense API uses a webSocket for communications. If so, Hubitat now has native webSocket support.

I used the Hubitat webSocket API to directly integrate the Logitech Harmony Hub recently. So, this Sense device is interesting. However, since I don't have a Sense device/account, it would be extremely difficult to attempt this.

I am using an IoTaWatt Engery Monitoring device to achieve similar goals. I wrote a custom integration for it not too long ago.

1 Like

Thanks for the help. I found an interesting thread from @aaron about his sense. He is using IFTTT, which isn't preferable but an option.

I'll look at your code and see if it is within my abilities to modify it for sense.

1 Like

Here is the code that use webSockets...

2 Likes

You probably could do what your driver is doing an create new devices. Word of caution: I would use the Virtual Containers as others have done. I have 24 monitored devices and to have those all in HE unless in a container would be obnoxious.

So I understand you just use the driver without the smart app and label it a container?

You can do this one of two ways.

1: SmartApp - which you can have query the websocket and provide a list of devices to the end-user to choose to create virtual switches for
2: SmartDevice (like @ogiewon) - which you have query the websocket on Sense and create all of the devices

Either way you should use a container to keep the virtual devices together for ease of administration.

I didn't need all 24 devices in my HE. I just needed it for (2) washers and dryers so I can do Push Notifications to our devices when the laundry cycles are done depending on which washer/dryer or both completed (I have my mother-in-law living with us and I installed another set of laundry in basement). For me Sense was cheaper than buying other solutions and also then gave me information on how we were doing for power consumption. (2) Aeotechs are the same price as (1) sense. So it didn't make financial sense to not do Sense.

1 Like

So I'm playing with this, the SmartApp won't install in HE (trying to save the code doesn't work, there must be something that works with ST but not Hubitat).

Thanks!

What's the error you get? Can you point me to the code? I'm not a dev, but I might be able to help some.

NM I found it.

This saves, but only if I remove some lines and one of them is include 'asynchttp_v1' and I know that's not right. If I don't remove it, you get

No signature of method: Script1.include() is applicable for argument types: (java.lang.String) values: [asynchttp_v1] Possible solutions: installed(), evaluate(java.lang.String) on line 21

You could contact @tonesto7. He's one of the authors of this code.

@aaron can I ask how you got this going? The smartapp doesn't seem to work, and I'm unclear how you get the device driver working (I don't see anywhere to feet it account info, etc).

Thanks!

I have not used the SmartApp. I just use IFTTT with virtual switches.

1 Like

Do you find that works relatively quickly?

Yes very quickly. I noticed that sense can be overly sensitive to the power inflections in your home. An example is my washing machine. When the WM pauses to let the clothes soak sense no longer can pickup the unique electric draw and in-turn says that the WM has shut off. But then 2-16 minutes (depending on load settings) the WM will continue and then sense will state it is on. So you have to use rules with pending cancellation in order to achieve what you want overall. Here are two examples I use for my washer/dryer notifications.

IFTTT rule example:

1 Like

Myself?

I've never had it work.

IFTTT gets out of sync with my virtual switches often and my rule doesn't ever announce. Makes troublesooting the problem annoying.

The guy over at smartthings updated Sense and fixed a couple of websocket monitoring issues.

This is above my head but for anyone with the interest in the project, it is something of note.

I'm not going to be able to help too much (not a developer), but I'll help any way I can. Very interested to see if this can get up and running.

1 Like

I wish I had the skill for this too..but that node server is just for websockets which I believe HE can do and a few other custom apps exist using them. That might be good news for us someday....