safepay / sensor.fronius

A Fronius Sensor for Home Assistant
MIT License
82 stars 33 forks source link

No longer reporting power usage at night #47

Closed stavroz closed 3 years ago

stavroz commented 3 years ago

For some reason after the update to fix the manifest I do not get power usage data when the panels are not powered overnight.

staticlama commented 3 years ago

I'm having the same issue

rybackisback commented 3 years ago

power, relative_autonomy, day_energy do not work in version 0.94. Downgraded back to 0.93

algernon2607 commented 3 years ago

In fact , it is the brbraga integration the cause of the break in the night ... You need to modify sensor.py manually ...

nilrog commented 3 years ago

Exactly, this pull request that was also merged with the manifest update is the reason why it has stopped working in the night. https://github.com/safepay/sensor.fronius/pull/45

There should be a configurable setting to control if the plugin should poll the inverter during night or not since there will be errors in the HA logs if the plugin is polling the inverter when it has shutdown for the night.

bamzero commented 3 years ago

Is it a difference in firmware? I'm still on fro30381 on my inverter and 3.14.1-10 on my data manager card, are the changes in #45 are only needed for newer firmware (or is it only a problem for inverters that shut down after sunset)?

Anyway, I'll downgrade to 0.93 as well for now as not planning on upgrading Fronius firmware at the moment to find out.

nilrog commented 3 years ago

No, there is no difference in firmware. The Fronius inverter, at least pre-gen24, as it is shipped from factory, shuts down the data manager when it stops producing electricity at night. But many, especially if you have a smartmeter, enables it to run 24/7. There is a setting in the inverter for that.

The code that was changed by #45 was the remains of an old attempt at trying to be smart about handling sunset/sunrise to reduce the error logs. But afaik it did not work out well so it was set to always return True and then no more effort was made to fix it. Until #45 showed up and it was merged along side the critical manifest update.

matake31 commented 3 years ago

Same problem here and I backed down to 0.9.3 as well.

Tovrin commented 3 years ago

Ditto. I've dropped back to 0.9.3 again.

HarrisonPace commented 3 years ago

I removed lines 232-234 from sensor.py:

if not self.available:           
    self._state = STATE_UNAVAILABLE
    return

This fixed the issue, now smart meter readings are recorded throughout the night. I have created a PR for this fix.