Options for Sunpower solar integration?

GL-iNet Wi-fi is connected to my main LAN (192). WAN port is empty. The wired LAN connection is into the installer port. This isn’t correct?

Nope, the PVS should be in the WAN-port, and then you forward some ports, see the description above.

So, i misread this?

Mount the router in the SunPower box, plug the power connector to the USB port and the LAN connector to the installer port.

Wifi Repeater connected to household SSID (same as PVS6)
Router IP 172.27.153.10
Enabled Wan port 8080 forwarded to enabled port 80 (172.27.153.1)

Do I need a WAN wired connection in addition to the WiFi?

Sorry, PVS is on LAN!

Your network is on the WAN-side via wifi!

Then set it upp according to what Todd described above: Options for Sunpower solar integration? - #6 by tsaylor

Yes. That’s how I have it hooked up. Still got an IP fight going on. I have temporarily lost the wired PVS6 LAN connection as I setup a wireless connection as a test. Sunpower doesn’t have a WiFi disconnect button in their new app.

Thank you for your patience.

Well, I believe I’ve made some progress. The DHCP issue seems to have been fixed and I can reach the GL-iNet GUI using the assigned local IP (192). Found and installed the integration through HACS and am being asked to complete this dialog:

sun1

I tried the 192.x.x.x:8080 address here, and after some amount of time, this appeared:

sun2

Stuck again.

Fill out the IP (and port if applicable) of the GL-inet device to reach the PVS.
You can test-run the IP before putting it in using a curl from a terminal:
$ curl http://sunpowerconsole.com:80/cgi-bin/dl_cgi?Command=DeviceList

This should list all your panels and the meters.

Ran the command from the GL terminal.

root@GL-MT300N-V2:~# $ curl http://sunpowerconsole.com:80/cgi-bin/dl_cgi?Command=DeviceList -ash: $: not found

I can access the web server using just the 192.168.x.x IP. No port (8080) required. I do have the onboard AP disabled. 192.168.3.28:8080 gets me the Sunpower PVS management App web page.

Attempted the integration again this morning and was able to complete the process successfully.

Power meters are having issues:

Seeing this error hourly in the HA log:

2021-12-10 02:38:51 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 134, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 265, in _async_refresh
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 325, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 486, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 519, in _async_write_ha_state
    state = self._stringify_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 492, in _stringify_state
    if (state := self.state) is None:
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 273, in state
    value = self.native_value
  File "/config/custom_components/sunpower/sensor.py", line 213, in native_value
    return self.coordinator.data[METER_DEVICE_TYPE][self.base_unique_id][self._field]
KeyError: 'Power Meter'

Todd, Thanks for the detailed steps. I’m trying to setup my router.
How to do step 5
Should I change lan IP in the below page?

Yes, that is the correct place to set the LAN IP. The LAN side should be in the 172.27.153.x range (I used 172.27.153.10), as the SunPower device is normally expected to be found at 172.27.153.1.

Thanks Todd.

I wrote a complete writeup about all of this (minus the HA specific aspects): https://starreveld.com/PVS6%20Access%20and%20API.pdf

Here is my installation:

For my integration is use the SunPower component pointed at the Raspberry. For production and consumption into HA I don’t use the Sunpower Production meter (I could though), and not the Consumption meter (my installer does not routinely provide this hooked up). Instead I have a Sense installed. This took some doing because the clamps cannot be fitted around the busbars in my kind of panel. Instead I brought all breaker wires for each phase together and put clamps around those two bundles. Works great.

2 Likes

Nice work @dolfs! I see you even documented the PVS API details. :+1:

Seeing these warnings also:

2021-12-25 07:05:10 WARNING (Recorder) [homeassistant.components.sensor.recorder] The normalized unit of sensor.power_meter_pvs6m20450751c_power (kWh) does not match the unit of already compiled statistics (W). Generation of long term statistics will be suppressed unless the unit changes back to W
2021-12-25 07:15:10 WARNING (Recorder) [homeassistant.components.sensor.recorder] Entity sensor.pvs_communication_errors from integration sunpower has state class total_increasing, but its state is not strictly increasing. Triggered by state 318 with last_updated set to 2021-12-25T14:11:07.642063+00:00. Please report it to the custom component author.

Hi, I completed configuring GL MT300N and using it as a bridge and I can get all the inverters data coming to HA. I have 2 questions

  1. Any inputs on how to configure grafana. Do we have any template for Sunpower?
  2. I’m currently running HA in a docker on my laptop, so the data is only collected when my laptop is on. I’m looking for something like pushing the data to cloud (free). Any suggestions?

Re:
2021-12-25 07:15:10 WARNING (Recorder) [homeassistant.components.sensor.recorder] Entity sensor.pvs_communication_errors from integration sunpower has state class total_increasing, but its state is not strictly increasing. Triggered by state 318 with last_updated set to 2021-12-25T14:11:07.642063+00:00. Please report it to the custom component author.

It appears that the lifetime production on the PVS current clamps can roll backwards. I suspect this is either a calibration issue or something on the measured leg is drawing power. My guess is the micro-inverters draw a bit of power at times. I haven’t decided what to do about a fix for this and it seems somewhat harmless.

@GaryK 2021-12-25 07:05:10 WARNING (Recorder) [homeassistant.components.sensor.recorder] The normalized unit of sensor.power_meter_pvs6m20450751c_power (kWh) does not match the unit of already compiled statistics (W). Generation of long term statistics will be suppressed unless the unit changes back to W
is an odd message I haven’t seen, I filed a ticket to look into when I have a chance: sensor.power_meter_pvs6m20450751c_power sometimes W, sometimes kWh? · Issue #20 · krbaker/hass-sunpower · GitHub

Hi Padu,

  1. I haven’t seen any templates for Grafana/Sunpower but I can tell you what I’ve done. I’m using a Rainforest Eagle to collect my power grid usage (PG&E in my case), and displaying that information on a graph, then overlaying the Sunpower data as a negative value on the same graph. I also experimented with showing each individual inverter stacked, but eventually I didn’t really see the value in showing that level of detail so I went back to a single total for Sunpower. See the screenshot below for some basic details on the settings and queries I used. I should also mention that I configured HA to report its data to InfluxDB, and Grafana is using InfluxDB as its data source.
  2. HA really works best in an always-on environment. You might want to consider something dedicated, even if it is old/cheap hardware, or perhaps a Raspberry Pi. Just thinking about your concept, running Influx in the cloud may be feasible if the quantity of data is low enough for the limits of the free version, but I’m not sure what you would use to get the data there. It would probably require a bit of software running on the travel router to pass the data to the cloud. Something could certainly be written to do that, basically querying the Sunpower API periodically and then posting the results to Influx, but I’m not aware of existing software for that purpose.

Thanks for the details and suggestions Todd… will try to get a Pi.