Official API

Is there a way to get the solar readings from my sense? I would like to display those on my touchscreens at home. I have tried and failed on several options - node red, hoobs, etc. Mostly because I am not all familiar with these platforms. I would be keen if someone were able to walk me through this. I use Homeseer, but have started moving to Hubitat for a lot of my functions. And I use Sharptools for the touchscreens. Thanks for any help.

@simon, a few options:

  1. If you just want to sample / poll current solar production readings, then the informal API using python is the way to go.
    GitHub - scottbonline/sense: Sense Energy Monitor API
  2. There are also simple prebuilt solutions that use the informal API, like @dave 's Collector just above your post. I use Home Assistant to collect data on my household, including Sense data via an off-the-shelf Sense integration.
  3. I don’t know enough about Sharptools, but there might be a way to bring up the Sense web app inside a window on the Smarttools dashboard. I seen people on this forum do similar.
1 Like

I agree. There are some data science and BI things I’d like to correlate this to that are not integrations supported in Sense and also, the UI disappoints in that I do not see a means to enter a custom data period for measurement nor align to my billing cycles, etc.

@tateconcepts , there is a CSV data export capability in the web app that outputs either hourly or daily data for monthly or yearly intervals. That might help you.

I haven’t been able to find this feature, hopefully I haven’t missed it.

I want to be able to query a REST API to get access to the raw data that my Sense device is generating and sending to the Internet. The reason is that I would like to be able to watch what’s happening in near real-time and be able to turn loads on and off myself, based on what I’m seeing. It would only need to be the basic data, solar input in watts, usage in watts, for each collected interval (seems like several samples per second is being collected).

Thanks for considering this.
Mark

1 Like

@MarkDodrill ,
Here’s the informal Sense API.. It might do what you need though your request for data aggregated over several seconds is a big ask - I think the API is based on half second intervals.

1 Like

Is there a way to get the Sense data that’s sent over the Internet, directly from the Sense device? I’d love to be able to write a program to monitor what’s happening in real-time and be able to turn devices on and off myself based on what’s happening in real time.
It would be much more efficient to get this data directly from the Sense device, rather than going out to the Internet to get it.

Are there any plans to make this possible?

Mark

2 Likes

Not today. I think any API that would talk directly to the Sense monitor would have the potential to overwhelm the existing CPU resources of the already heavily burdened monitor. Of course, if your are really ingenious and persistent, you could try to decipher a mirrored stream of packets going to the Sense mothership.

The informal Sense API does let you sample Sense data from the mothership/cloud and you could certainly build your software to work with that. Or you could look into Home Assistant which already has a nice Sense integration for data collection and can be used with something like Code Red control, to switch smart devices in your house on and off.

I also would love at least lighttpd or nginx locally and just be able to scrape the numbers for generation/consumption off it incase of cloud outage or other major issue with sense to make it at least a energy monitor and can still get data off of it. A local API even better, but i could understand with the hardware limits why that may not work.

Thanks for merging this with existing threads, sorry I missed it.
Will look at the unofficial Python API to get what I want – it looks like just what I was wanting!

Thank you.
Mark

6 posts were split to a new topic: Python Script for Sense + Weather Data Tool

Did sense kill off the API? i can no longer connect?

mine is still working, it just did it 15 seconds ago, no issues

Ok thanks… suddenly started working that night. maybe i was just blocked for some reason… but had stopped for a little over a day.

It’s been four years since Sense acknowledged the need for an API, and it seems there’s still no proper API?

@rmann, maybe I’m naive, but I have used the Sense informal API a few times and find it useful and relatively easy to use, though limited to just a snapshot of the power and voltage data at any one moment in time. What would you do differently if there was a “proper” API for this data ?

For one, I’d document it :wink:

I’ve found a couple of SDKs for it on Github, but nothing that really shows the endpoints’ usage (I’m not coding up something that can use the existing Python SDKs). I can pore over them to figure it out, of course, but I haven’t done that yet.

And by “proper” API, I mean I’d like to query the Sense device directly, locally, to at least get the total power stats.

I can see there’s a websocket connection to the server to get the rapidly-updating info, and hopefully I can connect to that, but I haven’t tried yet and am not sure what authentication it might use (it’s much less standardized with websockets). I also don’t know if it uses Phoenix or some other messaging layer on top.

Lastly, I had to turn off 2FA to be able to authenticate with the one API I did try; dunno if someone has figured out how to include the 2FA token. A “proper” API would have a client key to help facilitate that sort of thing (i.e. 2FA is more useful for preventing malicious modification of an account, and perhaps less critical for read-only APIs).

Thanks for the specifics.

  • This is the GitHub project I’ve used for a few interesting experiments with Python.
    GitHub - scottbonline/sense: Sense Energy Monitor API

  • Agree with you on documentation, though I found the example to make usage pretty self-explanatory, including authentication.

  • I’m just another user, but I find the requirement to talk to the Sense monitor directly puts your request in another universe entirely, given the cloud-connected nature of the Sense product. There are probably better devices, like the Rainforest Automation Eagle 200, to use if you want a local API.

  • I agree on the 2FA, though I have found that 2FA on some of my home IoT devices screwed up various integrations versus simple password-based authentication. I haven’t moved my Ecobees to 2FA because there are other home integrations that still can’t handle 2FA.

What are you trying to build ?

1 Like

I only just discovered the Python and the Sense API a couple of months ago, and I already have that TesSense app written that I use to control my Tesla’s charging, so it only charges on sunshine.

I have learned about all sorts of other APIs besides just the Sense and the Tesla ones. There’s one for Sunrise/set, one turns coords into addresses, and the most important one is the TPLink API that has allowed me to contact each of the SmartPlugs that the Sense is talking to and control them directly. I now have it set up so when the Hot Tub kicks in all the space heaters in the place turn off, keeps me using as little power from the grid as possible.

That last one was a bitch, had to learn how to program for multitasking to use any functions, and I got a lot of help from the SenseLink guy Charles P., he did the initial pass at getting my code to show the Tesla charging on the Sense monitor. Thx again Charles, and Tim and Scott…

2 Likes