|
发表于 2019-4-3 14:54:35
|
显示全部楼层
手动配置分享下:替换MAC地址 为小写,没有分隔符
sensor:
- platform: mqtt
name: "tc1_power"
state_topic: "homeassistant/sensor/MAC/power/state"
#{"power":"0.9"}
value_template: "{{ value_json.power }}"
unit_of_measurement: W
switch:
- platform: mqtt
name: 'tc1_plug_0'
#homeassistant/switch/MAC/plug_X/config {"name":"插口4","state_topic":"homeassistant/switch/MAC/plug_3/state","command_topic":"device/ztc1/set","payload_on":"{\"mac\":\"MAC\",\"plug_3\":{\"on\":1}}","payload_off":"{\"mac\":\"MAC\",\"plug_3\":{\"on\":0}}"}
state_topic: "homeassistant/switch/MAC/plug_0/state"
#homeassistant/switch/MAC/plug_1/state {"mac":"MAC","plug_1":{"on":0}}
command_topic: "device/ztc1/set"
payload_on: "{\"mac\":\"MAC\",\"plug_0\":{\"on\":1}}"
payload_off: "{\"mac\":\"MAC\",\"plug_0\":{\"on\":0}}"
#qos 等于0时,发现更快
qos: 0
retain: true
|
|