tv3 / homeassistant-apsystems_ecur

Home Assistant custom component for local querying of APSystems ECU-R Solar System
6 stars 0 forks source link

Wrong temperature readings when unavailable #8

Open dewi-ny-je opened 2 years ago

dewi-ny-je commented 2 years ago

When an inverter is not available the temperature reading is -100°C, which throws the graphs out of scale. It should rather be left "unavailable", so that home assistant won't display data points.

dewi-ny-je commented 2 years ago

I tried to change self.inverters[inverter_id].update({'temperature' : -100}) to self.inverters[inverter_id].update({'temperature' : unavailable})

and reload HA, but I still see -100 °C, I'm not sure why.

tv3 commented 2 years ago

Unavailable would be a variable in Python. So your change would probably give an error, which means nothing gets updated. The -100 was something I think I picked from the original repo. Could even be that -100 is reported by the ecu.

dewi-ny-je commented 2 years ago

Indeed the ECU reports temperatures as °C but starting from -100°C which becomes 0, and 155°C which becomes 255, and they are done with a int8. Still, it makes no sense, since an offline panel should not have any temperature reported. I'll open an issue upstream too.

How to avoid reporting the temperature when the panels are offline? maybe by skipping providing a number?