不是直接用传感器的
用红外判断传感器状态变成开关!!!!
比如电视的:
switch:
- platform: broadlink
host: 192.168.203.231
mac: 'b4:43:0d:fb:ea:fb'
timeout: 15
switches:
tmmh_box_power:
friendly_name: "天猫魔盒"
command_on: 'JgBQAAABKZUSExIUERQSExIUERQSExIUEjgSOBI4EjgSOBIUERQSOBI4EjgSOBIUEjgSExI4EhQSExIUERQSOBITEjgSFBI4EgAFXwABKEsSAA0FAAAAAAAAAAA='
command_off: 'JgBQAAABKZUSExIUERQSExIUERQSExIUEjgSOBI4EjgSOBIUERQSOBI4EjgSOBIUEjgSExI4EhQSExIUERQSOBITEjgSFBI4EgAFXwABKEsSAA0FAAAAAAAAAAA='
- platform: template
switches:
z6tmmh_box:
value_template: "{{ is_state('binary_sensor.tmmh', 'on') }}"
turn_on:
service: switch.turn_on
entity_id: switch.tmmh_box_power
turn_off:
service: switch.turn_off
entity_id: switch.tmmh_box_power
|