本帖最后由 ms2 于 2021-12-19 23:12 编辑
最后生成的文件在.storge文件夹里面---我的博联pro是用这个来学码的,但我不喜欢在开关里调用这个文件里的码,这样不直观,所以我都是直接把红外或射频码写到代码里的(HA版本:2021.12.1),比如开关,如下:
switch:
- platform: broadlink
mac: xx:xx:xx:xx:xx:xx
switches:
- name: 卷闸门
command_on: shM0ACiCiIKIgoiCiIKIgoMICIKIgoiCgwgDCAAAAAA
command_off: sgY0AAwfDB8B8iCiIKDB8MHwwfDB8hCgwAAUUAAAAA
- name: 雨棚
command_on: sl00AA0sDCw0sDSwNLA0sDCwNLAwsDCwrEQ0sDSwAAAAA
command_off: src0ACUQDSsKw0rDSsrEQ4rDissEA4sDSwOKw0AAaUAAAAA
# 下面是风扇灯及风扇-------用功率判断开关的状态
- platform: template
switches:
#客厅风扇灯
keting_fan_deng:
friendly_name: 客厅灯
value_template: "{% if states('sensor.gonglv_fan1') | float > 30 %} on {% else %} off {% endif %}"
turn_on:
service: remote.send_command
target:
entity_id: remote.zhi_neng_yao_kong_remote
data:
command: b64:sgBqASYLJgSQmCw4kJgsOpiYLJwsNJCYMJgsOJA0kJwsOIyJgwOJCYLDiQmCyYMDSUlDA0kJwsNAAXcAAAAAAAAAAAAAAAAAAA=
turn_off:
service: remote.send_command
target:
entity_id: remote.zhi_neng_yao_kong_remote
data:
command: b64:sgBqASYLJgwNJCcLJgsNJQ0kJgwNJCcLJgsOJA0lJQwNJQ0kJgwNJCYMJgwNJCYMOJA0lJgsOJCYLJgwOJCYLDiQmCyYMDSUlDA0kJwsNAAXcAAAAAAAAAAAAAAAAAAA=
|