这是我的开关。 上面那个的定义如下,上面图片 是2组开关。我现在想实现的是如果当前状态是开启状态。那么下面的开启开关就不能使用。如果是关闭状态 关闭开关就不能使用。
求各位大神指点。
还有种需求是2个开关互锁,打开一个就不能打开另外一个。。谢谢
binary_sensor:
- platform: mqtt
name: "Int30201"
state_topic: "sensor/zj/302/IntData"
value_template: "{{ value[3] }}"
payload_on: "0"
payload_off: "1"
device_class: opening
下面的开关定义是
switch:
- platform: mqtt
name: "Out30201"
icon: mdi:air-filter
state_topic: "sensor/zj/302/OutData"
command_topic: "sensor/zj/set/302/01"
value_template: "{{ value[1] }}"
payload_on: "4:1"
payload_off: "4:0"
state_on: "1"
state_off: "0"
optimistic: false
qos: 0
retain: false
- platform: mqtt
name: "Out30202"
icon: mdi:lightbulb-outline
state_topic: "sensor/zj/302/OutData"
command_topic: "sensor/zj/set/302/02"
value_template: "{{ value[0] }}"
payload_on: "17:1"
payload_off: "17:0"
state_on: "1"
state_off: "0"
optimistic: false
qos: 0
retain: false
|