Motion sensor "keep time" affected by the fact if in automation or not


I have a weird one. Fresh install of HA mainly to play around. So, just added my second device - Luminance motion sensor (ZG-204ZL) by TuYa. All was good I can see the device properties (or whatever they are called in the HA world). For the motion part there is a setting called “keep time” that can be 10, 30, 60, 120. I played around with thouse and if I pick 10 the device allows me to register a new motion after 10 seconds. And I can see in the log that the changes “motion” and “no motion” happen according to what number I pick above 10, 30, 60 etc… Now this is all good. But what happens when you include this sensor in a simple automation logic? The “keep time” is now 60 no matter what I change in the configuration. Even if I disable the automation rules I still get this behaviour. Only after I delete the automation rules the motion sensor “keep time” starts acting according to the number I pick.
This is a bit unexpected to me and it introduces functionality that is not ideal. Wonder if anybody has seen this behaviour too.


This seems really odd. Referencing an entity in an automation is strictly read-only. There’s no way that an automation could set the keep time (outside of using a service call to change it).

Where are you seeing that it’s not using the keep time properly? In the automation itself or are you watching the state (Developer Tools > States)?

Thanks for your time and reply.
I was watching the state changes in the log.

What I am saying is that I can’t make the light turn off after 10 seconds let’s say of no motion. I mean I can but not relying on the motion sensor providing states.

Did you add a for: to your automation trigger? Can you post the YAML of your automation?

Well, had to create the rules again, did it same exact way as the first time but now I am getting the expected behaviour meaning I can’t reproduce the problem.

1 Like

lol take the win I guess? :blush: