sensor:
- platform: xiaomi_miio_raw
name: yunmi Bat Heater
host: 192.168.31.207
token: ab474c1b15a7ea17c39fbf5b7c6c193d
default_properties:
- power
- humidity
- temp
- switch_state
- wind_tem
- off_time
- platform: template
sensors:
bhhumidity:
friendly_name: '浴霸湿度'
value_template: "{{ state_attr('sensor.yunmi_bat_heater','humidity') }}%"
bhtemp:
friendly_name: '浴霸温度'
value_template: "{{ state_attr('sensor.yunmi_bat_heater','temp') }}°C"
bhstatus:
friendly_name: '浴霸状态'
value_template: "{{ state_attr('sensor.yunmi_bat_heater','switch_state') }}"
bhstatusname:
friendly_name: '浴霸状态'
value_template: >
{% if state_attr('sensor.yunmi_bat_heater','switch_state') == 1 %}待机
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 4 %}换气
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 16 %}照明
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 16384 %}自然风
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 4096 %}暖风
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 256 %}自定义
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 20 %}照明&换气
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 16400 %}照明&自然风
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 4112 %}照明&暖风
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 272 %}照明&自定义
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 16388 %}换气&自然风
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 4100 %}换气&暖风
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 260 %}换气&自定义
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 16404 %}照明&换气&自然风
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 4116 %}照明&换气&暖风
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 276 %}照明&换气&自定义
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 68 %}延时&换气
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 80 %}延时&照明
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 16448 %}延时&自然风
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 4160 %}延时&暖风
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 320 %}延时&自定义
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 84 %}延时&照明&换气
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 16464 %}延时&照明&自然风
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 4176 %}延时&照明&暖风
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 336 %}延时&照明&自定义
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 16452 %}延时&换气&自然风
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 4164 %}延时&换气&暖风
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 324 %}延时&换气&自定义
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 16468 %}延时&照明&换气&自然风
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 4180 %}延时&照明&换气&暖风
{% elif state_attr('sensor.yunmi_bat_heater','switch_state') == 340 %}延时&照明&换气&自定义
{% endif %}
增加温度和湿度显示 |