本帖最后由 情非殇 于 2019-7-19 12:41 编辑
你看下官方文档这一段,https://esphome.io/components/switch/gpio.html
额,好像和你的是一样的哟
建议在ha里做个自动化关闭吧
# Example configuration entry
switch:
- platform: gpio
pin: 25
id: relay
- platform: template
name: "Gate Remote"
icon: "mdi:gate"
turn_on_action:
- switch.turn_on: relay
- delay: 500ms
- switch.turn_off: relay
|