本帖最后由 jyz_0501 于 2019-7-25 08:52 编辑
你怎么知道我会呢。。。
sensor.power 改成你的 DC1 功率传感器id
switch:
- platform: template
switches:
tv:
friendly_name: 电视
value_template: "{% if states('sensor.power') | float == 0 %} off {% else %} on {%endif %}"
turn_on:
service: broadlink.send
data_template:
host: !secret blrm_host
packet:
- "JgBQAAABJ5QVEBQSExITNxQSExITNxMSFDcVEBMSEzgTNxU2FTUTEhM4ExITEhMSFDcTEhMSExIWEBM2FDgTNxUQEzgTNxM3FAAFOQABJ0oTAA0FAAAAAAAAAAA="
turn_off:
service: broadlink.send
data_template:
host: !secret blrm_host
packet:
- "JgBYAAABKJMUEhMSExITNxQSExITNxMSFDcTEhMSFDcTNxM3FDcTEhM3FBITEhMSEzcUEhMSExITEhQ3EzcTOBMSEzcTOBM3EwAFOQABJ0oTAAxXAAEoSRMADQU="
|