trigger:
platform: state
entity_id: switch.open_the_door
to: 'on'
for:
seconds: 1
action:
service: switch.turn_off
entity_id: switch.open_the_door
Add your own alias / id for the automation.
Note: home assistant is not a real time operating system. So your pulse could end up longer than one second if the system load is high.
If the pulse length is absolutely critical you should implement it in hardware with a 555 timer (non-retriggerable monostable) and have the gpio trigger that.
The automation I posted only contained the important bits as I was in a hurry. You were supposed to add the other requirements, including correctly making it a list item.
Replace what you have with this:
- id: open_the_door
alias: Open The Door
initial_state: true
trigger:
platform: state
entity_id: switch.open_the_door
to: 'on'
for:
seconds: 1
action:
service: switch.turn_off
entity_id: switch.open_the_door