hultenvp / solis-sensor

HomeAssistant integration for the SolisCloud PV Monitoring portal via SolisCloud API
Apache License 2.0
190 stars 41 forks source link

Solis AC Output Total Power: unknown when zero (night-time) #338

Closed hawkeye100 closed 3 months ago

hawkeye100 commented 6 months ago

Integration has been working really well for some time - thank you.

More recently (likely since HA update/upgrades), I have noticed that in the evening/overnight the AC Total Power entity is showing as 'unknown', instead of zero. This causes a display issue on a graph that is expecting numerical data.

The export data from Soliscloud shows numeric zero rather than blank or other value at the same time.

During the day when power is being generated, there is not an issue.

I suspect there is a simple explanation, and/or I have missed something in which case I apologise though I have been unable to find a relevant mention of 'unknown' in another issue here or on HA forum (though could have missed it)

Versions: Solis sensor (installed from HACS): 3.50 HA: Core 2023.11.2 Supervisor 2023.11.6 Operating System 11.1 Frontend 20231030.2

My initial thinking as a workaround is to create an automation (or maybe a template sensor) that checks the value and if it is 'unknown' then sets it to zero (untested as yet) and use that where I need it.

The only unusual thing about my HA is that for some reason I have 2 Solis inverters listed, though the other is disabled, as are its entities to avoid conflict (I did not want to delete the second inverter in case it messed up the working config). The other inverter has an inverter serial beginning with many zeroes and ending with some digits from the actual working inverter/config. [wondering if this is legacy from a previous upgrade perhaps]

Here are some screenshots. Any help gratefully received, thank you.

2023-12-08_010 2023-12-08_006 2023-12-08_005

SadGamerGeek commented 6 months ago

I’m also getting exactly this.

Versions: Solis sensor (installed from HACS): 3.50 HA: Core 2023.11.3 Supervisor 2023.11.6 Operating System 11.1 Frontend 20231030.2

hultenvp commented 5 months ago

I do not see that, do you perhaps restart HA somewhere during the night?

viking2010 commented 5 months ago

What I find happens is that the value never goes to zero. The last visible value from when there's no more light (usually 1 watt) remains until midnight. Then, the value changes to zero until the morning when it starts generating again. However, if HA is rebooted during the night for whatever reason, the Current PV Power value (solis_inverter_ac_output_total_power) changes to Unknown. It isn't updated again until the morning when power is being generated. The dc_power_pv1/pv2 values go to zero, so I had considered using the two PV array values I have, adding them together in a template sensor and set the solis_inverter_ac_output_total_power to the total of those two values. But it's only 1 watt, it doesn't make any different in the grand scheme of things! lol

But, I suppose it would be good to know why the solis_inverter_ac_output_total_power value isn't being picked up as zero when Solis does show the value on their portal as zero.

SadGamerGeek commented 5 months ago

Exactly the same here. The DC Power PV1 and PV2 both drop to zero after sunset, but the total output power just seems to stay on the most recent >0 value (generally between 1W & 4W) until midnight when it changes to zero. For me it can go back to a very small value again well before sunrise. No reboots involved.

hawkeye100 commented 5 months ago

I do not see that, do you perhaps restart HA somewhere during the night?

Not to my knowledge. It has happened again recently.

This is my workaround (do not pretend is is good or pretty but it seems to work for me) - a template sensor that I then use in the graphs: ` - sensor:

https://github.com/hultenvp/solis-sensor/issues/338#issuecomment-1879032218: I get 7W when it gets dark and then zero from midnight (some nights) and have assumed this is from street lights that switch off then, but I may be wrong especially as on others we just get 'unknown'

hastaboera commented 5 months ago

What I find happens is that the value never goes to zero. The last visible value from when there's no more light (usually 1 watt) remains until midnight. Then, the value changes to zero until the morning when it starts generating again. However, if HA is rebooted during the night for whatever reason, the Current PV Power value (solis_inverter_ac_output_total_power) changes to Unknown. It isn't updated again until the morning when power is being generated. The dc_power_pv1/pv2 values go to zero, so I had considered using the two PV array values I have, adding them together in a template sensor and set the solis_inverter_ac_output_total_power to the total of those two values. But it's only 1 watt, it doesn't make any different in the grand scheme of things! lol

But, I suppose it would be good to know why the solis_inverter_ac_output_total_power value isn't being picked up as zero when Solis does show the value on their portal as zero.

Hi, i experience the same issue. Sensor remains with last values untill midnight to only then go to 0. Screenshot_20240109_215610_Home Assistant

I found that the HA sensors last update is before the last update to solis cloud before it goes offline. Screenshot_20240109_214346_Home Assistant Screenshot_20240109_214530_SolisCloud

SadGamerGeek commented 4 months ago

Not sure if it's related, but since updating to the latest HA Core (2024.2.2 - though I've just seen there's now a 2.3), I'm getting relatively frequent unknown values even when the sun is out. image

hultenvp commented 3 months ago

Integrated @hozob's fix. Will release in 3.5.2