Closed sfjes closed 4 years ago
Interesting. I have not see this before. I will add checks to prevent invalid data from crashing the plugin. I see that the battery is at 3%, I wonder if it sends out another signal when the battery is low that could be confusing the parser.
In that case both the temperature (149F) and battery (3%) readings are bunk -- hence my suspicion of corrupted packets being received. Not sure about humidity, 36.3% is plausible. The packets in the minute before showed 100% battery.
@sfjes I pushed a branch called add_h5075_parse_checks
. When you have the time, could you test it and see if it corrected the issue?
Thanks @Thrilleratplay. I've switched to that branch. Given that the error occurs somewhere between 0.25 - 1.0/times a day, it may take a few days to confirm if it resolves it. Will let you know.
The component hasn't died since applying this branch. I added some debug messages to help see if the parse checks were catching anything, and they did, once. I expected to see more catches based on the previous rate of crashes, but hey, maybe less solar flares this week.
I also saw bad data a few times (100C type stuff), which got averaged out into a small blip.
Where the 100C spikes being recorded in the data or just seeing the spikes in the error logs? The default max temp is 60c, it shouldn't record anything higher unless that was changed in the config.
I lost track of where I wrote down the exact log message (and HA has since truncated the log), so it may well have been <60C. I just remember thinking that it was an absurdly high reading given that I'd be pleased to hit 20C.
If you notice it again and it is logged in the sensor data, try lowering the upper temperature threshold. I am still curious how the signal is being altered enough to have bad data but still have a valid mac and device name. Possibly a faulty unit? shrugs I am going to merge this branch in if it at very least prevents crashing with bad data.
I've been having a few cases (average once per day) where data collection stops, with an error like the below in the logs (pardon the line numbers differing from the latest master, I'm still running the pre-multi-update-fix refactoring version).
I'm guessing these might be related to corrupted data in some of the BLE broadcasts, but I haven't had a chance to look more closely.
I don't have the trace handy, but I've also see the same ValueError, but on the line
battery = int(data[86:88], 16)
Also, once:
In all these cases, the component still goes through its per-period cycle, but no longer logs additional packet messages.