Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to integrate PV Supervisor version 2.2.2, Build 234 #31

Open
meanhacker opened this issue Apr 3, 2022 · 22 comments
Open

Unable to integrate PV Supervisor version 2.2.2, Build 234 #31

meanhacker opened this issue Apr 3, 2022 · 22 comments

Comments

@meanhacker
Copy link

meanhacker commented Apr 3, 2022

Hello, I followed the guide to setup a Raspberry Pi inside of the comm cabinet, however it appears that the PV Supervisor is not compatible with the integration. Below is the setup:

  • Home Assistant OS v2022.3.8 running on Raspberry PI 3 Model B v1.2
  • Another Raspberry PI 3 Model B v1.2 running Raspberry PI OS Lite with haproxy installed (hostname: sunpowerpi, IP: 192.168.1.5)

I am able to access the PV Supervisor Management Console, below is a screenshot:

SunPower Console

When I enter http://sunpowerpi/cgi-bin/dl_cgi?Command=DeviceList into the browser, I'm presented with an HTML response:

SunPower Response

=========EDIT=========

I recently came across a command that pulls all the information given a serial number of the device, however the response is still in an HTML format:

http://sunpowerpi/cgi-bin/dl_cgi?Command=DeviceDetails&SerialNumber=146xxx

image

When I inspect the page and indent the response for readability, this is what I see:

<div class='accordionItem'>
<h2 id='146xxx' type='WATTNODE'><img/>
	<span class='working'>Power Meter 146xxx</span><img/>
	<span class='working'>Working</span>
	<span class='info'>P0:Modbus Slave ID: 11</span>
	<span class='link'></span>
</h2>
<div>
<table>
	<tr><td class='working'><b>Last&nbsp;Data:</b>&nbsp;
		<span class='DateClass'>2022,07,20,17,27,24</span></td>
	<td class='info'><b>CT&nbsp;Scale&nbsp;Factor:</b>&nbsp;
		100&nbsp;&nbsp;</td></tr>
	<tr><td class='info'><b>Last&nbsp;Refresh:</b>&nbsp;
		<span class='DateClass'>2022,07,20,17,27,38</span></td>
	<td class='info'><b>Total&nbsp;Lifetime&nbsp;Energy:</b>&nbsp;
		69006.2343&nbsp;&nbsp;kWh</td></tr>
	<tr><td class='info'><b>Model:</b>&nbsp;
		WNC-3Y-208-MB</td>
	<td class='info'><b>Avg&nbsp;Real&nbsp;Power:</b>&nbsp;
		-0.4899&nbsp;&nbsp;kW</td></tr>
	<tr><td class='info'><b>Serial&nbsp;Number:</b>&nbsp;
		146xxx</td>
	<td class='info'><b>Avg&nbsp;Reactive&nbsp;Power:</b>&nbsp;
		-0.2289&nbsp;&nbsp;kVAR</td></tr>
	<tr><td class='info'><b>Software&nbsp;Version:</b>&nbsp;
		19</td>
	<td class='info'><b>Avg&nbsp;Apparent&nbsp;Power:</b>&nbsp;
		0.5408&nbsp;&nbsp;kVA</td></tr>
	<tr><td/>
	<td class='info'><b>Avg&nbsp;Power&nbsp;Factor:</b>&nbsp;
		-0.9059&nbsp;&nbsp;</td></tr>
	<tr><td/>
	<td class='info'><b>Avg&nbsp;AC&nbsp;Frequency:</b>&nbsp;
		60.0627&nbsp;&nbsp;Hz</td></tr>
	<tr><td class='MadCow' a='100' b='3'        ></td></tr>
</table>
</div></div>

In HomeAssistant, when try to initialize the integration, it doesn't work. I tried providing the hostname and IP address:

HomeAssistant Cannot Connect

  1. Would it be possible to update the plugin to support this type of response from SunPower Supervisor?
  2. Has anyone else come across this version of SunPower Supervisor? It appears it was installed all the way back in 2014.
  3. While browsing the Documentation files, I came across a lot of interesting and potentially useful reference documents:

SunPower Documentation

Here is an example of what the setup looks like on my end, except I don't have the Ethernet adapters:
https://us.sunpower.com/how-troubleshoot-icd-sunpower-monitoring-system-sms-2x-pv-supervisor

@jcronq
Copy link

jcronq commented Sep 15, 2022

I've been poking around the same version of the pv supervisor. Just appears to be this older version of the cgi_bin script is returning the data pre-embedded in http. I think all the data is there to be able to integrate with this component.

Will take a shot at it and report back, or create a PR.

@jcronq
Copy link

jcronq commented Sep 18, 2022

@meanhacker I think I've got this working. I am running tests for a few days to see how it behaves before raising a PR.

I see you have a Power Meter, which I don't have. It would be helpful if you could test the beta-feature (support for v2.2.2/3) as well. It's available at this fork: https://github.com/jcronq/hass-sunpower.

@meanhacker
Copy link
Author

meanhacker commented Sep 18, 2022 via email

@meanhacker
Copy link
Author

meanhacker commented Sep 18, 2022 via email

@jcronq
Copy link

jcronq commented Sep 18, 2022

Can you inspect & attach the raw http that's returned for DeviceList command?

http://sunpowerpi/cgi-bin/dl_cgi?Command=DeviceList

@meanhacker
Copy link
Author

meanhacker commented Sep 18, 2022 via email

@jcronq
Copy link

jcronq commented Sep 19, 2022

I've pushed an update to the same fork that should handle your device list (there was a &nbsp; tag in your PVS device name that I didn't have).

If this doesn't work. Please send along the error message from the logs along with the raw http result from calling DeviceDetails on each of your devices.

@meanhacker
Copy link
Author

meanhacker commented Sep 19, 2022 via email

@jcronq
Copy link

jcronq commented Sep 19, 2022

That's my bad. Accidentally committed code I was using for testing the data you sent me. Ok to try again now.

@meanhacker
Copy link
Author

Ok, I think we are getting a bit closer now, but I'm still not seeing the sensors. Attached latest logs:
sunpower-logs.txt

@jcronq
Copy link

jcronq commented Sep 20, 2022

Ready for another test.

  • Cleaned up &nbsp tags found in data labels and values.
  • Handling negative values.

@meanhacker
Copy link
Author

Hello, currently the sun is down is and the inverter is offline (showing an Error status), so I'm not sure if that's contributing to the errors:
sunpower-logs.txt

Here is what the response looks like with the inverter being offline:
device-list.txt
inverter.txt

@jcronq
Copy link

jcronq commented Sep 20, 2022

Ready for another test. Wasn't related to inverter being offline, I missed a point in the parsing where I was handling &nbsp; tags incorrectly, which caused the argument-name conversion (to the v5/6 naming convention) to fail.

I ran the data you sent through it. It should work now... Famous last words.

@meanhacker
Copy link
Author

I'm finally seeing the sensors! However some things are missing like Inverter Avg AC Power/Voltage/Current, Avg DC Current.
sunpower-logs.txt

@jcronq
Copy link

jcronq commented Sep 20, 2022

This is expected behavior. Only values that are used in the hass-sunpower component are being mapped. Additional values that appear in version 2.x.x but not used in the component are not mapped. Primarily, I don't know what the key-name would be in version 5/6.x.x, as I am on version 2.2.3 myself.

Only concern I have with your logs is that your Inverter isn't publishing Avg DC Power (maps to p_3phsum_kw). I don't think this will impact you negatively though. The Power dashboard in Home Assistant wants Total Lifetime Energy (maps to ltea_3phsum_kwh) which you do have.

Your Power Meter does seem to be publishing an Avg DC Power which can be used in place of the inverter's missing value if you ever desire it.

TLDR; Your logs look good. :)

@meanhacker
Copy link
Author

Hello Jason, thank you for taking a look at the logs. The dashboard seems to be working correctly, however it took me some time to understand that everything is in kWh. I would like to monitor my solar production from home usage separately, would it be possible to create a sensor for the inverter power usage (in kW)? Ideally, it would be interesting to monitor the solar performance and home energy usage over time, but it looks like the power meter is capturing both solar and home usage which means solar would need to be subtracted from the watt meter to get a true home usage reading. Thank you so much for getting this to work, below is what my dashboard looks like!
image

@meanhacker
Copy link
Author

meanhacker commented Oct 11, 2022 via email

@meanhacker
Copy link
Author

meanhacker commented Oct 11, 2022 via email

@krbaker
Copy link
Owner

krbaker commented May 15, 2023

My gut feeling is this should probably be a different integration. They are both hacky in their own way (missing fields and such is enough of a problem with the pvs5/pvs6). Thoughts?

@jcronq
Copy link

jcronq commented May 15, 2023

I probably came to the same conclusion given I never raised a PR. Hacky by definition too, lol.

I also don’t have a ton of interest in testing a PR. It’s been working for me for 7 months without issue, so don’t want to rock the boat.

I’d be surprised if there’s anyone else out there with this old hardware, and a desire to connect to home assistant. So not a ton of value in investing additional effort. I personally planned on leaving this issue open indefinitely in case anyone else was desperate enough to find it.

@meanhacker
Copy link
Author

I have also been satisfied with the performance of jcronq's fork and it has been working well for the past 7 months. I don't mind keeping this issue open if it helps others find this code/thread.

@krbaker
Copy link
Owner

krbaker commented Apr 17, 2024

Looking at the fork I think its less intrusive than I was expecting (I like the ~adapter). I'm also abstracting some of the code for ESS / PVS work so I may take another look at integrating this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants