放一个HA控制开关的配置:
switch:
- platform: template
switches:
smart_plug_switch:
unique_id: smart_plug_switch
value_template: "{{ False }}"
availability_template: "{{ True }}"
turn_on:
service: xiaomi_miio_raw.sensor_raw_command
data:
entity_id: sensor.smart_plug
method: set_properties
params:
- did: SwitchStatus
siid: 2
piid: 1
value: true
turn_off:
service: xiaomi_miio_raw.sensor_raw_command
data:
entity_id: sensor.smart_plug
method: set_properties
params:
- did: SwitchStatus
siid: 2
piid: 1
value: false
sensor:
- platform: xiaomi_miio_raw
name: smart_plug
host: x.x.x.x
token: xxxxxx
【 在 xvy 的大作中提到: 】
: 大佬厉害呀,看来有搞头。
--
FROM 59.37.125.*