Solar Generation Monitoring

I have a PVI-5000-OUTD-US and a PVI-4.2-OUTD-S-US.

Both are currently connected via their serial connection to the Sun Power Monitor unit. I’m curious, is there a way to tap the serial line to send data to ST (I have an Serial-> Ethernet converter) while maintaining the connection to the Sun Power Monitor?

The other option may be to tap the USB port on both units.

You can get inverter data through USB port using this Solar Powered Home -- Communicating with the Aurora Inverter

It looks like he was using USB -> serial -> inverter… I was referring to the USB ports that are installed on the inverter itself.

Yes, that’s what he uses. It’s a USB serial port.

My serial lines from the inverter are already being used by the Sun Power Monitoring system. Which I have to leave connected because the system is leased.

Is it possible to hijack the same serial line for sending data off to ST? I played around with trying to add a Ethernet to serial adaptor to the line so I could connect the Power One monitoring software without success. I couldn’t figure out a way to get both the Sun Power Monitor and the Ethernet Serial adaptor to play nice with each other… Not sure if that’s even possible.

I assume SunPower monitor is connected to RS-485 bus. You cannot have two masters on the RS-485 bus. It’s possible to sniff the bus communications passively, but it would require custom software to do so. PVI-5000 has a USB port, if I remember correctly. This’s what you should use to connect your Aurora monitor. You’ll only be able to read data from one inverter though.

That’s what I figured – Thanks for the help!

I figured it out, now if i am producing power the switch is in the on position to charge some batteries. When i am not producing power it turns off.

I just got into SmartThings and adding solar power generation to my dashboard would be great. My system is monitored by an eGauge system and they do have an API documented at https://www.egauge.net/docs/egauge-xml-api.pdf. I have retrieved data from the eGauge using URI, but I have no idea what to do with it. If any of the developers here would like to take a shot at this or get me started with some sample code, I would really appreciate it. All I really care about is for the live Solar generation value in kW. I ran http://egauge15753.egaug.es/cgi-bin/egauge?noteam and got data back. If you want to see eGauges built-in monitoring just removed the /cgi… part from the hyperlink. I just need help figuring out how to use the data in SmartThings. The data I needs comes back as:

-<meter title="Grid">
<energy>1805.1</energy>
<energyWs>6498493728</energyWs>
<power>-3278.7</power>
</meter>
-<meter title="Solar">
<energy>2741.7</energy>
<energyWs>9870259918</energyWs>
<power>3943.6</power>
</meter>

Under Grid, a negative value for power indicates that I am putting energy back on the Grid. That could be used to change the color of the tile, i.e. green if the value is negative, red if the value is positive. Under Solar, power divided by 1,000 will give me a live reading in kW. The tile could be green and showing the solar power if solar energy is being put back on the grid, and the tile could be red and showing the Grid power value if that value is positive; meaning I am using energy from the grid.

@Ron: Would you like to show your Enphase/SmartThings integration to my colleagues here at Enphase?

1 Like

Sure how would I go about doing that ?

I just stumbled on this thread. I also have enphase inverters and I’m using the local IP address of my envoy to collect the data every 5 minutes.

http://192.168.0.xxx/api/v1/production

I wrote a device type thats working well. I slapped it together with parts from other well known device types with a lot coming from Barry Burkes Aeon Hemv2

I normally wouldnt distribute code in this stage since its still a work in progress but it functional. Youll need to modify the ranges for whats appropriate to your system to get a meaningful coloring of the outputs. All it requires is for you to put your envoy’s ip address in, which I hardcoded mine as the default. No API keys necessary.

The 3 tiles across the top are current watts, time of last update, Wh for the day
second row is the current peak wattage for the day, an icon to show if its trending up or down, total kWh for the system
last row is the difference between the current watts vs the last reported watts.

https://github.com/herbcarroll/SmartThingsPublic/blob/master/devicetypes/herbcarroll/enphase-envoy.src/enphase-envoy.groovy

I have an enphase system so I wrote this driver for my system and use it on my home. Of course like all “polling” devices the polling does not work since SmartThings seems incapable of fixing their polling issues. Pollster does work for this device so I use pollster to make this work or just refresh it manually if you are not trying to drive any part of your automation with this device.

@JayGo you asked me to show to your colleagues at enphase. Feel free to share this with them.
My device code for Enphase is here if anyone is interested.

You need to have a enphase dev account key to use this device but that is free to setup so shouldn’t be a problem.

Thanks, @Ron,

I don’t have your contact information, so you can reach me at jgoldin@enphase.com. We can do a remote demo or discussion with our engineers.

JayGo

@Ron
I’m trying to use your Enphase monitor, but I can’t seem to get it working. I never had a Dev account before, but I signed up for the Free Watts account just for this. I’ve used PVOutput for a while now and they never needed this Dev account. I tried putting in my Dev account ID, my system ID, and my Dev Key (which I’m assuming is the one that they put into my Application page). All I ever get are blank squares in the app. No errors, but no data either. I originally tried with my regular API user ID too, but to no luck.

I know this thread is older, but I’d love to incorporate this into my Smartthings system.

@chewie8han it would be difficult for me to help without much more information. I don’t know what steps you took, I don’t know if you configured the device correctly when you installed it.

Perhaps show the device in your ide.

If you plan to not redact your key,system_id,user_id then send me the screen shot via PM and I can test your configuration. Otherwise are you sure you have an enphase dev account.

Are you logging in here to create your account ?
You should have the api access section completed and it should contain your key.
https://api.enphaseenergy.com/

I am not sure what “Free Watts account” is.

I created my developer account here

Thanks @Ron. The device is showing as InActive (but then so is yours). From the little bit that I can see from your first screenshot, I have my numbers in the correct locations. I have my API access in the account information like your second screenshot (that shows the user ID (starting with 4d). That page doesn’t show my developer key though. I signed up for that from https://developer.enphase.com/ and get it from the Applications page. It looks as long as the number you listed next to key.
I just saw something… Do I need to also use Pollster too? I just saw that in the bottom of your first screenshot. I set it up to Poll, but I still don’t get any information in it.
The Free Watts account was just the free version when I signed up for the Developer access for Enphase.
Here’s screenshots of my information.



Thanks Ron.

You should be able to test using the “refresh” button which is what pollster does once you set it up (I think I implemented both refresh and poll).

Pollster doesn’t really work either because it stops polling after a while also. Basically ST has several bugs in the system that prevent polling of devices and it has been broken for a LONG time.

The best way to poll is to find a device you have in your network that reports data regularly and write a smart app that subscribes to that data and polls the PV when that data arrives. I have an aeon smart switch that reports according to the schedule you request very reliably so I would attach to that.

Myself I have not found a real need for this device to be automated yet so I just press refresh when I want to see the latest data.

Does refresh work for you ?

Unfortunately, that doesn’t work either. I’ve heard of the polling issues, that’s why I tried pollster when I saw it in your screenshot. I’m fine with just the refresh. I really don’t need it to constantly be checking when I can do it myself.
I actually was more interested in using @herbcarroll’s approach since it just connects directly to the envoy, but unfortunately he’s taken his code down.
This is my first time having to use a Dev account though. Other apps that I’ve used have never needed me to have a Dev account/key. I’ve only needed my user ID and system ID from the Enphase Account page. I’m guessing it might be something with that. My Dev key is the one that’s given for MY app (which doesn’t exist). I’m actually wondering if it should be the API key for YOUR app. Just a thought. Do you know of anyone else using your Device? If so, clearly I’m wrong. If not, maybe I’m right. It’s your call on if you want to share that.
Thanks

I didn’t realize that was possible. That is cool. I bet you could write a raspberry pi app that could send data

The point of the app key is to publish an app using your key and they they allow a certain number of “hits” for data for that key. So yes technically if I was releasing a Android app or an iPhone app I would be charging for it and if the hits were exceeded I could then pay enphase for more. But since I am publishing this code for free the best approach is for anyone using it to create their own app key and use that so they can have their own hit count limit. Also with SmartThings there is no way to hide the key in the code. I have to publish the code as source so everyone would know my app key and could use it to poll enphase any way they want. This could use up my hits in no time. You are not supposed to make the key public.

You mention that you don’t see the app key you created in your account. This means you didn’t tie the app key to your system. I think that is why things aren’t working. Check out the api documentation. You can test if you app key is working by just hitting the url in a browser and seeing if you get json back.

https://api.enphaseenergy.com/api/v2/systems/{YOUR SYSTEM ID}/summary?key={YOUR API KEY}&user_id={YOUR USER ID}”

Is should look like this.