I’m trying to toggle a GPIO pin from high to low, but keep it as input in the meantime, for safety. This is because it’s interfacing with another (commercial) microcontroller.
I need to momentary press the switch, wait a bit, then press it again. Here’s my code, but the output remains high. Ideally, it should switch from input (no pullup) to output low:
switch:
- platform: gpio
pin: D3
id: relay1
inverted: yes
interlock: [relay2]
- platform: template
name: "Blinds Up"
icon: "mdi:blinds"
turn_on_action:
- switch.turn_on: relay1
- delay: 100ms
- switch.turn_off: relay1
- delay: 2000ms
- switch.turn_on: relay1
- delay: 100ms
- switch.turn_off: relay1
- platform: gpio
pin: D4
id: relay2
inverted: yes
interlock: [relay1]
- platform: template
name: "Blinds Down"
icon: "mdi:blinds"
turn_on_action:
- switch.turn_on: relay2
- delay: 100ms
- switch.turn_off: relay2
- delay: 2000ms
- switch.turn_on: relay2
- delay: 100ms
- switch.turn_off: relay2