esphome接入Home Assistant开关状态不同步?
在代码中这几个开关是互锁的。哪位大神指点一下
switch:
##卷扬机继电器;
- platform: gpio
pin: GPIO25
name: "3.1${sbm}_上"
id: sang
interlock: [xia,tui,la] ##互锁;
# interlock_wait_time: 500ms
restore_mode: ALWAYS_OFF ##上电时默认关闭;
- platform: gpio
pin: GPIO26
name: "3.2.${sbm}_下"
id: xia
interlock: [sang,tui,la] ##互锁;
# interlock_wait_time: 500ms
restore_mode: ALWAYS_OFF ##上电时默认关闭;
on_turn_on: ##开启时启动脚本;
then:
- script.execute: on_lagan
- script.execute: w_xiajiang
- script.execute: n_xiajiang
on_turn_off: ##关闭时,结束脚本;
then:
- script.stop: x_x
##电动拉杆继电器;
- platform: gpio
pin: GPIO32
name: "3.3.${sbm}_推"
id: tui
interlock: [la,sang,xia] ##连锁拉回;
# interlock_wait_time: 500ms
restore_mode: ALWAYS_OFF ##上电时默认关闭。
on_turn_on:
then:
- wait_until:
- binary_sensor.is_on: lagan_w ##检测拉杆推到位##;
- switch.turn_off: tui
- logger.log: "拉杆已推到位"
- platform: gpio
pin: GPIO33
name: "3.4.${sbm}_拉"
id: la
interlock: [tui,sang,xia] ##连锁推出;
# interlock_wait_time: 500ms
restore_mode: ALWAYS_OFF ##上电时默认关闭。
on_turn_on:
then:
- wait_until:
- binary_sensor.is_on: lagan_n ##检测拉杆拉到位##;
- switch.turn_off: la
- logger.log: "拉杆已拉到位"
|