From 244e1424c023824f715059985e6956cbd3a80e93 Mon Sep 17 00:00:00 2001 From: pgrondek Date: Sat, 10 Apr 2021 11:26:59 +0200 Subject: [PATCH] Switch xiaomi configuration to frontend --- automations/files/configuration.yaml | 90 +++++++++++----------------- automations/vars/main.yaml | 4 +- 2 files changed, 36 insertions(+), 58 deletions(-) diff --git a/automations/files/configuration.yaml b/automations/files/configuration.yaml index 89daaf4..c080b70 100644 --- a/automations/files/configuration.yaml +++ b/automations/files/configuration.yaml @@ -85,29 +85,6 @@ calendar: username: pgrondek 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: # Xiaomi BT Sensors rounding: True @@ -141,35 +118,35 @@ ble_monitor: mac: 'C4:7C:8D:6C:59:D0' sensor: - # Living Room Air Purifier + # Living Room - platform: template sensors: - xiaomi_airpurifier_temp: + living_room_air_purifier_temp: 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" device_class: "temperature" - xiaomi_airpurifier_humidity: + living_room_air_purifier_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: "%" device_class: "humidity" - xiaomi_airpurifier_air_quality_pm25: + living_room_air_purifier_air_quality_pm25: 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³" icon_template: "mdi:weather-fog" - xiaomi_airpurifier_speed: + living_room_air_purifier_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" icon_template: "mdi:speedometer" - xiaomi_airpurifier_filter_remaining: + living_room_air_purifier_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: "%" icon_template: "mdi:heart-outline" - # Bedroom Air Purifier + # Bedroom - platform: template sensors: bedroom_air_purifier_temp: @@ -284,46 +261,46 @@ binary_sensor: host: 192.168.60.14 switch: - # Living Room Air Purifier + # Living Room - platform: template switches: - xiaomi_airpurifier_led: + living_room_air_purifier_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: service: xiaomi_miio.fan_set_led_on data: - entity_id: fan.xiaomi_miio_device + entity_id: fan.living_room_air_purifier turn_off: service: xiaomi_miio.fan_set_led_off data: - entity_id: fan.xiaomi_miio_device + entity_id: fan.living_room_air_purifier icon_template: "mdi:lightbulb-outline" - xiaomi_airpurifier_child_lock: + living_room_air_purifier_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: service: xiaomi_miio.fan_set_child_lock_on data: - entity_id: fan.xiaomi_miio_device + entity_id: fan.living_room_air_purifier turn_off: service: xiaomi_miio.fan_set_child_lock_off data: - entity_id: fan.xiaomi_miio_device + entity_id: fan.living_room_air_purifier icon_template: "mdi:lock-outline" - xiaomi_airpurifier_buzzer: + living_room_air_purifier_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: service: xiaomi_miio.fan_set_buzzer_on data: - entity_id: fan.xiaomi_miio_device + entity_id: fan.living_room_air_purifier turn_off: service: xiaomi_miio.fan_set_buzzer_off data: - entity_id: fan.xiaomi_miio_device + entity_id: fan.living_room_air_purifier icon_template: "mdi:volume-high" - # Bedroom Air Purifier + # Bedroom - platform: template switches: bedroom_air_purifier_led: @@ -362,6 +339,7 @@ switch: data: entity_id: fan.bedroom_air_purifier icon_template: "mdi:volume-high" + # Wake On LAN - platform: wake_on_lan name: hulk mac: '24:4b:fe:05:e2:8b' @@ -370,8 +348,8 @@ switch: mac: 'f8:75:a4:67:8f:e3' input_select: - # Living Room Air Purifier - xiaomi_miio_device_mode: + # Living Room + living_room_air_purifier_mode: name: Mode options: - Auto @@ -379,7 +357,7 @@ input_select: - Favorite - Fan icon: "mdi:animation-outline" - # Bedroom Air Purifier + # Bedroom bedroom_air_purifier_mode: name: Mode options: @@ -398,15 +376,15 @@ input_select: icon: "mdi:home" input_number: - # Living Room Air Purifier - xiaomi_miio_device_favorite_level: + # Living Room + living_room_air_purifier_favorite_level: name: "Favorite level" initial: 0 min: 0 max: 14 step: 1 icon: "mdi:weather-windy" - # Bedroom Air Purifier + # Bedroom bedroom_air_purifier_favorite_level: name: "Favorite level" initial: 0 @@ -414,7 +392,7 @@ input_number: max: 14 step: 1 icon: "mdi:weather-windy" - xiaomi_miio_device_fan_level: + living_room_air_purifier_fan_level: name: "Fan level" initial: 1 min: 1 diff --git a/automations/vars/main.yaml b/automations/vars/main.yaml index 0d137a8..d6eed86 100644 --- a/automations/vars/main.yaml +++ b/automations/vars/main.yaml @@ -16,8 +16,8 @@ lights: - entityId: light.couch_lamp name: Couch lamp airPurifiers: - - entityId: fan.xiaomi_miio_device - componentId: xiaomi_airpurifier + - entityId: fan.living_room_air_purifier + componentId: living_room_air_purifier name: Living Room ip: 192.168.60.6 token: 66e56ff414f359b371b2d0b86e3d37d4