Hi all.
I bought this motion sensor: IHSENO Tuya ZigBee PIR Motion Sensor
I’m trying a simple “switch on light when sensing motion, and switch off light if not sensing motion for 10 seconds”
That is just an example to test if it even works. Questions:
What I assume is that the polling rate of the sensor is very low (probably to conserve battery) - is there a way to change that in HA?
The automation I created using UI only works for switching on the Yeelight, but not switching off if there’s a trigger for no motion for X amount of seconds. Can someone please assist with that?
It’s not normally recommended to use device triggers, conditions or actions (for reasons beyond the scope of this topic) but I think you can do what you want by adding a second trigger for no motion for 10 seconds.
Remove the “for” in the else action as it won’t be needed because the timing is done in the trigger.
The downside to device “things” is that if (and when) a device dies and needs replaced then there is no way to replace the device and end up with the same device_id.
So that means that you need to manually edit all of the places where you use that device_id in your system to update everything to the new device_id.
if you use services (which use entity_ids instead of device_ids) then if the device needs replaced you simply edit the device to make the entity_ids the same as the old device and everything else all just works.
Also there are some other perks with using services instead of devices like the ability to use templates in many areas. Device_ids don’t allow templates in any of the various selections.