Heatmiser-for-home-assistant
Heatmiser-for-home-assistant copied to clipboard
Bug: Filter out values over 100 degrees
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:
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.
Testing now using the development branch, will report if the issue is still there or it´s been fixed in this branch
@MindrustUK Unfortunately the issue is also happening in the development branch:
Also happens to me. Happy to help debug if needed.
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?
Thanks @MindrustUK I will test it straight away, what do I need to do to test the new version you have created?
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 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?
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 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.
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.
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 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 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?
Issue has been fixed in the dev branch