Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.78k stars 1.64k forks source link

Delay on Aqara motion sensor #1453

Closed pimseb closed 5 years ago

pimseb commented 5 years ago

I've been using the official Xiaomi gateway until today. I'm now testing zigbee2mqtt. I have 3 Aqara motion sensor that will be linked later to an alarm. My zigbee2mqtt is linked to domoticz. When I walk in front of a motion sensor, it does detect a motion and I see in the log that a motion has been detected (in domoticz aswell). The problem is that it only detects the motion once. If I come again in front of the sensor, zigbee2mqtt won't send an "on" signal again. It seems to be blocked during 1:30 min This behaviour doesn't come from the Aqara motion sensor unit itself because I don't have this problem with the official Xiaomi getaway. If I pass 3 times in 30 seconds in front of the motion sensor, the xiaomi getaway will send 3 "on" to domoticz.

Sorry for bad english :) Thanks

Debug Info

zigbee2mqtt version: zigbee2mqtt@1.3.1 start /opt/zigbee2mqtt CC253X firmware version: CC2531_DEFAULT_20190223

timants commented 5 years ago

i always had this problem with my aqara motion sensors , seems like it goes in sleep after it detects motion to save battery, (i even had this with the original xiaomi hub) , i hope someone has a solution to this , becouse they are useless with this behavoir . i sub to this topic to follow it .

aktentasche commented 5 years ago

Maybe OT, but I think technology-wise PIR sensors can only detect a movement every 15s or so because they need to settle again. 90 seconds is too long though that is clear.

md-reddevil commented 5 years ago

Same issue here.

FixxCZ commented 5 years ago

Same issue, Even when an device specific config occupancy_timeout is set for few seconds it still have that 90 seconds cool down. Very annoying.

andreasbrett commented 5 years ago

Unfortunately this is normal with battery-driven PIR sensors. Consider yourself walking around in a room with a PIR sensor. It would be very power consuming for the device to send each and every move of yours via zigbee radio to the network. The cooldown is the only way to have this sensor's battery last some time.

It's a typical trade off. There's power consumption and precision. Can't have low power consumption AND precision. It's either or. There are zigbee PIR sensors that are wall-plugged out there which would give you the precision you're all asking for.

pajikos commented 5 years ago

Has anyone tried to set occupancy_timeout? RTCGQ01LM, RTCGQ11LM seems to be aqara devices, so if the documentation is correct, you should be able to set this timeout individually: https://www.zigbee2mqtt.io/configuration/device_specific_configuration.html

aXecuter commented 5 years ago

Has anyone tried to set occupancy_timeout?

Just tried it on a RTCGQ11LM with a timeout of 20 seconds. Seems to work fine!

The false message is indeed sent after 20 seconds, but I am not able to retrigger the device until after 60 secs (probably the default timeout of the sensor itself)

Koenkk commented 5 years ago

@aXionDevelopment a timeout of 20 seconds makes no sense, as the device only reports the occupancy every 60 seconds. Meaning that for 40 seconds you won't get occupancy.

aXecuter commented 5 years ago

@Koenkk , yep, you're completely right. I was playing with the device and just noticed that.

aXecuter commented 5 years ago

I guess that's why the default timeout value (false message) is set to 90 seconds, so the sensor is able to re-trigger (after 60 sec) if the room is still occupied, and if it detects nothing for 30 more seconds, an "occupancy: false" message will be sent. I believe that's a good enough trade-off.

pimseb commented 5 years ago

When I use the official Xiaomi getaway I have this kind of log : https://i.ibb.co/gmdV1pg/Screenshot-20190429-203616-01.jpg As you see the getaway receives the motion information many times in one minute. In domoticz I can setup an auto off 5 seconds delay so at 20:36 I see 5 ON and 5 0FF in domoticz logs.

When I use zigbee2mqtt my logs look like this because the 5 seconds off delay doesn't work in domoticz for a reason I don't get 2019-04-28 17:27:44 | Off 2019-04-28 17:19:02 | On 2019-04-28 17:15:58 | Off 2019-04-28 17:14:21 | On 2019-04-28 17:02:41 | Off 2019-04-28 17:00:48 | On It can take a very long time for the motion device to go back to "off". In this example I left the room around 17:22 but the off signal was sent only at 17:27

Koenkk commented 5 years ago

@pimseb this is only right after pairing, see https://community.smartthings.com/t/making-xiaomi-motion-sensor-a-super-motion-sensor/139806

CypherMK commented 5 years ago

Wanted to ask the same question as OP. But came to the same conclusions:

So there is no other option, to change this 60 second limitation, except hardware modding? Are there better battery powered motion sensors out there working with zigbee2mqtt?

md-reddevil commented 5 years ago

As @pimseb mentioned, if the Motion Sensor is connected to XIAOMI Gateway motion information is updated multiple times per minute. If this is the case then the problem is not in the hardware but is in the integration with zigbee2mqtt.

Koenkk commented 5 years ago

@md-reddevil this is also the case with zigbee2mqtt, but only right after pairing (same for the xiaomi gateway) see https://github.com/Koenkk/zigbee2mqtt/issues/1453#issuecomment-487705315

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

RestOp commented 4 years ago

@pimseb this is only right after pairing, see https://community.smartthings.com/t/making-xiaomi-motion-sensor-a-super-motion-sensor/139806

Hello,

first of all, thanks a lot for zigbee2mqtt))) Really Great project! I would like to ask what have г meant with this post? That г need to modify it to get 5 sec delay?

PS U meant this i think https://github.com/Koenkk/zigbee2mqtt/issues/270#issuecomment-414999973