weltenwort / home-assistant-rct-power-integration

A Home Assistant custom component to integrate with RCT Power inverters.
MIT License
67 stars 15 forks source link

Error message from recorder (type mismatch) #202

Open wora55 opened 2 years ago

wora55 commented 2 years ago

Version of the custom_component

Downloaded current version yesterday

Configuration

Actually no configuration by me :-)

Describe the bug

HA-Recorder does not like the way the value changes and says this in his logs: 2022-03-21 15:50:10 WARNING (Recorder) [homeassistant.components.sensor.recorder] Entity sensor.rct_power_storage_consumer_energy_consumption_day from integration rct_power has state class total_increasing, but its state is negative. Triggered by state -406.4 with last_updated set to 2022-03-21T14:44:59.999999+00:00. Please report it to the custom component author. 2022-03-21 15:50:10 WARNING (Recorder) [homeassistant.components.sensor.recorder] Entity sensor.rct_power_storage_consumer_energy_consumption_month from integration rct_power has state class total_increasing, but its state is not strictly increasing. Triggered by state 184676.6 (184.69129999999998) with last_updated set to 2022-03-21T14:49:34.262993+00:00. Please report it to the custom component author. 2022-03-21 15:50:10 WARNING (Recorder) [homeassistant.components.sensor.recorder] Entity sensor.rct_power_storage_consumer_energy_consumption_year from integration rct_power has state class total_increasing, but its state is not strictly increasing. Triggered by state 1051815.9 (1051.8303999999998) with last_updated set to 2022-03-21T14:49:34.264436+00:00. Please report it to the custom component author. 2022-03-21 15:50:10 WARNING (Recorder) [homeassistant.components.sensor.recorder] Entity sensor.rct_power_storage_consumer_energy_consumption_total from integration rct_power has state class total_increasing, but its state is not strictly increasing. Triggered by state 2248762.5 (2248.777) with last_updated set to 2022-03-21T14:49:34.265875+00:00. Please report it to the custom component author.

Debug log

See above

What to do:

Änderung in lib/entities.py: Statt TOTAL_INCREASING nur TOTAL bei diesen vier Werten Nach dieser Änderung und anschließendem Neustart tritt die Fehlermeldung nicht mehr auf (damit ist das Problem für mich persönlich auch gelöst)

Begründung: Siehe Fehlermeldung oben, Funktion ist nicht monoton steigend. Fehlt ein Filter? Oder Bedeutung von Daten falsch interpretiert (Keine offizielle Doku vorhanden, wenn ich mich recht erinnere) Passiert dann, wenn die Energie aus der Gesamteinstrahlung höher ist als der Verbrauch im Hause. Scheinbar kann dann die Consumption negativ werden und damit ist die Summe nicht mehr monoton steigend.

weltenwort commented 2 years ago

You're right - it's just a warning, but I should try to avoid it. This value is monotonic, but decreasing because it has a negative sign. Unfortunately there's no TOTAL_DECREASING state class. Thanks for reporting!