使用esp8266的io驱动任何点动开关 HomeAssistant 接入代码(EspHome)
output: //定义输出组件
//下面定义模拟按下按键的输出IO
- platform: gpio
pin: 05 //使用的IO
id: key1 //定义下面button调用的id
inverted: True
- platform: gpio
pin: 04
id: key2
inverted: True
button: //定义模拟按下的按键
- platform: output
name: "1 雾化开关"
internal: false //定义是否仅内部使用,修改为true将不在ha界面中显示。
output: key2 //使用的输出id
duration: 100ms //模拟按多久。
- platform: output
name: "2 雾化连续选择"
internal: false //定义是否仅内部使用,修改为true将不在ha界面中显示。
output: key1 //使用的输出id
duration: 100ms //模拟按多久。