Heatmiser-for-home-assistant icon indicating copy to clipboard operation
Heatmiser-for-home-assistant copied to clipboard

Bug: Filter out values over 100 degrees

Open heisenberg2980 opened this issue 1 year ago • 4 comments

I know this is not an issue with the integration as the Heatmiser app also show these values, but every time the hub loses its connection it produce a peak of over 100 degrees (127 sometimes, 255 others) that is pretty anoying in the graph as it completely changes the scale, and I think it could be filtered out in this integration as we know temperatures over 100 degrees are imposible:

image

heisenberg2980 avatar Jan 05 '24 21:01 heisenberg2980

Are you observing this in the development branch at all? I suspect as the "offline" state is now handled correctly this may no longer be an issue. Can you test and report back, if it's still an issue I'll look into adding in some mitigation for this.

MindrustUK avatar Jan 08 '24 10:01 MindrustUK

Testing now using the development branch, will report if the issue is still there or it´s been fixed in this branch

heisenberg2980 avatar Jan 08 '24 18:01 heisenberg2980

@MindrustUK Unfortunately the issue is also happening in the development branch:

image

heisenberg2980 avatar Jan 11 '24 21:01 heisenberg2980

Also happens to me. Happy to help debug if needed.

w00tadude avatar Jul 13 '24 16:07 w00tadude

Have added some handling that will record the error and will not return a value should it encounter 127 or 255. @heisenberg2980 @w00tadude Could you please test and feedback?

MindrustUK avatar Aug 28 '24 11:08 MindrustUK

Thanks @MindrustUK I will test it straight away, what do I need to do to test the new version you have created?

heisenberg2980 avatar Aug 28 '24 12:08 heisenberg2980

Hi @heisenberg2980 you can check https://github.com/MindrustUK/Heatmiser-for-home-assistant/blob/dev/README.md for installation instructions, specifically:

mkdir -p /config/custom_components cd /tmp/ git clone -b dev https://github.com/MindrustUK/Heatmiser-for-home-assistant /tmp/heatmiserneo mv /tmp/heatmiserneo/custom_components/heatmiserneo /config/custom_components/ rm -rf /tmp/heatmiserneo/

MindrustUK avatar Aug 28 '24 12:08 MindrustUK

@MindrustUK I just tested the dev version and I´m afraid the issue is still there. I realised the temperature reads 255.3 instead of 255, could that be the reason the "if temperature = 255" doesn´t pick it up? If that is the case, could you update it to "if temperature is over 100" as any temperature over 100 degrees must be incorrect?

image

heisenberg2980 avatar Aug 29 '24 10:08 heisenberg2980

Thanks @heisenberg2980 that's mildly annoying, I wanted to use those specific values to trigger error events, Oh well... I'll modify the code to treat anything above 45 deg C as an error. I believe this is the upper range for all Heatmiser products but will verify, I'll apply the same sort of idea to the lower limit and add some magic to deal with Fahrenheit. Will ping once this is added in.

MindrustUK avatar Aug 29 '24 14:08 MindrustUK

@MindrustUK 45 degrees sounds a bit low to me, as the temperature can reach higher temperatures than that, but yeah, once you confirm the values the thermostat can report you can adjust the module accordingly.

Btw, thank you very much for your effort in fixing this issue.

heisenberg2980 avatar Aug 29 '24 15:08 heisenberg2980

In my case the spikes are all 127.3C

I think that capping it at a high value (don't mind if it's 50, 80 or 100) would work fine for me.

image

w00tadude avatar Aug 29 '24 22:08 w00tadude

Hi @heisenberg2980 @w00tadude I've updated the code with some more robust logic, it will now;

  • check for < 0 Deg C or > 70 Deg C
  • check for < 32 Deg F or > 158 Deg F

On these conditions it will not return a temperature and will raise an error in the logger.

Please can you test the latest version of the dev branch and let me know if it's working as expected?

MindrustUK avatar Aug 30 '24 10:08 MindrustUK

@MindrustUK I confirm the issue is fixed in the updated version and the 255 values don´t appear in HA anymore, thank you very much!

Just a note (and I´m sorry if I am being a pain), I think we shouldn´t filter negative values, as even though it is unlikely a room reaches those values, I am pretty sure the thermostat is capable of reporting them if it happens. I´m not sure if filtering negative values is needed at all, because I have only seen issues with values over 100 degrees, but if you want to filter them maybe a value of -50 Celsius would be better?

heisenberg2980 avatar Aug 30 '24 14:08 heisenberg2980

@heisenberg2980 It's a sensible observation. I've updated the values, we'll now handle -50 Deg C / -58 Deg F as the lower limit. I'll call this one done unless you've got any other observations?

MindrustUK avatar Aug 30 '24 14:08 MindrustUK

Issue has been fixed in the dev branch

heisenberg2980 avatar Aug 30 '24 14:08 heisenberg2980