Closed colwilliamsnz closed 3 years ago
Test branch with HA 2021.9 support here: https://github.com/colwilliamsnz/sensor.fronius
@nilrog appreciate your thoughts on this one (and also the breaking changes noted in the readme). Concerned that HA 2021.9 broke the component (despite suggestions there would be some months of compatibility) and so how best to convey this as visibly as possible.
This is a bug in HA that they are not following their own documentation. It will be impossible for third-party integrations to solve this since not everyone will update to 2021.9.0 immediately. And if we were to release a new version through HACS for 2021.9.0 then people, that may still be on 2021.8.x, will update and we will be broken for them.
To fix this mess we can do something like this, or just update it and let users on 2021.8 skip the update or fix the mess themselves :P
For some reason I could not get the UI config for customizing entities to work, at least not in 2021.9.0. The only available option for state_class was measurement...but doing it the old fashioned yaml-way worked.
Here is what needs to be added to make an updated version compatible with 2021.8.x
configuration.yaml
homeassistant:
customize: !include customize.yaml
customize.yaml
sensor.fronius_total_energy:
state_class: measurement
last_reset: "homeassistant.util.dt.utc_from_timestamp(0)"
sensor.fronius_smartmeter_energy_ac_consumed:
state_class: measurement
last_reset: "homeassistant.util.dt.utc_from_timestamp(0)"
sensor.fronius_smartmeter_energy_ac_sold:
state_class: measurement
last_reset: "homeassistant.util.dt.utc_from_timestamp(0)"
Where "fronius" in the sensor name needs to match the name of the integration. And a note that this needs to be deleted when the user upgrades to 2021.9.x
Close. Pull request merged https://github.com/safepay/sensor.fronius/commit/82000435a5cb0d47eb77f9ca189102cbca1319d2
The developer docs for 2021.9 suggested that a planned change to energy sensors would be graceful allowing until 2021.11 for developers to make appropriate changes. This is not the case so suggest holding off on 2021.9 until a new release can be tested.