I’m trying to create an automaton that only activates if 2 things happen within 5 seconds of one another. I cobbled this together, but not even sure if a wait template is the best way to go about it. What I have done is definitely not working. Please help me get this going.
alias: Entryway - Drfit - Turn on when someone comes in
description: ""
trigger:
- type: motion
platform: device
device_id: cfa0e90b69ef4be6786ddce92fbc3d08
entity_id: binary_sensor.front_doorbell_motion
domain: binary_sensor
condition:
- condition: template
value_template: >-
wait_template: "{{
is_state('binary_sensor.lumi_lumi_motion_ac02_iaszone_3', 'on') }}"
timeout: "00:00:05"
action:
- type: turn_on
device_id: 03974c1a85d3a76c7b10b873ee8e5619
entity_id: switch.drift_socket_1
domain: switch
mode: single