Finally. Thanks @Tomaae for initial set up.
- get rid of almost all helpers
- get rid of all automations related to mode, fun level, favorite level
- off - everything grayed out, including PM2.5
- on, all numbers white bright, ring indicating air quality - severity defined as sensor in configuration.yaml. My thresholds are orange above 15 polluted and red above 30 critical. They are different than threshold for ring indicator on the purifier display, 75 and 150.
- favorite level - increase 2 steps, decrease 1 step, user definable step in lovelace.yaml
- there are more sensors defined than requested in configuration.yaml for extra developments
- extra automations could be found above in @Tomaae post 53
- Additional info: open attributes - Google 3 dots:
configuration.yaml
#======================#
# Mi Air Purifier 3H #
#======================#
fan:
- platform: xiaomi_miio
name: "Mi Air Purifier 3H"
host: !secret mi_air_host
token: !secret mi_air_token
model: zhimi.airpurifier.mb3
input_select:
mi_air_purifier_coverage:
name: Coverage
options:
- 2-4 m²
- 5-9 m²
- 7-12 m²
- 12-22 m²
- 14-24 m²
- 14-25 m²
- 16-27 m²
- 17-30 m²
- 18-32 m²
- 19-33 m²
- 20-34 m²
- 22-38 m²
- 23-40 m²
- 26-45 m²
- 28-49 m²
icon: mdi:texture-box
switch:
#======================#
# Mi Air Purifier 3H #
#======================#
- platform: template
switches:
mi_air_purifier_led:
friendly_name: "Display"
value_template: "{{ is_state_attr('fan.mi_air_purifier_3h', 'led', true) }}"
turn_on:
service: xiaomi_miio.fan_set_led_on
data:
entity_id: fan.mi_air_purifier_3h
turn_off:
service: xiaomi_miio.fan_set_led_off
data:
entity_id: fan.mi_air_purifier_3h
icon_template: mdi:lightbulb-outline
mi_air_purifier_child_lock:
friendly_name: "Child lock"
value_template: "{{ is_state_attr('fan.mi_air_purifier_3h', 'child_lock', true) }}"
turn_on:
service: xiaomi_miio.fan_set_child_lock_on
data:
entity_id: fan.mi_air_purifier_3h
turn_off:
service: xiaomi_miio.fan_set_child_lock_off
data:
entity_id: fan.mi_air_purifier_3h
icon_template: "mdi:lock-outline"
mi_air_purifier_buzzer:
friendly_name: "Buzzer"
value_template: "{{ is_state_attr('fan.mi_air_purifier_3h', 'buzzer', true) }}"
turn_on:
service: xiaomi_miio.fan_set_buzzer_on
data:
entity_id: fan.mi_air_purifier_3h
turn_off:
service: xiaomi_miio.fan_set_buzzer_off
data:
entity_id: fan.mi_air_purifier_3h
icon_template: "mdi:volume-high"
sensor:
#======================#
# Mi Air Purifier 3H #
#======================#
- platform: template
sensors:
mi_air_purifier_temp:
friendly_name: "Temperature"
value_template: "{{ state_attr('fan.mi_air_purifier_3h', 'temperature') }}"
unit_of_measurement: "°C"
device_class: "temperature"
mi_air_purifier_humidity:
friendly_name: "Humidity"
value_template: "{{ state_attr('fan.mi_air_purifier_3h', 'humidity') }}"
unit_of_measurement: "%"
device_class: "humidity"
mi_air_purifier_air_quality_pm25:
friendly_name: "Air Quality Index (AQI) PM2.5 (μg/m³)"
# value_template: "{{ state_attr('fan.mi_air_purifier_3h', 'aqi') }}"
value_template: >-
{% if state_attr('fan.mi_air_purifier_3h', 'aqi') == None %}
{{ 0 }}
{% else %}
{{ state_attr('fan.mi_air_purifier_3h', 'aqi') }}
{% endif %}
unit_of_measurement: " "
# unit_of_measurement: "μg/m³"
icon_template: "mdi:air-purifier"
mi_air_purifier_pm25_severity:
friendly_name: "PM2.5 severity level"
value_template: >-
{% if state_attr('fan.mi_air_purifier_3h', 'aqi') | int > 30 %}
{{ 'critical' }}
{% elif state_attr('fan.mi_air_purifier_3h', 'aqi') | int > 15 %}
{{ 'polluted' }}
{% else %}
{{ 'clean' }}
{% endif %}
icon_template: "mdi:air-filter"
mi_air_purifier_favorite_level:
friendly_name: "Favorite Level"
value_template: "{{ state_attr('fan.mi_air_purifier_3h', 'favorite_level') }}"
mi_air_purifier_avg_air_quality_pm25:
friendly_name: "Average air quality (AvgAQI) PM2.5"
value_template: "{{ state_attr('fan.mi_air_purifier_3h', 'average_aqi') }}"
unit_of_measurement: "μg/m³"
icon_template: "mdi:weather-hazy"
mi_air_purifier_use_time:
friendly_name: "Time used"
# value_template: "{{ state_attr('fan.mi_air_purifier_3h', 'use_time') }}"
value_template: >
" {% macro phrase(value, name) %}
{%- set value = value | int %}
{%- set end = 's' if value > 1 else '' %}
{{- '{} {}{}'.format(value, name, end) if value | int > 0 else '' }}
{%- endmacro %}
{% set weeks = (state_attr('fan.mi_air_purifier_3h', 'use_time') | int / 604800) | int %}
{% set days = ((state_attr('fan.mi_air_purifier_3h', 'use_time') | int - (weeks * 604800)) / 86400) | int %}
{% set hours = ((state_attr('fan.mi_air_purifier_3h', 'use_time') | int - (weeks * 604800) - (days * 86400)) / 3600) | int %}
{% set minutes = ((state_attr('fan.mi_air_purifier_3h', 'use_time') | int - (weeks * 604800) - (days * 86400) - (hours * 3600)) / 60) | int %}
{% set seconds = (state_attr('fan.mi_air_purifier_3h', 'use_time') | int - (weeks * 604800) - (days * 86400) - (hours * 3600) - (minutes*60)) | int %}
{{ [ phrase(weeks, 'week'), phrase(days, 'day'), phrase(hours, 'hr'), phrase(minutes, 'min'), phrase(seconds, 'sec') ] | select('!=','') | list | join(', ') }}"
# unit_of_measurement: "sec"
icon_template: "mdi:heart-pulse"
mi_air_purifier_filter_used:
friendly_name: "Filter used"
value_template: "{{ state_attr('fan.mi_air_purifier_3h', 'filter_hours_used') }}"
unit_of_measurement: "hrs"
icon_template: "mdi:heart-off"
mi_air_purifier_filter_remaining:
friendly_name: "Filter remaining"
value_template: "{{ state_attr('fan.mi_air_purifier_3h', 'filter_life_remaining') }}"
unit_of_measurement: "%"
icon_template: "mdi:heart-outline"
mi_air_purifier_purify_volume:
friendly_name: "Purified volume"
value_template: "{{ state_attr('fan.mi_air_purifier_3h', 'purify_volume') }}"
unit_of_measurement: "m³"
icon_template: "mdi:warehouse"
mi_air_purifier_speed:
friendly_name: "Motor speed"
value_template: "{{ state_attr('fan.mi_air_purifier_3h', 'motor_speed') }}"
unit_of_measurement: "rpm"
icon_template: "mdi:speedometer"
mi_air_purifier_led_brightness:
friendly_name: "Led brightness"
value_template: "{{ state_attr('fan.mi_air_purifier_3h', 'led_brightness') }}"
unit_of_measurement: "lx"
icon_template: "mdi:brightness-5"
binary_sensor:
#======================#
# Mi Air Purifier 3H #
#======================#
- platform: template
sensors:
mi_air_purifier_mode_off:
friendly_name: "Purifier Off"
value_template: "{{ is_state('fan.mi_air_purifier_3h', 'off') }}"
mi_air_purifier_mode_auto:
friendly_name: "Purifier Auto mode"
value_template: "{{ is_state_attr('fan.mi_air_purifier_3h', 'mode', 0) and is_state('fan.mi_air_purifier_3h', 'on') }}"
mi_air_purifier_mode_silent:
friendly_name: "Purifier Silent mode"
value_template: "{{ is_state_attr('fan.mi_air_purifier_3h', 'mode', 1) and is_state('fan.mi_air_purifier_3h', 'on') }}"
mi_air_purifier_mode_favorite:
friendly_name: "Purifier Favorite mode"
value_template: "{{ is_state_attr('fan.mi_air_purifier_3h', 'mode', 2) and is_state('fan.mi_air_purifier_3h', 'on') }}"
mi_air_purifier_mode_fan:
friendly_name: "Purifier Fan mode"
value_template: "{{ is_state_attr('fan.mi_air_purifier_3h', 'mode', 3) and is_state('fan.mi_air_purifier_3h', 'on') }}"
mi_air_purifier_mode_fan_1:
friendly_name: "Purifier Fan mode 1"
value_template: "{{ is_state_attr('fan.mi_air_purifier_3h', 'mode', 3) and is_state_attr('fan.mi_air_purifier_3h', 'fan_level', 1) and is_state('fan.mi_air_purifier_3h', 'on') }}"
mi_air_purifier_mode_fan_2:
friendly_name: "Purifier Fan mode 2"
value_template: "{{ is_state_attr('fan.mi_air_purifier_3h', 'mode', 3) and is_state_attr('fan.mi_air_purifier_3h', 'fan_level', 2) and is_state('fan.mi_air_purifier_3h', 'on') }}"
mi_air_purifier_mode_fan_3:
friendly_name: "Purifier Fan mode 3"
value_template: "{{ is_state_attr('fan.mi_air_purifier_3h', 'mode', 3) and is_state_attr('fan.mi_air_purifier_3h', 'fan_level', 3) and is_state('fan.mi_air_purifier_3h', 'on') }}"
scripts.yaml
favorite_up:
sequence:
- service: xiaomi_miio.fan_set_favorite_level
data:
level: '{% if (state_attr(entity_id,''favorite_level'') + step | int) < 14 -%}
{{ state_attr(entity_id, ''favorite_level'') + step | int }} {%- else -%}
{{ 14 }} {%- endif %}'
mode: single
favorite_down:
sequence:
- service: xiaomi_miio.fan_set_favorite_level
data:
level: '{% if (state_attr(entity_id,''favorite_level'') - step | int) > 0 -%}
{{ state_attr(entity_id, ''favorite_level'') - step | int }} {%- else -%}
{{ 0 }} {%- endif %}'
mode: single
automation.yaml
- id: '1234567891011'
alias: AP01 - Air Purifier turn on
description: ''
trigger:
- above: '15'
entity_id: sensor.mi_air_purifier_air_quality_pm25
for: 0:01:00
platform: numeric_state
condition:
- condition: state
entity_id: fan.mi_air_purifier_3h
state: 'off'
action:
- data: {}
entity_id: fan.mi_air_purifier_3h
service: fan.turn_on
- data:
speed: Auto
entity_id: fan.mi_air_purifier_3h
service: fan.set_speed
- service: notify.notify
data:
message: Mi Air Purifier 3H turn on at {{ states('sensor.date_time') }}
mode: single
- id: '1234567891012'
alias: AP02 - Air Purifier set favorite level based on PM2.5
description: ''
trigger:
- platform: state
entity_id: sensor.mi_air_purifier_air_quality_pm25
condition:
- condition: state
entity_id: fan.mi_air_purifier_3h
state: 'on'
- condition: or
conditions:
- condition: and
conditions:
- condition: numeric_state
entity_id: sensor.mi_air_purifier_air_quality_pm25
above: '50'
- condition: not
conditions:
- condition: state
entity_id: sensor.mi_air_purifier_favorite_level
state: '14'
- condition: and
conditions:
- condition: numeric_state
entity_id: sensor.mi_air_purifier_air_quality_pm25
above: '35'
below: '51'
- condition: not
conditions:
- condition: state
entity_id: sensor.mi_air_purifier_favorite_level
state: '12'
- condition: and
conditions:
- condition: numeric_state
entity_id: sensor.mi_air_purifier_air_quality_pm25
above: '20'
below: '36'
- condition: not
conditions:
- condition: state
entity_id: sensor.mi_air_purifier_favorite_level
state: '9'
- condition: and
conditions:
- condition: numeric_state
entity_id: sensor.mi_air_purifier_air_quality_pm25
above: '5'
below: '21'
- condition: not
conditions:
- condition: state
entity_id: sensor.mi_air_purifier_favorite_level
state: '6'
- condition: and
conditions:
- condition: numeric_state
entity_id: sensor.mi_air_purifier_air_quality_pm25
below: '6'
- condition: not
conditions:
- condition: state
entity_id: sensor.mi_air_purifier_favorite_level
state: '4'
action:
- data:
speed: Favorite
entity_id: fan.mi_air_purifier_3h
service: fan.set_speed
- data:
level: '{% if states("sensor.mi_air_purifier_air_quality_pm25") | int > 50 -%}
14 {%- elif states("sensor.mi_air_purifier_air_quality_pm25") | int > 35 -%}
12 {%- elif states("sensor.mi_air_purifier_air_quality_pm25") | int > 20 -%}
9 {%- elif states("sensor.mi_air_purifier_air_quality_pm25") | int > 5 -%}
6 {%- else -%} 4 {%- endif %}'
entity_id: fan.mi_air_purifier_3h
service: xiaomi_miio.fan_set_favorite_level
- data: {}
entity_id: automation.air_purifier_translate_favorite_level_to_coverage
service: automation.turn_on
- data:
message: Mi Air Purifier 3H - PM2.5 = {{ states('sensor.mi_air_purifier_air_quality_pm25')
}} μg/m³ set favorite level to {{ state_attr('fan.mi_air_purifier_3h', 'favorite_level')
}} (coverage {{ states('input_select.mi_air_purifier_coverage') }}) at {{
states('sensor.date_time') }}
service: notify.notify
mode: single
- id: '1234567891013'
alias: AP03 - Air Purifier turn off
description: ''
trigger:
- entity_id: sensor.mi_air_purifier_air_quality_pm25
for: 0:01:00
platform: numeric_state
below: '5'
condition:
- condition: state
entity_id: fan.mi_air_purifier_3h
state: 'on'
action:
- data: {}
entity_id: fan.mi_air_purifier_3h
service: fan.turn_off
- service: notify.notify
data:
message: Mi Air Purifier 3H turn off at {{ states('sensor.date_time') }}
mode: single
- id: '1234567891014'
alias: AP04 - Air Purifier favorite level to coverage
description: ''
trigger:
- entity_id: fan.mi_air_purifier_3h
attribute: favorite_level
platform: state
condition: []
action:
- data:
option: "{% if is_state_attr('fan.mi_air_purifier_3h','favorite_level', 0) -%}
2-4 m² {%- elif is_state_attr('fan.mi_air_purifier_3h','favorite_level',
1) -%} 5-9 m² {%- elif is_state_attr('fan.mi_air_purifier_3h','favorite_level',
2) -%} 7-12 m² {%- elif is_state_attr('fan.mi_air_purifier_3h','favorite_level',
3) -%} 12-22 m² {%- elif is_state_attr('fan.mi_air_purifier_3h','favorite_level',
4) -%} 14-24 m² {%- elif is_state_attr('fan.mi_air_purifier_3h','favorite_level',
5) -%} 14-25 m² {%- elif is_state_attr('fan.mi_air_purifier_3h','favorite_level',
6) -%} 16-27 m² {%- elif is_state_attr('fan.mi_air_purifier_3h','favorite_level',
7) -%} 17-30 m² {%- elif is_state_attr('fan.mi_air_purifier_3h','favorite_level',
8) -%} 18-32 m² {%- elif is_state_attr('fan.mi_air_purifier_3h','favorite_level',
9) -%} 19-33 m² {%- elif is_state_attr('fan.mi_air_purifier_3h','favorite_level',
10) -%} 20-34 m² {%- elif is_state_attr('fan.mi_air_purifier_3h','favorite_level',
11) -%} 22-38 m² {%- elif is_state_attr('fan.mi_air_purifier_3h','favorite_level',
12) -%} 23-40 m² {%- elif is_state_attr('fan.mi_air_purifier_3h','favorite_level',
13) -%} 26-45 m² {%- elif is_state_attr('fan.mi_air_purifier_3h','favorite_level',
14) -%} 28-49 m² {%- else -%} {%- endif %}"
entity_id: input_select.mi_air_purifier_coverage
service: input_select.select_option
mode: single
lovelace.yaml
type: picture-elements
image: local/mi_air_purifier_3h.png
elements:
- type: conditional
conditions:
- entity: sensor.mi_air_purifier_pm25_severity
state: clean
- entity: binary_sensor.mi_air_purifier_mode_off
state: 'off'
elements:
- type: image
entity: sensor.mi_air_purifier_pm25_severity
title: PM2.5 severity level
tap_action:
action: more-info
state_image:
clean: local/mi_air_purifier_3h_clean.png
style:
top: 34%
left: 69%
- type: conditional
conditions:
- entity: sensor.mi_air_purifier_pm25_severity
state: polluted
- entity: binary_sensor.mi_air_purifier_mode_off
state: 'off'
elements:
- type: image
entity: sensor.mi_air_purifier_pm25_severity
title: PM2.5 severity level
tap_action:
action: more-info
state_image:
polluted: local/mi_air_purifier_3h_polluted.png
style:
top: 34%
left: 69%
- type: conditional
conditions:
- entity: sensor.mi_air_purifier_pm25_severity
state: critical
- entity: binary_sensor.mi_air_purifier_mode_off
state: 'off'
elements:
- type: image
entity: sensor.mi_air_purifier_pm25_severity
title: PM2.5 severity level
tap_action:
action: more-info
state_image:
critical: local/mi_air_purifier_3h_critical.png
style:
top: 34%
left: 69%
- type: state-icon
entity: binary_sensor.mi_air_purifier_mode_off
title: 'Off'
icon: 'mdi:power-standby'
tap_action:
action: call-service
service: fan.turn_off
service_data:
entity_id: fan.mi_air_purifier_3h
style:
top: 1%
left: 6%
transform: 'translate(-50%, 0)'
'--paper-item-icon-color': 'rgb(128, 128, 128)'
'--paper-item-icon-active-color': 'rgb(255, 128, 0)'
- type: state-icon
entity: fan.mi_air_purifier_3h
title: More Info
icon: 'mdi:dots-vertical'
tap_action:
action: more-info
style:
top: 1%
left: 36%
transform: 'translate(-50%, 0)'
'--paper-item-icon-color': 'rgb(128, 128, 128)'
'--paper-item-icon-active-color': 'rgb(128, 128, 128)'
- type: conditional
conditions:
- entity: binary_sensor.mi_air_purifier_mode_off
state: 'off'
elements:
- type: state-label
entity: sensor.mi_air_purifier_air_quality_pm25
title: PM2.5
tap_action:
action: more-info
style:
top: 19%
left: 68.5%
min-width: 40px
min-height: 40px
text-align: center
font-size: 400%
transform: 'translate(-50%, 0)'
color: 'rgb(255,255,255)'
- type: state-label
entity: sensor.mi_air_purifier_temp
title: Temperature
tap_action:
action: more-info
style:
top: 32%
left: 64%
min-width: 40px
min-height: 40px
text-align: center
font-size: 75%
transform: 'translate(-50%, 0)'
color: 'rgb(255,255,255)'
- type: state-label
entity: sensor.mi_air_purifier_humidity
title: Humidity
tap_action:
action: more-info
style:
top: 32%
left: 71%
min-width: 40px
min-height: 40px
text-align: center
font-size: 75%
transform: 'translate(-50%, 0)'
color: 'rgb(255,255,255)'
- type: state-icon
entity: switch.mi_air_purifier_led
title: Display
tap_action:
action: toggle
style:
top: 15%
left: 36%
transform: 'translate(-50%, 0)'
'--paper-item-icon-color': 'rgb(128, 128, 128)'
'--paper-item-icon-active-color': 'rgb(255, 128, 0)'
- type: state-icon
entity: switch.mi_air_purifier_buzzer
title: Buzzer
tap_action:
action: toggle
style:
top: 29%
left: 36%
transform: 'translate(-50%, 0)'
'--paper-item-icon-color': 'rgb(128, 128, 128)'
'--paper-item-icon-active-color': 'rgb(255, 128, 0)'
- type: state-icon
entity: switch.mi_air_purifier_child_lock
title: Child lock
tap_action:
action: toggle
style:
top: 1%
left: 26%
transform: 'translate(-50%, 0)'
'--paper-item-icon-color': 'rgb(128, 128, 128)'
'--paper-item-icon-active-color': 'rgb(255, 128, 0)'
- type: state-label
entity: sensor.mi_air_purifier_filter_remaining
title: Filter remaining
tap_action:
action: more-info
style:
top: 10%
left: 92%
min-width: 40px
min-height: 40px
text-align: center
font-size: 80%
color: 'rgb(128,128,128)'
- type: conditional
conditions:
- entity: binary_sensor.mi_air_purifier_mode_off
state: 'on'
elements:
- type: state-label
entity: sensor.mi_air_purifier_air_quality_pm25
title: PM2.5
tap_action:
action: more-info
style:
top: 19%
left: 68.5%
min-width: 40px
min-height: 40px
text-align: center
font-size: 400%
transform: 'translate(-50%, 0)'
color: 'rgb(128, 128, 128)'
- type: state-label
entity: sensor.mi_air_purifier_temp
title: Temperature
tap_action:
action: more-info
style:
top: 32%
left: 64%
min-width: 40px
min-height: 40px
text-align: center
font-size: 75%
transform: 'translate(-50%, 0)'
color: 'rgb(128, 128, 128)'
- type: state-label
entity: sensor.mi_air_purifier_humidity
title: Humidity
tap_action:
action: more-info
style:
top: 32%
left: 71%
min-width: 40px
min-height: 40px
text-align: center
font-size: 75%
transform: 'translate(-50%, 0)'
color: 'rgb(128, 128, 128)'
- type: state-icon
entity: binary_sensor.mi_air_purifier_mode_auto
title: Auto
icon: 'mdi:autorenew'
tap_action:
action: call-service
service: fan.set_speed
service_data:
entity_id: fan.mi_air_purifier_3h
speed: Auto
style:
top: 50%
left: 6%
transform: 'translate(-50%, 0)'
'--paper-item-icon-color': 'rgb(192, 192, 192)'
'--paper-item-icon-active-color': 'rgb(255, 128, 0)'
- type: state-icon
entity: binary_sensor.mi_air_purifier_mode_silent
title: Silent
icon: 'mdi:power-sleep'
tap_action:
action: call-service
service: fan.set_speed
service_data:
entity_id: fan.mi_air_purifier_3h
speed: Silent
style:
top: 50%
left: 16%
transform: 'translate(-50%, 0)'
'--paper-item-icon-color': 'rgb(192, 192, 192)'
'--paper-item-icon-active-color': 'rgb(255, 128, 0)'
- type: state-icon
entity: binary_sensor.mi_air_purifier_mode_fan
title: Fan
icon: 'mdi:fan'
tap_action:
action: call-service
service: fan.set_speed
service_data:
entity_id: fan.mi_air_purifier_3h
speed: Fan
style:
top: 50%
left: 26%
transform: 'translate(-50%, 0)'
'--paper-item-icon-color': 'rgb(192, 192, 192)'
'--paper-item-icon-active-color': 'rgb(255, 128, 0)'
- type: state-icon
entity: binary_sensor.mi_air_purifier_mode_favorite
title: Favorite
icon: 'mdi:heart'
tap_action:
action: call-service
service: fan.set_speed
service_data:
entity_id: fan.mi_air_purifier_3h
speed: Favorite
style:
top: 50%
left: 36%
transform: 'translate(-50%, 0)'
'--paper-item-icon-color': 'rgb(192, 192, 192)'
'--paper-item-icon-active-color': 'rgb(255, 128, 0)'
- type: conditional
conditions:
- entity: binary_sensor.mi_air_purifier_mode_fan
state: 'on'
elements:
- type: state-icon
entity: binary_sensor.mi_air_purifier_mode_fan_1
title: Fan level 1
icon: 'mdi:fan-speed-1'
tap_action:
action: call-service
service: xiaomi_miio.fan_set_fan_level
service_data:
entity_id: fan.mi_air_purifier_3h
level: 1
style:
top: 64%
left: 11%
transform: 'translate(-50%, 0)'
'--paper-item-icon-color': 'rgb(192, 192, 192)'
'--paper-item-icon-active-color': 'rgb(255, 128, 0)'
- type: state-icon
entity: binary_sensor.mi_air_purifier_mode_fan_2
title: Fan level 2
icon: 'mdi:fan-speed-2'
tap_action:
action: call-service
service: xiaomi_miio.fan_set_fan_level
service_data:
entity_id: fan.mi_air_purifier_3h
level: 2
style:
top: 64%
left: 21%
transform: 'translate(-50%, 0)'
'--paper-item-icon-color': 'rgb(192, 192, 192)'
'--paper-item-icon-active-color': 'rgb(255, 128, 0)'
- type: state-icon
entity: binary_sensor.mi_air_purifier_mode_fan_3
title: Fan level 3
icon: 'mdi:fan-speed-3'
tap_action:
action: call-service
service: xiaomi_miio.fan_set_fan_level
service_data:
entity_id: fan.mi_air_purifier_3h
level: 3
style:
top: 64%
left: 31%
transform: 'translate(-50%, 0)'
'--paper-item-icon-color': 'rgb(192, 192, 192)'
'--paper-item-icon-active-color': 'rgb(255, 128, 0)'
- type: conditional
conditions:
- entity: binary_sensor.mi_air_purifier_mode_favorite
state: 'on'
elements:
- type: state-label
entity: sensor.mi_air_purifier_favorite_level
title: Favorite level
tap_action:
action: none
style:
top: 64%
left: 21%
min-width: 40px
min-height: 40px
text-align: center
font-size: 200%
transform: 'translate(-50%, 0)'
color: 'rgb(255, 128, 0)'
- type: icon
icon: 'mdi:plus'
title: Favorite level +
tap_action:
action: call-service
service: script.favorite_up
service_data:
entity_id: fan.mi_air_purifier_3h
step: 2
style:
top: 66%
left: 30%
min-width: 40px
min-height: 40px
transform: 'translate(-50%, 0)'
color: 'rgb(192, 192, 192)'
color_off: 'rgb(255, 128, 0)'
- type: icon
icon: 'mdi:minus'
title: Favorite level -
tap_action:
action: call-service
service: script.favorite_down
service_data:
entity_id: fan.mi_air_purifier_3h
step: 1
style:
top: 66%
left: 16%
min-width: 40px
min-height: 40px
transform: 'translate(-50%, 0)'
color: 'rgb(192, 192, 192)'
color_off: 'rgb(255, 128, 0)'
- type: state-label
entity: input_select.mi_air_purifier_coverage
title: Coverage
tap_action:
action: none
style:
top: 74%
left: 23%
min-width: 40px
min-height: 40px
text-align: center
font-size: 100%
transform: 'translate(-50%, 0)'
color: 'rgb(255, 128, 0)'
pictures to be added in /config/www