homebridge-rtl icon indicating copy to clipboard operation
homebridge-rtl copied to clipboard

Deactivate battery warning in Home app

Open freinbichler opened this issue 4 years ago • 5 comments

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%?

freinbichler avatar May 05 '21 18:05 freinbichler

It should be handled automatically if the device doesn't return a value for battery

https://github.com/NorthernMan54/homebridge-rtl/blob/a433e4d6f4a2102bb18e57888eabd7d39f247394/sensor.js#L156

What does the message for your device look like ?

NorthernMan54 avatar May 07 '21 01:05 NorthernMan54

Thanks, I saw that part in the code, however my device reports a battery value of 0, not undefined.

freinbichler avatar May 07 '21 07:05 freinbichler

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.

NorthernMan54 avatar May 07 '21 10:05 NorthernMan54

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

freinbichler avatar May 12 '21 08:05 freinbichler

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.

NorthernMan54 avatar May 13 '21 23:05 NorthernMan54