1
0

Switch xiaomi configuration to frontend

This commit is contained in:
pgrondek 2021-04-10 11:26:59 +02:00
parent 15223d7eee
commit 244e1424c0
2 changed files with 36 additions and 58 deletions

View File

@ -85,29 +85,6 @@ calendar:
username: pgrondek username: pgrondek
password: !secret nextcloud_token password: !secret nextcloud_token
fan:
# Living Room Air Purifier (3h 2019)
- platform: xiaomi_miio
host: 192.168.60.6
token: !secret xiaomi_living_room_air_purifier_token
name: 'Living Room Air Purifier'
# Bedroom Air Purifier
- platform: xiaomi_miio
host: 192.168.60.5
token: !secret xiaomi_bedroom_air_purifier_token
name: 'Bedroom Air Purifier'
# Humidifier
- platform: xiaomi_miio
host: 192.168.60.8
token: !secret xiaomi_living_room_humidifier
name: 'Living Room Humidifier'
vacuum:
- platform: xiaomi_miio
host: 192.168.60.7
token: !secret xiaomi_vacuum_token
name: 'Robot vacuum'
ble_monitor: ble_monitor:
# Xiaomi BT Sensors # Xiaomi BT Sensors
rounding: True rounding: True
@ -141,35 +118,35 @@ ble_monitor:
mac: 'C4:7C:8D:6C:59:D0' mac: 'C4:7C:8D:6C:59:D0'
sensor: sensor:
# Living Room Air Purifier # Living Room
- platform: template - platform: template
sensors: sensors:
xiaomi_airpurifier_temp: living_room_air_purifier_temp:
friendly_name: "Temperature" friendly_name: "Temperature"
value_template: "{{ state_attr('fan.xiaomi_miio_device', 'temperature') }}" value_template: "{{ state_attr('fan.living_room_air_purifier', 'temperature') }}"
unit_of_measurement: "°C" unit_of_measurement: "°C"
device_class: "temperature" device_class: "temperature"
xiaomi_airpurifier_humidity: living_room_air_purifier_humidity:
friendly_name: "Humidity" friendly_name: "Humidity"
value_template: "{{ state_attr('fan.xiaomi_miio_device', 'humidity') }}" value_template: "{{ state_attr('fan.living_room_air_purifier', 'humidity') }}"
unit_of_measurement: "%" unit_of_measurement: "%"
device_class: "humidity" device_class: "humidity"
xiaomi_airpurifier_air_quality_pm25: living_room_air_purifier_air_quality_pm25:
friendly_name: "Air quality" friendly_name: "Air quality"
value_template: "{{ state_attr('fan.xiaomi_miio_device', 'aqi') }}" value_template: "{{ state_attr('fan.living_room_air_purifier', 'aqi') }}"
unit_of_measurement: "μg/m³" unit_of_measurement: "μg/m³"
icon_template: "mdi:weather-fog" icon_template: "mdi:weather-fog"
xiaomi_airpurifier_speed: living_room_air_purifier_speed:
friendly_name: "Fan speed" friendly_name: "Fan speed"
value_template: "{{ state_attr('fan.xiaomi_miio_device', 'motor_speed') }}" value_template: "{{ state_attr('fan.living_room_air_purifier', 'motor_speed') }}"
unit_of_measurement: "rpm" unit_of_measurement: "rpm"
icon_template: "mdi:speedometer" icon_template: "mdi:speedometer"
xiaomi_airpurifier_filter_remaining: living_room_air_purifier_filter_remaining:
friendly_name: "Filter remaining" friendly_name: "Filter remaining"
value_template: "{{ state_attr('fan.xiaomi_miio_device', 'filter_life_remaining') }}" value_template: "{{ state_attr('fan.living_room_air_purifier', 'filter_life_remaining') }}"
unit_of_measurement: "%" unit_of_measurement: "%"
icon_template: "mdi:heart-outline" icon_template: "mdi:heart-outline"
# Bedroom Air Purifier # Bedroom
- platform: template - platform: template
sensors: sensors:
bedroom_air_purifier_temp: bedroom_air_purifier_temp:
@ -284,46 +261,46 @@ binary_sensor:
host: 192.168.60.14 host: 192.168.60.14
switch: switch:
# Living Room Air Purifier # Living Room
- platform: template - platform: template
switches: switches:
xiaomi_airpurifier_led: living_room_air_purifier_led:
friendly_name: "LED" friendly_name: "LED"
value_template: "{{ is_state_attr('fan.xiaomi_miio_device', 'led', true) }}" value_template: "{{ is_state_attr('fan.living_room_air_purifier', 'led', true) }}"
turn_on: turn_on:
service: xiaomi_miio.fan_set_led_on service: xiaomi_miio.fan_set_led_on
data: data:
entity_id: fan.xiaomi_miio_device entity_id: fan.living_room_air_purifier
turn_off: turn_off:
service: xiaomi_miio.fan_set_led_off service: xiaomi_miio.fan_set_led_off
data: data:
entity_id: fan.xiaomi_miio_device entity_id: fan.living_room_air_purifier
icon_template: "mdi:lightbulb-outline" icon_template: "mdi:lightbulb-outline"
xiaomi_airpurifier_child_lock: living_room_air_purifier_child_lock:
friendly_name: "Child lock" friendly_name: "Child lock"
value_template: "{{ is_state_attr('fan.xiaomi_miio_device', 'child_lock', true) }}" value_template: "{{ is_state_attr('fan.living_room_air_purifier', 'child_lock', true) }}"
turn_on: turn_on:
service: xiaomi_miio.fan_set_child_lock_on service: xiaomi_miio.fan_set_child_lock_on
data: data:
entity_id: fan.xiaomi_miio_device entity_id: fan.living_room_air_purifier
turn_off: turn_off:
service: xiaomi_miio.fan_set_child_lock_off service: xiaomi_miio.fan_set_child_lock_off
data: data:
entity_id: fan.xiaomi_miio_device entity_id: fan.living_room_air_purifier
icon_template: "mdi:lock-outline" icon_template: "mdi:lock-outline"
xiaomi_airpurifier_buzzer: living_room_air_purifier_buzzer:
friendly_name: "Buzzer" friendly_name: "Buzzer"
value_template: "{{ is_state_attr('fan.xiaomi_miio_device', 'buzzer', true) }}" value_template: "{{ is_state_attr('fan.living_room_air_purifier', 'buzzer', true) }}"
turn_on: turn_on:
service: xiaomi_miio.fan_set_buzzer_on service: xiaomi_miio.fan_set_buzzer_on
data: data:
entity_id: fan.xiaomi_miio_device entity_id: fan.living_room_air_purifier
turn_off: turn_off:
service: xiaomi_miio.fan_set_buzzer_off service: xiaomi_miio.fan_set_buzzer_off
data: data:
entity_id: fan.xiaomi_miio_device entity_id: fan.living_room_air_purifier
icon_template: "mdi:volume-high" icon_template: "mdi:volume-high"
# Bedroom Air Purifier # Bedroom
- platform: template - platform: template
switches: switches:
bedroom_air_purifier_led: bedroom_air_purifier_led:
@ -362,6 +339,7 @@ switch:
data: data:
entity_id: fan.bedroom_air_purifier entity_id: fan.bedroom_air_purifier
icon_template: "mdi:volume-high" icon_template: "mdi:volume-high"
# Wake On LAN
- platform: wake_on_lan - platform: wake_on_lan
name: hulk name: hulk
mac: '24:4b:fe:05:e2:8b' mac: '24:4b:fe:05:e2:8b'
@ -370,8 +348,8 @@ switch:
mac: 'f8:75:a4:67:8f:e3' mac: 'f8:75:a4:67:8f:e3'
input_select: input_select:
# Living Room Air Purifier # Living Room
xiaomi_miio_device_mode: living_room_air_purifier_mode:
name: Mode name: Mode
options: options:
- Auto - Auto
@ -379,7 +357,7 @@ input_select:
- Favorite - Favorite
- Fan - Fan
icon: "mdi:animation-outline" icon: "mdi:animation-outline"
# Bedroom Air Purifier # Bedroom
bedroom_air_purifier_mode: bedroom_air_purifier_mode:
name: Mode name: Mode
options: options:
@ -398,15 +376,15 @@ input_select:
icon: "mdi:home" icon: "mdi:home"
input_number: input_number:
# Living Room Air Purifier # Living Room
xiaomi_miio_device_favorite_level: living_room_air_purifier_favorite_level:
name: "Favorite level" name: "Favorite level"
initial: 0 initial: 0
min: 0 min: 0
max: 14 max: 14
step: 1 step: 1
icon: "mdi:weather-windy" icon: "mdi:weather-windy"
# Bedroom Air Purifier # Bedroom
bedroom_air_purifier_favorite_level: bedroom_air_purifier_favorite_level:
name: "Favorite level" name: "Favorite level"
initial: 0 initial: 0
@ -414,7 +392,7 @@ input_number:
max: 14 max: 14
step: 1 step: 1
icon: "mdi:weather-windy" icon: "mdi:weather-windy"
xiaomi_miio_device_fan_level: living_room_air_purifier_fan_level:
name: "Fan level" name: "Fan level"
initial: 1 initial: 1
min: 1 min: 1

View File

@ -16,8 +16,8 @@ lights:
- entityId: light.couch_lamp - entityId: light.couch_lamp
name: Couch lamp name: Couch lamp
airPurifiers: airPurifiers:
- entityId: fan.xiaomi_miio_device - entityId: fan.living_room_air_purifier
componentId: xiaomi_airpurifier componentId: living_room_air_purifier
name: Living Room name: Living Room
ip: 192.168.60.6 ip: 192.168.60.6
token: 66e56ff414f359b371b2d0b86e3d37d4 token: 66e56ff414f359b371b2d0b86e3d37d4