Very infrequently my motion sensors don’t report that they are clear after movement. This affects automations based on movement detection. I want to reset the detection back to clear after 10 or 20 mins so that either a new detection happens, or the other automations run after a delay.
Things like motion lights trigger on detection but I do need some other automations to detect on clear
How can I use an automation(?) to change the state back to clear , my trigger is below
description: ""
mode: single
trigger:
- platform: state
entity_id:
- binary_sensor.garage_z_motion_motion
to: "on"
for:
hours: 0
minutes: 1
seconds: 0
condition: []
action: []
The delay for a real or forced “clear” to running any automation is much longer than the detection window, so if it isn’t actually clear everything will cope and run as intended
Reasons: crowded WIFI (100 IOT items but changing everything to ZIGBEE) , Distant zigbee hubs (need more), TUYA / Ewelink cloud API, H.A not noticing, and/or a restarted (integration on ) H.A etc
is it possible to set up a virtual motion device that follows the binary sensor’s states but which can be set “manually” and can be used in automations in place of the real sensor
You can create a Template Binary Sensor (for each one of your 10 motion detectors) and set its auto_off option to whatever value you feel is appropriate for your needs.
However, this isn’t useful if your motion detectors get permanently stuck on.
I think I answered it myself. I’ll set up a virtual switch. toggle it on / off when motion / clear is detected. If it has been on too long it will turn itself off. Then my automations can use the switch state instead of the motion detection state
The Template Binary Sensor will turn on when the motion detector turns on.
If the value of auto_off is 30, the Template Binary Sensor will automatically turn off after 30 seconds (even though the motion detector is stillon).
The Template Binary Sensor will turn on whenever the motion detector turns on again. In other words, when the motion detector’s state changes from off to on. If it turns on and stays that way indefinitely, then a Template Binary Sensor can’t mitigate that.