Hi,
i am moving from domoticz to home assistant and have difficulty getting a certain automation right.
Basically i am converting this dzVentz code to an automation:
if (item.name=='PIR Garage') then|
if (item.active) then
SwitchOn('Garage')
else
domoticz.devices(Garage).cancelQueuedCommands()
domoticz.devices(Garage).switchOff().afterMin(GarageTimeout)
end
end
So i created an automation in the UI, which looks like this in the YAML editor
alias: Garage gestopt met detecteren beweging
description: Zet de lamp weer uit als er geen beweging meer is
triggers:
- type: no_motion
device_id: 325a1d8a9ff64e49f6c5771072a25c5b
entity_id: 84d165e793530f962c73867164ab21b8
domain: binary_sensor
trigger: device
conditions: []
actions:
- delay:
hours: 0
minutes: 10
seconds: 0
milliseconds: 0
- type: turn_off
device_id: 4783fd1c2866e1e8a286f49c234515a2
entity_id: 54fec7f7e96e17e864cc6403c8c0d1f7
domain: switch
mode: single
Issue is that if within the 10 mins, the pir starts and stops detecting motion again, the events are crossing each other, sometimes causing the light to switchoff when someone is still in my garage.
In domoticz i prevented this by using the cancelqueuedcommands call. How can i do this in Home Assistant?