I see you would like it to go ON and OFF in X amount of time when the gate is opened or closed.
That’s easy.
You will need to create a template trigger binary sensor and add it your your configuration.yaml
file.
I am assuming you know how to do this… if not look at my bee in the hive blueprint and you will see the step by step guide for adding a template trigger binary sensor… click here. It same but different code.
You will need to create a toggle helper and then use it as the trigger
This will be your code and you will need to replace your gate sensor and add the new toggle helper. This is set for 2 min but adjust as required. When you open the gate the new gate toggle helper will turn ON for 2 min and then turn OFF. When you close the gate the new gate toggle helper will turn ON for 2 min and then turn OFF.
- trigger:
- trigger: state
entity_id: input_boolean.your_door_contact_sensor_here
to: "on"
- trigger: state
entity_id: input_boolean.your_door_contact_sensor_here
to: "off"
action:
- action: input_boolean.turn_on
target:
entity_id: input_boolean.gate_toggle_helper_here
- delay: "00:02:00"
- action: input_boolean.turn_off
target:
entity_id: input_boolean.gate_toggle_helper_here
Hope this is what your after and it helps you.
Blacky