Options for Sunpower solar integration?

Will this integration work for the latest Home Assistant Energy dashboard?

Wondering the same thing - wasnt going to go through the hassle before, but if it works with the energy dashboard Im installing a router in my garage I guess :slight_smile:

If you use Node-RED and are willing to do a little extra work, I’ve updated my Node-RED flow (requires MQTT) at Monitoring a SunPower Solar System – Scott Gruby's Blog to work with the new dashboard. I’ve been using it since the dashboard came out and it works pretty well.

How does one integrate the “krbaker/hass-sunpower” with the new " Home Energy Management" introduced in 2021.9.x ?

The sensors are missing some metadata needed for Home Assistant to recognize them as the right kind of data. You can fix this this with customize.yaml - customize any of the _lifetime_power sensors you want to use as follows:

  device_class: energy
  state_class: total_increasing
  meter_type: 1
  meter_type_name: ELECTRIC
  last_reset: "1970-01-01T00:00:00+00:00"

My example assumes the descriptive_entity_names option which is currently in pull request against the original repo. There’s also an issue open to add this metadata.

1 Like

Thanks for the guide! I used a GL-MT300N-v2, and it appears the latest firmware lets you turn off the AP without disabling the wifi uplink as well. It works now for me, and the release notes for 3.203 mention something that sounds like the problem you saw:

3. Fixed the problem that when turn off the AP in MT300N-V2, the repeater won't auto-reconnect.

Glad that was helpful, and thanks for the update! At the time, I remember reading about that issue on the GL-iNet forums, so it seemed to be a known issue and I hoped a fix would be coming.

And thanks @mhutch for that customize.yaml info as well (hadn’t used that before so initially I ran into some trouble implementing that file for the first time), and of course I used the original names such as “lifetime_power_1” since I don’t have that pull request you mentioned.

But now I have solar data on the Energy panel! It looks a bit odd, as I added all the inverters separately so it’s graphing the power separately for my 24 inverters. Is there an expected way to handle this? I always thought the integration should also provide a single set of totals that combines all inverters, but I’m not sure what is expected there.

1 Like

I agree. The integration should offer a total.

I also have an issue with my graphs because my consumption meter runs backwards for production so I had to split that out. Not sure if that’s something that can be solved in the integration though.

Yes, it does. You should be seeing 27 devices - one for each inverter, one for the overall consumption meter, one for the overall production meter, and one for the supervisor.

My PVS5 production meter seems to be going backwards for some reason so I have a template sensor to fix it. You might need to do the same.

I’m still trying to wrangle the consumption meter though. Home Assistant seems to want separate energy sensors for grid consumption and grid return, whereas the PVS has a single net grid energy meter. While it would be possible to process the data in the form Home Assistant wants using template sensors and Riemann integration sensors, it won’t be as accurate.

Yes, the integration could process the data into the form Home Assistant wants. Basically, it would need to maintain its own sums for the grid consumption. In pseudocode:

    delta = lifetime_consumption - previous_lifetime_consumption
    if (delta >= 0)
        lifetime_grid_in += delta
        lifetime_grid_out -= delta

This is also something Home Assistant could do when computing the energy panel values though.

I don’t see any way to do this with a template sensor unfortunately, as I can’t see any way for the template sensor to access the previous state of itself or of another sensor.

I’ve considered using template sensors to split the consumption power into two sensors, one for negative values and ones for positive values, and use Riemann integration sensors to compute the energy from the power. But this won’t be as accurate as the energy total maintained by the PVS itself.

Well that’s interesting. Yes I have 27 devices but I’ve ignored those production/consumption numbers because they’ve always been zero. Apparently something is wrong with those, as I didn’t even realize they are supposed to contain totals.

Interesting. Which firmware version are you on? I’m on 2020.1. Or maybe the production meter isn’t just a sum of the panels but is an actual meter using a CT around the combined solar output and that CT is missing on your installation?

Good question, could be a firmware issue. When I hit the internal web interface on the PVS5 I see ‘v2018.07.33’, so I assume that’s the firmware version. But I don’t know whether updating the firmware is something we can do. I haven’t ventured past that next screen which demands 2 or more forms of connectivity – currently it’s only connected to my network via a powerline interface (not counting the travel router on the internal side of course).

If you choose Commercial, it should let you proceed with only one form of connectivity and then the next page is a firmware update. If not, let me know and I can get you the direct URL to that page.

Also after rebooting my PVS, I found it has a built in AT&T SIM which is my second form of connectify along with wireless. Maybe yours does too.

Thanks, I didn’t realize that. My firmware is actually “2020.1, Build 3008”, so that other version number must just be for the web interface. My cellular connection says “SIM card error”. If I click continue on the firmware page I get the “Discovering Devices” page which says “Checking for existing devices” and then just goes blank. Not sure if that is an issue or just normal behavior.

My web interface shows the same as yours with those two different version numbers. I also had that same message for the SIM, but after a power cycle at the breaker it showed connected. I was surprised and had no idea it had a SIM.

I also had the same behavior with the discovered devices page. I was able to dump all of the different URLs available for the different pages, but don’t have them on hand. If you’d like me to post them I can get them later today.

Hi Scott! Tried loading the new nodeRED, been running the old one for a while, but cannot find how to integrate it with the MQTT. What are the steps after having the new flow running, and collecting information from the PVS?

Also, what is the correct way to update from old to new?


You have to setup an MQTT server (I use the one in Home Assistant’s add-ons) and then setup HA to use the MQTT integration. Then you have NodeRED point to the MQTT server. After that, it seems to just populate in HA.

I’m not sure there is a correct way to migrate; I just punted and started over with my data. Not a great answer, but a lot of what I do is just experiment (which I find kind of fun).

Ok, had it running, and the MQTT at the end stated connected, but the old sensors/entities stopped getting data.

Also could not see any difference in the new “Energy” setup.

Any other things that needs changing?