merdok / homebridge-miot

Homebridge plugin for devices supporting the Xiaomi miot protocol
MIT License
392 stars 61 forks source link

BLE Contact sensor constantly sends false activity statuses #459

Closed romacv closed 1 year ago

romacv commented 1 year ago

Describe the bug Approximately once every few minutes, the sensor (working via BLE and the Gateway) sends these statuses: it is open, then it is closed, again open-closed, and doesn't display real situation. Maybe this is due to the fact that its characteristic conflicts with the temperature and humidity sensor, since it is also indicated 2.1, 2.2 etc

Screenshot 2023-03-23 at 22 22 31

Your config.json

{
                    "name": "Gate Sensor",
                    "ip": "192.168.1.14",
                    "token": "7343504b4874635479557a3750777257",
                    "deviceId": "lumi.158d0008a6e4f3",
                    "model": "isa.magnet.dw2hl",
                    "pollingInterval": 10,
                    "deepDebugLog": false,
                    "onlyMainService": false,
                    "buzzerControl": false,
                    "ledControl": false,
                    "childLockControl": false,
                    "modeControl": false
                },

Debug log Provide a snippet of a debug log when the issue occurs. Ideally with the deepDebugLog property enabled.

Screenshots IMG_7443

merdok commented 1 year ago

This is most probably what the gateway reports, why it is reporting the status like that I cannot tell. But you could verify it by either using the miot cli tools or observing the debug log and checking if the value indeed updates from the gateway to open.

dimkagithub commented 1 year ago

Approximately once every few minutes, the sensor (working via BLE and the Gateway) sends these statuses: it is open, then it is closed, again open-closed, and doesn't display real situation.

Hi! I have four sensors with Xiaomi gateway. And sensors works fine. No problems at all. As I understood the sensors can work without miCloud force connections but mine can not. May be it helps.

My configuration:

{
    "name": "Sensor",
    "ip": "192.168.1.25",
    "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "deviceId": "xxx.x.xxxxxxxxxxxxxxx",
    "model": "isa.magnet.dw2hl",
    "pollingInterval": 3,
    "deepDebugLog": false,
    "micloud": {
        "username": "xxxxxxxxxxxxxx@xxxxxxxx.xxx",
        "password": "xxxxxxxxxxxxxx",
        "country": "xx",
        "forceMiCloud": true
    },
    "buzzerControl": true,
    "ledControl": true,
    "childLockControl": true,
    "modeControl": true
}
romacv commented 1 year ago

It was fixed by changing to other BLE Hub. Thanks,