bemble / node-red-contrib-mi-devices

node-red extension to integrate Xiaomi gateway devices
16 stars 20 forks source link

Contact sensors reporting multiple times per action, and not in correct order #39

Open Brausmith opened 6 years ago

Brausmith commented 6 years ago

So far everything is running well across numerous different sensor types. But, my Contact sensors are reporting multiple times for each action, i.e. open or close. In addition to this, since they report multiple times it doesn't guarantee that I always receive the correct state.

e.g. I open a door. I might get 3 reports and 1 heartbeat, of which 3 are saying open, and 1 is saying close. Most of the time the last one is correct. But randomly the last one could be incorrect, and therefore causes downstream issues in a flow.

In this screenshot you can see 4 payloads for the one action. The status goes open, close, close, then open. The last one (open) is correct, so I don't know why it starts off with an open status. 2018-02-18 14_44_10-

Ideally, I want just 1 report with every action and the occasional heartbeat. But I can't find any rhyme or reason to this.

bemble commented 6 years ago

Thanks for the issue. I also noticed this behavior, but only on my main door. I also have the same behavior in MiHome. I guess it's due to a not that good sensor installation. Anyway, I'll handle that in V2 ;)