[ST Edge] Sense Energy Monitor [BETA]

This Edge driver provides an integration between SmartThings and Sense Energy Monitor using a LAN bridge server. Once you have the bridge server running (via simple executable or docker container), SmartThings will automatically detect and add your Sense devices, including Total, Always On, and Other.

Installation

Features and Notes

  • Compared to the full-blown SmartApp integration, this driver’s functionality is more limited. However, you will still get devices created in SmartThings with both energy and switch capabilities. More functionality may be added in the future.
  • The Edge driver and bridge server should automatically handle IP changes if they occur. They use SSDP to communicate during discovery and when IP/port updates occur.
  • If you feel inclined to donate, you can find links on the GitHub page.

Sample screenshots:

5 Likes

Can we see the total energy consumption?

Yes - Total, Always On, and Other get created as their own devices in SmartThings.

So far so good no issues. I have this configured on one of my Raspberry Pi 3B

1 Like

It’s working well for me. I really appreciate this, thank you for providing a very useful integration!

I’m almost all the way there on this one, but I don’t think it should be saying “Connected: 0 Devices?”

It should not - that’s very strange. What do your bridge server logs say? Also, what do you get wen you hit http://192.168.0.4.8091/status ?

Unfortunately, I’m not all that adept at viewing the server logs. I’m not sure there’s a good way with my setup - I’m really only able to access the rpi through the juicy app on my phone and typing everything out there.

However, when I go to the status, I get the below, so something is working. No devices are showing up in smartthings, however.

[{“id”:“0c699b67”,“name”:“Microwave”,“state”:“off”,“usage”:0},{“id”:“2c5daa0b”,“name”:“Coffee Maker”,“state”:“off”,“usage”:0},{“id”:“337262be”,“name”:“Oven”,“state”:“off”,“usage”:0},{“id”:“6bdf4806”,“name”:“Water heater”,“state”:“off”,“usage”:0},{“id”:“83ae7847”,“name”:“Heat 3”,“state”:“off”,“usage”:0},{“id”:“a6a93a01”,“name”:“Disposal”,“state”:“off”,“usage”:0},{“id”:“ac5d6315”,“name”:“Heat 1”,“state”:“off”,“usage”:0},{“id”:“always_on”,“name”:“Always On”,“state”:“off”,“usage”:0},{“id”:“b2267d80”,“name”:“Stove”,“state”:“off”,“usage”:0},{“id”:“c361fb06”,“name”:“Heat pump”,“state”:“off”,“usage”:0},{“id”:“c7a224bd”,“name”:“Washer”,“state”:“off”,“usage”:0},{“id”:“eaaefb3d”,“name”:“Heat 2”,“state”:“off”,“usage”:0},{“id”:“f03cd360”,“name”:“Dryer”,“state”:“off”,“usage”:0},{“id”:“f17539b3”,“name”:“Stove 2”,“state”:“off”,“usage”:0},{“id”:“unknown”,“name”:“Other”,“state”:“off”,“usage”:0},{“id”:“00total”,“name”:“Total”,“state”:“on”,“usage”:0}]

I’m most looking forward to having this setup so I can have a visual indicator of solar function on a couple of dashboards throughout the house. Our inverter went down last year and I didn’t notice for about a month - I don’t check the Sense app as often these days.

I was able to retrieve the following using the “docker logs” command (sorry for the wall of text, I’ll truncate it if we’re able to figure something out!):

3/4/2023, 1:38:22 PM | Sense HTTP server listening on port 8091
3/4/2023, 1:38:23 PM | SSDP server up and listening for broadcasts: urn:SmartThingsCommunity:device:SenseController
3/4/2023, 1:40:24 PM | Sense HTTP server listening on port 8091
3/4/2023, 1:40:25 PM | SSDP server up and listening for broadcasts: urn:SmartThingsCommunity:device:SenseController
3/4/2023, 1:49:17 PM | Got new username/password from hub. Initializing connection.
3/4/2023, 1:49:29 PM | Authentication error: request to https://api.sense.com/apiservice/api/v1/authenticate failed, reason: connect ETIMEDOUT 52.1.45.97:443
3/4/2023, 1:50:01 PM | Got new username/password from hub. Initializing connection.
3/4/2023, 1:50:19 PM | Scheduling device refresh
3/4/2023, 1:50:19 PM | Found Microwave
3/4/2023, 1:50:19 PM | Found Coffee Maker
3/4/2023, 1:50:19 PM | Found Oven
3/4/2023, 1:50:19 PM | Found Water heater
3/4/2023, 1:50:19 PM | Found Heat 3
3/4/2023, 1:50:19 PM | Found Disposal
3/4/2023, 1:50:19 PM | Found Heat 1
3/4/2023, 1:50:19 PM | Found Always On
3/4/2023, 1:50:19 PM | Found Stove
3/4/2023, 1:50:19 PM | Found Heat pump
3/4/2023, 1:50:19 PM | Found Washer
3/4/2023, 1:50:19 PM | Found Heat 2
3/4/2023, 1:50:19 PM | Found Dryer
3/4/2023, 1:50:19 PM | Found Stove 2
3/4/2023, 1:50:19 PM | Found Other
3/4/2023, 1:50:19 PM | Scheduling websocket refresh
3/4/2023, 1:50:19 PM | Data not ready yet - try again next time.
3/4/2023, 1:50:20 PM | Device missing: solar
3/4/2023, 1:50:20 PM | Data processing error: Cannot read properties of undefined (reading ‘usage’)
3/4/2023, 1:50:27 PM | Data not ready yet - try again next time.
3/4/2023, 1:50:31 PM | Authentication error: request to https://api.sense.com/apiservice/api/v1/authenticate failed, reason: connect ETIMEDOUT 34.237.101.216:443
3/4/2023, 1:51:01 PM | Authentication error: request to https://api.sense.com/apiservice/api/v1/authenticate failed, reason: connect ETIMEDOUT 52.1.45.97:443
3/4/2023, 1:51:20 PM | Device missing: solar
3/4/2023, 1:51:20 PM | Data processing error: Cannot read properties of undefined (reading ‘usage’)

3/4/2023, 2:43:30 PM | Socket error connect ETIMEDOUT 3.222.38.114:443

Ok, well that clears up why SmartThings isn’t getting any data. Something is different about the way you’re getting data. Looks like you’ve got solar, which I don’t have, although it should still work. Let me look back over the old code to see how I dealt with that before. I think I’ll need to tweak something.

Sounds good. Never know what information might be relevant, so let me know if there’s something you need.

This is my 2nd Sense unit. The first one failed 6mos ago. The credentials are the ones I’m using now to access home.beta.sense and my app, both of which are working fine.

@Nhaley - I think I got it. I pushed a new docker image that should better handle Solar. If you’ll give that a try and verify it works, I’ll push out new compiled exe’s, too.

Everything went through, 17 devices picked up. Looks like it took a few minutes for a few of them to register, but everything seems to be there!

Thanks so much for putting the work into this, I’ll be sure to brag about it on various sites and hopefully steer more people your way.

1 Like

Some data I thought might be useful for some (maybe solar more than standard): daily total solar and usage. These figures are probably what I look at most, but they may not be accessible?

Added the current usage and solar to my sharptools dashboard :slight_smile:

1 Like

Also, one thing I noticed and I’m not sure is me or more universal or Sense-sprecific- I seem to be getting a lot of disconnections, where all the devices drop randomly?

Update: may just be a flaky connection (which Sense is infamous for). I rebooted my router and readings appear to be more stable.

On the logs, I’m getting the below:

1 Like

Yeah this is a good idea - I actually had these in the previous version, so it’s definitely possible. I’ll see about adding it when I get some time.

Running into some issues with this.

I am running the bridge sever on a windows machine.

Everything works fine at first but after about 5 minutes it stops working. I notice even the device goes offline in the ST app.

image

image

A couple things I noticed was first of all I get a notice that version 1.0.1 is available however I don’t see it anywhere.

After all devices are discovered I am getting this messsage and no following messages.

image

Ah yes. I’ve been rather busy and haven’t gotten back to this. I never generated binaries for the newest version. I’ll try to do that later today or tomorrow…

Thank you for your hard work!

I finally did a proper push of the latest version, including updating the binaries. See if that works any better.

1 Like