rcasula / kostalpiko-homeassistant

19 stars 14 forks source link

Setting last_reset for entities with state_class other than 'total' is deprecated #7

Closed pergolafabio closed 2 years ago

pergolafabio commented 2 years ago

Hey @rcasula,

i also receive warning below, are you able to fix it?

thnx

WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.kostal_piko_daily_energy (<class 'custom_components.kostal.sensor.PikoSensor'>) with state_class measurement has set last_reset. Setting last_reset for entities with state_class other than 'total' is deprecated and will be removed from Home Assistant Core 2021.11. Please update your configuration if state_class is manually configured, otherwise report it to the custom component author.

rcasula commented 2 years ago

I think it is resolved now. Could you please check?

pergolafabio commented 2 years ago

yes indeed

hvorragend commented 2 years ago

Not with me. I think that the state_class is wrong here with 'measurement'. I don't have customize it.

And if I try to customize it, the error keeps appearing. Could it be that during the HA startup, the attributes are changed for a short time?

Logger: homeassistant.components.sensor
Source: components/sensor/__init__.py:334
Integration: Sensor (documentation, issues)
First occurred: 17:17:05 (1 occurrences)
Last logged: 17:17:05

Entity sensor.kostal_piko_daily_energy (<class 'custom_components.kostal.sensor.PikoSensor'>) with state_class measurement has set last_reset. Setting last_reset for entities with state_class other than 'total' is not supported. Please update your configuration if state_class is manually configured, otherwise report it to the custom integration author.
state_class: measurement
unit_of_measurement: kWh
device_class: energy
icon: mdi:solar-power
friendly_name: Kostal Piko Tagesenergie