https://post.smzdm.com/p/aevoxrn3/
switch:
- platform: mqtt
name: 'tc1_1'
state_topic: 'homeassistant/switch/F0:FE:6B:E6:7D:F0/plug_0/state'
command_topic: 'device/ztc1/set'
payload_on: '{"mac":"F0:FE:6B:E6:7D:F0))","plug_0":{"on":1}}'
payload_off: '{"mac":"F0:FE:6B:E6:7D:F0","plug_0":{"on":0}}'
- platform: mqtt
name: 'tc1_2'
state_topic: 'homeassistant/switch/F0:FE:6B:E6:7D:F0/plug_1/state'
command_topic: 'device/ztc1/set'
payload_on: '{"mac":"F0:FE:6B:E6:7D:F0","plug_1":{"on":1}}'
payload_off: '{"mac":"F0:FE:6B:E6:7D:F0","plug_1":{"on":0}}'
- platform: mqtt
name: 'tc1_3'
state_topic: 'homeassistant/switch/F0:FE:6B:E6:7D:F0/plug_2/state'
command_topic: 'device/ztc1/set'
payload_on: '{"mac":"F0:FE:6B:E6:7D:F0","plug_2":{"on":1}}'
payload_off: '{"mac":"F0:FE:6B:E6:7D:F0","plug_2":{"on":0}}'
- platform: mqtt
name: 'tc1_4'
state_topic: 'homeassistant/switch/F0:FE:6B:E6:7D:F0/plug_3/state'
command_topic: 'device/ztc1/set'
payload_on: '{"mac":"F0:FE:6B:E6:7D:F0","plug_3":{"on":1}}'
payload_off: '{"mac":"F0:FE:6B:E6:7D:F0","plug_3":{"on":0}}'
- platform: mqtt
name: 'tc1_5'
state_topic: 'homeassistant/switch/F0:FE:6B:E6:7D:F0/plug_4/state'
command_topic: 'device/ztc1/set'
payload_on: '{"mac":"F0:FE:6B:E6:7D:F0","plug_4":{"on":1}}'
payload_off: '{"mac":"F0:FE:6B:E6:7D:F0","plug_4":{"on":0}}'
- platform: mqtt
name: 'tc1_6'
state_topic: 'homeassistant/switch/F0:FE:6B:E6:7D:F0/plug_5/state'
command_topic: 'device/ztc1/set'
payload_on: '{"mac":"F0:FE:6B:E6:7D:F0","plug_5":{"on":1}}'
payload_off: '{"mac":"F0:FE:6B:E6:7D:F0","plug_5":{"on":0}}'
sensor:
- platform: mqtt
name: 'tc1_power'
state_topic: 'homeassistant/sensor/F0:FE:6B:E6:7D:F0/power/state'
unit_of_measurement: 'W'
icon: 'mdi:gauge'
value_template: '{{ value_json.power }}'
homeassistant:
customize:
switch.tc1_1:
friendly_name: TC1插槽1
switch.tc1_2:
friendly_name: TC1插槽2
switch.tc1_3:
friendly_name: TC1插槽3
switch.tc1_4:
friendly_name: TC1插槽4
switch.tc1_5:
friendly_name: TC1插槽5
switch.tc1_6:
friendly_name: TC1插槽6
sensor.tc1_power:
friendly_name: TC1功率
group:
tc1:
name: TC1插座
view: no
entities:
- sensor.tc1_power
- switch.tc1_1
- switch.tc1_2
- switch.tc1_3
- switch.tc1_4
- switch.tc1_5
- switch.tc1_6