From what I’ve researched the sensor has a timeout period after motion is detected. When movement happens in front of the sensor, the sensor sends a “DETECTED” signal to Home Assistant. The sensor will stay in DETECTED mode for a certain amount of time before it sends the “CLEAR” signal to Home Assistant. The time it takes the sensor to go from detected to clear after the last movement was detected I call the timeout.
What happens when the timeout is too long, is we get a block of detected data. However, we do not know how much movement was done in that block. We only will know the first and last movement.
The first movement will happen at the start of the block, and the last movement will happen at the end of the block minus the timeout.
Detected Movement Example 1:
For this example the motion sensor has a 1 minute timeout.
Motion is DETECTED on the motion sensor at 12:00:00 PM
Motion is CLEAR on the motion sensor at 12:01:00 PM
The final output in our log file looks something like this:
01/01/2020, 12:00:00 PM,MS001,on
01/01/2020, 12:01:00 PM,MS001,off
From this we can say that our block of motion was 1 minute.
Detected Movement Example 2:
For this example the motion sensor has a 1 minute timeout.
Motion is DETECTED on the motion sensor at 12:00:00 PM
I wave my hand in front of the motion sensor at 12:00:30 PM
Motion is CLEAR on the motion sensor at 12:01:30 PM
The final output in our log file looks something like this:
01/01/2020, 12:00:00 PM,MS001,on
01/01/2020, 12:01:30 PM,MS001,off
From this we can say that our block of motion was 1.5 minutes.
What I’m trying to do is see how the sensor is dealing with that second detected. There is a hack for this sensor that people have done to reduce the timeout down to 5 seconds that I’m having trouble doing, so if I can figure out how to see the data coming from the sensor I can confirm if it is working or not.
This is the hack I am trying to do as an end result. Aqara Motion Sensor Hack for 5 sec - #32 by adrez99
Edit: This link seems so have a logging file for the sensor, but I’m not sure how to get to it. Aqara Motion Sensor Hack for 5 sec · Issue #20036 · home-assistant/core · GitHub