linp.flood.rs1bb reports Unknown
ov1d1u opened this issue · comments
Entities for Water Leak and Battery for the RS1BB flood sensor reports Unknown values, even after trying to force an update by wetting the sensor. I can get value updates through the Mi Home app and also through the Passive BLE Monitor integration.
Here is a section of the logs for when the event occured, A4:C1:38:B9:4C:67
is the sensor's Bluetooth address:
2024-04-24 09:06:06.345 INFO (MainThread) [pyhap.hap_protocol] ('192.168.0.250', 51689): Connection made to HASS Bridge
2024-04-24 09:06:31.531 DEBUG (MainThread) [custom_components.xiaomi_gateway3.mqtt.192.168.0.140] {'topic': 'miio/report', 'data': b'{"id":1876954347,"method":"_async.ble_event","params":{"dev":{"did":"blt.4.1g7fqrglogc00","mac":"64:9E:31:72:EB:C0","pdid":2038},"evt":[{"eid":4119,"edata":"78000000"}],"frmCnt":218,"gwts":1713938787}}'}
2024-04-24 09:06:31.531 DEBUG (MainThread) [custom_components.xiaomi_gateway3.gate.192.168.0.140] {'uid': '649e3172ebc0', 'did': 'blt.4.1g7fqrglogc00', 'msg': 'on_report', 'data': {'idle_time': 120}}
2024-04-24 09:06:31.762 DEBUG (MainThread) [custom_components.xiaomi_gateway3.mqtt.192.168.0.140] {'topic': 'miio/report_ack', 'data': b'{"id":1876954347,"result":"ok"}'}
2024-04-24 09:06:35.064 DEBUG (MainThread) [custom_components.xiaomi_gateway3.mqtt.192.168.0.140] {'topic': 'openmiio/report', 'data': b'{"gateway":{"firmware":"1.5.0_0026","model":"lumi.gateway.mgl03"},"miio":{"cloud_starts":3,"cloud_state":"cloud_connected","cloud_uptime":"13h10m29s"},"openmiio":{"uptime":"21h10m31s","version":"1.2.1"},"serial":{"bluetooth_rx":3933359,"bluetooth_tx":365,"bluetooth_oe":3376,"zigbee_rx":82122,"zigbee_tx":57190,"zigbee_oe":32},"zigbee":{"z3_starts":1,"z3_uptime":"21h10m30s"}}'}
2024-04-24 09:06:37.212 INFO (MainThread) [xiaomi_ble.parser] BLE ADV from UNKNOWN Xiaomi device: MAC: b'\xa4\xc18\xb9Lg', ADV: 58590f3f7b674cb938c1a41220a6e21100009fd6ab86
2024-04-24 09:06:38.503 DEBUG (MainThread) [custom_components.xiaomi_gateway3.mqtt.192.168.0.140] {'topic': 'miio/report', 'data': b'{"id":1867851349,"method":"_async.ble_event","params":{"dev":{"did":"blt.4.1gfgq567ogk00","mac":"A4:C1:38:B9:4C:67","pdid":16143},"evt":[{"eid":18438,"edata":"01"}],"frmCnt":123,"gwts":1713938795}}'}
2024-04-24 09:06:39.795 DEBUG (MainThread) [custom_components.xiaomi_gateway3.mqtt.192.168.0.140] {'topic': 'miio/report', 'data': b'{"id":615724350,"method":"_sync.ble_keep_alive","params":[{"did":"blt.4.1gfgq567ogk00","rssi":-72}]}'}
2024-04-24 09:06:40.019 DEBUG (MainThread) [custom_components.xiaomi_gateway3.mqtt.192.168.0.140] {'topic': 'miio/report_ack', 'data': b'{"id":1867851349,"result":"ok"}'}
2024-04-24 09:06:40.078 DEBUG (MainThread) [custom_components.xiaomi_gateway3.mqtt.192.168.0.140] {'topic': 'miio/report_ack', 'data': b'{"id":615724350,"result":{"operation":"keep_alive","intvl":1200,"delta":300,"filter":[]}}'}
2024-04-24 09:06:44.149 DEBUG (MainThread) [custom_components.xiaomi_gateway3.mqtt.192.168.0.140] {'topic': 'gw/2C1165FFFE58DB02/heartbeat', 'data': b'{"networkUp":true,"networkPanId":"0x6FBA","radioTxPower":7,"radioChannel":25}'}
2024-04-24 09:06:47.629 DEBUG (MainThread) [custom_components.xiaomi_gateway3.mqtt.192.168.0.140] {'topic': 'miio/report', 'data': b'{"id":1419387352,"method":"_async.ble_event","params":{"dev":{"did":"blt.4.1gfgq567ogk00","mac":"A4:C1:38:B9:4C:67","pdid":16143},"evt":[{"eid":18438,"edata":"00"}],"frmCnt":124,"gwts":1713938805}}'}
2024-04-24 09:06:47.904 DEBUG (MainThread) [custom_components.xiaomi_gateway3.mqtt.192.168.0.140] {'topic': 'miio/report_ack', 'data': b'{"id":1419387352,"result":"ok"}'}
2024-04-24 09:07:05.148 DEBUG (MainThread) [custom_components.xiaomi_gateway3.mqtt.192.168.0.140] {'topic': 'openmiio/report', 'data': b'{"gateway":{"firmware":"1.5.0_0026","model":"lumi.gateway.mgl03"},"miio":{"cloud_starts":3,"cloud_state":"cloud_connected","cloud_uptime":"13h10m59s"},"openmiio":{"uptime":"21h11m1s","version":"1.2.1"},"serial":{"bluetooth_rx":3937029,"bluetooth_tx":365,"bluetooth_oe":3376,"zigbee_rx":82163,"zigbee_tx":57217,"zigbee_oe":32},"zigbee":{"z3_starts":1,"z3_uptime":"21h11m0s"}}'}
2024-04-24 09:07:06.438 DEBUG (MainThread) [custom_components.xiaomi_gateway3.mqtt.192.168.0.140] {'topic': 'miio/report', 'data': b'{"id":900165355,"method":"_async.ble_event","params":{"dev":{"did":"blt.4.1g7fqrglogc00","mac":"64:9E:31:72:EB:C0","pdid":2038},"evt":[{"eid":4106,"edata":"2b"}],"frmCnt":220,"gwts":1713938824}}'}
2024-04-24 09:07:06.438 DEBUG (MainThread) [custom_components.xiaomi_gateway3.gate.192.168.0.140] {'uid': '649e3172ebc0', 'did': 'blt.4.1g7fqrglogc00', 'msg': 'on_report', 'data': {'battery': 43}}
2024-04-24 09:07:06.695 DEBUG (MainThread) [custom_components.xiaomi_gateway3.mqtt.192.168.0.140] {'topic': 'miio/report_ack', 'data': b'{"id":900165355,"result":"ok"}'}
Here are the full logs:
home-assistant_xiaomi_gateway3_2024-04-24T06-07-17.403Z.log
Device diagnostics:
I forked the repository and modified the converter to be like (for some reason I didn't managed to override it in xiaomi_gateway3.py
):
{
16143: ["Linptech", "Submersion Sensor", "RS1BB", "linp.flood.rs1bb"],
"spec": [
BLEByteConv("battery", "sensor", mi=19459),
BoolConv("water_leak", "binary_sensor", mi=18438),
],
}
Now I can see the battery level being correctly reported, but the water_leak
sensor is always on
, I guess because of some conversion error. Any help here?