jkeljo / hacs-greeneye-monitor

HACS version of the Home Assistant Core greeneye_monitor component. For beta-testing and faster deployment of changes.
MIT License
6 stars 2 forks source link

Ignore invalid readings from the temperature sensors #35

Closed Vlad-Star closed 11 months ago

Vlad-Star commented 1 year ago

Version: 2023.9.4

First, I would like to thank you for creating this plugin that allows to integrate GEM with Home Assistant. I've been using it for several years to monitor power consumption and temperatures through the house, and found it to be very helpful.

Now let me report the problem. I have few temperature probes connected to GEM, and periodically getting a temperature of 256F which completely sets off the graphs (I guess, once in a while, when it fails to read the sensor). Those values should be treated as "n/a" or "unknown". Same story applies to the temperature channel that doesn't have any probe on it ("Unused" on the second screenshot).

Please add a logic to ignore invalid temperature readings. Thanks!

I am attaching two graphs as an example: image image

Please let me know if you need any further information.

Vlad-Star commented 1 year ago

I guess, having min/max temperature thresholds + calibration offset in the configuration for each temperature sensor would be helpful

jkeljo commented 1 year ago

Thanks for reporting this issue!

I'd recommend just disabling the unused sensor; no need to have it cluttering up your UI.

I did a little research into the temperature sensor and how other tools parse the data packets, and it looks like 256 is a well-known value for "no sensor". I can definitely make a change to detect that and have the sensor go unavailable rather than report bad data. The right place to make this fix is probably in one of the libraries used by this integration under the hood, so this may take a little longer than it would if it were just a fix to the integration itself.

Vlad-Star commented 1 year ago

Thanks for looking into! See if the suggested min/max temperature thresholds (discarding data outside of the range) would be easier/faster to implement.

Speaking of the "Unused" sensor - this is is the only one that is not connected (out of 8 temperature + 32 CT connected ports) that I used as an example. I figured that having one more or one less won't make much difference in the amount of data coming back from GEM to HA. :) I may eventually install another probe and use it too.

Here is my latest "GEM Temperatures" graph, so you can clearly see what I am getting. Somehow the old version of plugin (which required manual definitions in YAML) was free of this problem, I guess due to different/older libraries. image

jkeljo commented 11 months ago

Sorry for the delay. This is fixed in 2023.10.28, which I've just released. Let me know if you still have any issues!