Download or API to feed PVOutput


#1

Hi,

I have Sense with Solar and just joined PVOutput. I can feed the service via API from my SolarEdge inverter or input via CSV. Is an API something in the future or at least a download capability?

“The PVOutput Integration Service allows PV logging (Generation) and energy monitoring (Consumption) data to be collected and uploaded to pvoutput.org
The following monitoring log file formats are supported -
aurora
xantrex
solarlog
growatt
suntellite
currentcost
flukso
sunnyroo
ted5000
enphase
enasolar
csv
powerwall”


#2

@frankge,
If you are a little industrious, you can use Selenium with python, or Rselenium to scrape the usage and solar day in the web app. What you will likely find is that your solar inverter runs a little high compared to Sense and compared to your net usage (your net usage will be slightly larger than your total usage minus inverter solar).

ps: What can you see if you adequately feed PVOutput ?


#3

I am in computers and was a programmer many moons ago, i’d rather point to an API or just dump and pump data files. PV Output is a little bit more comprehensive than the SolarEdge portal and Sense. If you have solar and have used PVWatts you might like this.

Below are some of the key features of PVOutput
Automatic uploads of live energy generation, consumption and temperature data
Graph and tabluate data in live, daily, weekly, monthly and yearly intervals
Search and discover similar solar installations within a geographical area
Compare live or daily data with another system, past date or postcode
Team up with others to combine generation data
Bulk data loading facilities to upload history data
Open API to automate data uploads and downloads
Email alerts when your live system becomes idle or uses excessive power
Photos, favourites and filtering capabilities
Mobile apps available for Android, iPhone and Windows Mobile


#4

I believe they use a websocket for this, not sure if they fallback to sse or long polling. I’d love access to that websocket though.


#5

Take a look at this project, it might be able to give you a head start:


#6

An official REST API with an OAuth Token based authentication would be ideal.


#7

There’s an older thread about this that you may want to add your likes to: Official REST API

The short answer is that we want to do this as well, but it’s a ton of work and we’ve got a pretty small dev team still, so other features taking more priority.


#8

yeah, it is a wishlist… I take the data and swivel chair it to PVOutput. No worries, just nerding out with my new solar install!


#9

How is Home Assistant pulling the data? https://www.home-assistant.io/components/sensor.sense/ is just web scrape? its been working long before the meter was introduced to the web… maybe you or someone with programming experience could build on what they did so we can get the data to PVoutput… i use it as well as I want to know and see the self consumption of my solar and differences for net metering… still waiting on Sense to add netmetering/self use into the app/web.


#10

Well, surely, the Sense device is being interrogated by their server in SOME way. I see the device on our home LAN. There must be some kind of authentification token being used by Sense to go to our IP address, sign onto the Sense device, and pull data. It’s probably a REST right there, I bet using JSON.

Anyone know if the license for Sense is restrictive in that they claim access to that data? I mean, we have bought the Sense unit. License or not, someone could isolate the sense output and reverse engineer it. PCAP? Wireshark?


#11

If you check out the Python project I linked to above, I think you’ll find this has already been done.


#12

@michael.davie,
Nice API. But I found that I had to extend the timeout parameters, otherwise I was seeing read timeout errors. Also interesting in that the API provides much greater precision (and of course many decimal places of false precision) than what we see in app power results.


#13

Yeah, I’m getting timeouts in my Home Assistant testing as well. How did you find you had to adjust it?


#14

I just kept bumping up the two timeout values in the sense_api.py sample program until everything worked reliably over time. Right now I have:

API_TIMEOUT = 5
WSS_TIMEOUT = 8


#15

i just uploaded a new ver and it was merged Friday that includes Frequency and Voltage. Also today I uploaded (not yet merged) a new one that uploads my data to pvoutput.org (its not the cleanest, but it works for now)

https://pvoutput.org/list.jsp?userid=64862

Thats my system in pvoutput pushing the sense data to it, and it does the math for things that sense currently doesnt do… aka net metering / self use and more.


Integration for Home Automation
Integration for Home Automation
#17

Nice! I’ll work on a pull request to make the timeouts configurable as a parameter, as I’m running into timeout issues with my Home Assistant component as well. Hopefully @kevin1’s suggested values will help.


#18

Looks like I’ll have to get a raspberri now. Was trying to avoid another project. Would have been simpler to be able to download to a CSV. Guess integration with things like Hue is more valuable, but really don’t know why, I don’t see sense as a home automation hub.


#19

CSV is coming… But raspberry pi projects are fun.


#20

Coming soon I hope, I have too much going on to add projects


#21

I’m running Ubiquity at home with the controller on a Debian VM, so I’m just running the python script on the same box.