Open freinbichler opened 3 years ago
It should be handled automatically if the device doesn't return a value for battery
What does the message for your device look like ?
Thanks, I saw that part in the code, however my device reports a battery value of 0
, not undefined
.
So the code is working as designed, just your device has a borked design and returns a battery value of zero even though the battery is okay ( is their a chance with your device 0 is okay and a different value is low battery ? )
If you want to add a config option to ignore battery values, I can merge a pull request.
Yes, for this one device which reported battery 0 the code works as designed and the device is the problem.
However, I have now added another device which reports battery levels between 0 and 100 (percentage). It reports a battery level of 95 and in the home app it is shown as "low battery", because the code doesn't check for battery levels reported like this. I have checked the rtl_433_tests repository which contains a lot of signal recordings and found that some other devices also report battery levels like this.
So there seem to be 3 ways of battery reporting:
battery_ok: 0
or 1
battery: "LOW"
or "OK"
battery: 0-100
(not handled in the code right now)Here is my sensor:
time : 2021-05-11 13:28:54
model : Inkbird ITH-20R id : 41592
Battery : 95 sensor_num: 8 Integrity : CRC
Temperature: 25.9 C Temperature2: -1623.8 C Humidity : 0.1 %
The example from the repo: https://github.com/merbanan/rtl_433_tests/blob/f13628c524dd228299bc52c1b94082bea515302d/tests/IKEA_Sparsnas/01/g004_867.95M_250k.json
If you want to submit a pull request with this advanced logic for battery I would gladly review and merge it. As I don't have a device with this behaviour it may take a while to get to it.
I have successfully added a thermometer, however the device reports a battery level of 0 and therefore a warning is constantly displayed in the Home app. Is there a way to disable the battery level or hardcode it to 100%?