I have one door sensor at the entrance gate and a door sensor on the main door, to this day I received alerts that the gate or door opens, yesterday I decided to start working with Alexa and TTS, I installed the integration and managed to send voice commands according to text I choose to Alexa, I want once the gate sensor Entrance opens and within 10 seconds of it the main door opens, Alexa will say take off shoes. Is it possible to automate with 2 sensors that once one is opened there is a time of 10 seconds until the other is also opened and then the automation will work?
I want to prevent Alexa from saying every time I open the door to take off my shoes, this automation should actually differentiate between who enters and who leaves the house.
I tried to do with WAIT FOR TRIGGER I did not really succeed, and I note that I have no experience in NODE RED but yesterday I installed it and if there is no choice then I will use it
You definitely don’t need Node Red for this: there are a variety of solutions, and wait_for_trigger should work. This (untested) should trigger on the gate opening, wait up to ten seconds for the door to open, check if is actually is open (i.e. that the trigger has happened rather than the timeout), then send the TTS command.
trigger:
- platform: state
entity_id: binary_sensor.gate_open
to: 'on'
action:
- wait_for_trigger
- platform: state
entity_id: binary_sensor.door_open
to: 'on'
timeout:
seconds: 10
- condition: state
entity_id: binary_sensor.door_open
state: 'on'
- service: [your TTS stuff here]