binary_sensor:
- platform: homeassistant
id: zhuangtai
entity_id: binary_sensor.redmi_tv
switch:
#小米电视----------------------------------------
- platform: template
name: "Tv Switch"
lambda: |-
if (id(zhuangtai).state) {
return true;
} else {
return false;
}
turn_on_action:
- remote_transmitter.transmit_raw:
code: [979, -568, 543, -608, 544, -1520, 595, -1503, 509, -610, 544, -1550, 515, -606, 544, -1520, 545, -642, 509, -1519, 544, -1522, 542]
carrier_frequency: 38kHz
turn_off_action:
- remote_transmitter.transmit_raw:
code: [979, -568, 543, -608, 544, -1520, 595, -1503, 509, -610, 544, -1550, 515, -606, 544, -1520, 545, -642, 509, -1519, 544, -1522, 542]
carrier_frequency: 38kHz
自己看着修改