-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect battery level for ThermoPro TP357, TP358, TP359 and TP393 #577
Conversation
5c1ba17
to
7009f34
Compare
Hi @pointhi Thanks for this suggested addition to the ThermoPro decoder. I am however not a big fan of arbitrary battery level conversion 😉 with the suggested change showing 100% only for when the battery is completely full, but as soon as it reaches 99% and anything in between 1%-99% as 50%, and then showing a complete 0% even when the battery is low and likely still running the device fine for a few days or longer. How do you feel about implementing this as a proper binary sensor by pulling states 1 and 2 together as Normal, while state 0 then translates to Low, and have the discovery of the property accordingly. I would say this binary battery status is there for cases exactly like this. https://www.home-assistant.io/integrations/binary_sensor/ Similar to our implementation of trl_433 devices, where some only send 0/1 Low/Normal, while only the ones sending a full range 0-100 value will show as XX%. |
7009f34
to
762329d
Compare
I tried it out with HomeAssistant, and it should be fine. We loose one intermediate state for the battery but this is still better than no battery information at all, and the one I care about anyway is low battery. |
With your previous implementation of "max", 100 I also assumed that the 4-bit byte could also have the other values higher than 2, when for 4, 8 and c, indicating 100%/full previously would be wrong, as I think it is only bits 0 and 1 indicating the battery status But this is all pure conjecture from me, as I do not own any ThermoPro thermometers myself, so don't know if this could be higher than 2, possibly indicating some other additional value or setting. Many thanks again for your contribution! |
@pointhi you don't have the ThermoPro TP393 by any chance? As this is the only one with a rechargeable battery out of the lot. In this circumstance I could imagine that any of the two remaining bits of index 9 might indicate the charging state true/false, and then it would also make sense to differentiate between the 100% and below states, to indicate when the device has reached a full charge during a charging session. This could then be implemented separately only when charging, and is best left until someone with a TP393 can verify this. |
No, I do not own a TP393 |
Description:
The given nibble is responsible for the battery reading. I also verified it using a power supply.
There is also a ticket with the same findings: Bluetooth-Devices/thermopro-ble#11
Checklist: