|
发表于 2020-3-18 09:32:49
|
显示全部楼层
嗯,已经改成是这样的:
#TC1插座
- platform: mqtt
name: 'ztc1_1_f0fe6be66462'
state_topic: 'device/ztc1/f0fe6be66462/state'
command_topic: 'device/ztc1/f0fe6be66462/set'
payload_on: '{"mac":"f0fe6be66462","plug_0":{"on":1}}'
payload_off: '{"mac":"f0fe6be66462","plug_0":{"on":0}}'
value_template: '{{ value_json.plug_0.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_2_f0fe6be66462'
state_topic: 'device/ztc1/f0fe6be66462/state'
command_topic: 'device/ztc1/f0fe6be66462/set'
payload_on: '{"mac":"f0fe6be66462","plug_1":{"on":1}}'
payload_off: '{"mac":"f0fe6be66462","plug_1":{"on":0}}'
value_template: '{{ value_json.plug_1.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_3_f0fe6be66462'
state_topic: 'device/ztc1/f0fe6be66462/state'
command_topic: 'device/ztc1/f0fe6be66462/set'
payload_on: '{"mac":"f0fe6be66462","plug_2":{"on":1}}'
payload_off: '{"mac":"f0fe6be66462","plug_2":{"on":0}}'
value_template: '{{ value_json.plug_2.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
|
|