britkat1980 / giv_tcp

TCP connection (from inverter) and MQTT implementation
77 stars 36 forks source link

Battery SOC kWh should be a `measurement` class, not `total_increasing` #199

Closed peter1rhodes closed 3 weeks ago

peter1rhodes commented 1 month ago

I'm 99.9% certain this is a bug, because the code is clearly written to catch this sensor and make it a measurement, but instead it gets labelled total_increasing, which is definitely incorrect (the docs are very clear). I'm quite sure this is a typo, and I think the original intention is clear in the code, but there is a 2 that should be a 1.

Here, in HA_Discovery.py, the line if "soc" in str(topic.split("/")[-2]).lower(): should be if "soc" in str(topic.split("/")[-1]).lower():.

This is related to issue #195 , and causes the following errors in the HA logs: Entity sensor.givtcp[serial]_soc_kwh from integration mqtt has state class total_increasing, but its state is not strictly increasing.

britkat1980 commented 1 month ago

Thanks, incorporated change in upcoming Beta's ready for v3

britkat1980 commented 3 weeks ago

available in current Beta builds