1
0

Remove task for air-purifier

This commit is contained in:
pgrondek 2021-05-24 19:52:48 +02:00
parent a6a5848d05
commit 27b73ffc0e
9 changed files with 0 additions and 263 deletions

View File

@ -1,30 +0,0 @@
---
- name: Build air purifiers automations
template:
src: air-purifier/automations.yaml.j2
dest: build/automations/air-purifier.yaml
- name: Build air purifiers fan
template:
src: air-purifier/fan.yaml.j2
dest: build/fan/air-purifier.yaml
- name: Build air purifiers switch
template:
src: air-purifier/switch.yaml.j2
dest: build/switch/air-purifier.yaml
- name: Build air purifiers inputs
template:
src: air-purifier/input_number.yaml.j2
dest: build/input_number/air-purifier.yaml
- name: Build air purifiers inputs
template:
src: air-purifier/input_select.yaml.j2
dest: build/input_select/air-purifier.yaml
- name: Build air purifiers sensor
template:
src: air-purifier/sensor.yaml.j2
dest: build/sensors/air-purifier.yaml

View File

@ -3,5 +3,3 @@
template:
src: lights.yaml.j2
dest: build/automations/lights.yaml
- include_tasks: air-purifier.yaml

View File

@ -1,119 +0,0 @@
{% for airPurifier in airPurifiers %}
# {{ airPurifier.name }}
- alias: '[{{ airPurifier.name }} Air Purifier] mode change'
id: {{ airPurifier.componentId }}_mode_change
trigger:
entity_id: input_select.{{ airPurifier.componentId }}_mode
platform: state
action:
service: fan.set_speed
data_template:
entity_id: {{ airPurifier.entityId }}
speed: {{ '\'{{ states.input_select.' + airPurifier.componentId + '_mode.state }}\'' }}
- alias: '[{{ airPurifier.name }} Air Purifier] mode changed'
id: {{ airPurifier.componentId }}_mode_changed
trigger:
platform: state
entity_id: {{ airPurifier.entityId }}
action:
service: input_select.select_option
entity_id: input_select.{{ airPurifier.componentId }}_mode
data_template:
option: {{ '\'{{ states.' + airPurifier.entityId + '.attributes.speed }}\'' }}
- alias: '[{{ airPurifier.name }} Air Purifier] favorite level change'
id: {{ airPurifier.entityId }}_favorite_level
trigger:
entity_id: input_number.{{ airPurifier.componentId }}_favorite_level
platform: state
action:
service: xiaomi_miio.fan_set_favorite_level
data_template:
entity_id: {{ airPurifier.entityId }}
level: {{ '\'{{ states.input_number.' + airPurifier.componentId + '_favorite_level.state | int }}\'' }}
- alias: '[{{ airPurifier.name }} Air Purifier] favorite level changed'
id: {{ airPurifier.entityId }}_favorite_level_changed
trigger:
platform: state
entity_id: {{ airPurifier.entityId }}
action:
service: input_number.set_value
entity_id: input_number.{{ airPurifier.componentId }}_favorite_level
data_template:
value: {{ '\'{{ states.' + airPurifier.entityId + '.attributes.favorite_level }}\'' }}
{% if airPurifier.supports_fan_level %}
- alias: '[{{ airPurifier.name }} Air Purifier] fan level changed'
id: {{ airPurifier.entityId }}_fan_level_changed
trigger:
platform: state
entity_id: {{ airPurifier.entityId }}
action:
service: input_number.set_value
entity_id: input_number.{{ airPurifier.componentId }}_fan_level
data_template:
value: {{ '\'{{ states.' + airPurifier.entityId + '.attributes.fan_level }}\'' }}
- alias: '[{{ airPurifier.name }} Air Purifier] fan level change'
id: {{ airPurifier.entityId }}_fan_level_change
trigger:
entity_id: input_number.{{ airPurifier.componentId }}_fan_level
platform: state
action:
service: xiaomi_miio.fan_set_fan_level
data_template:
entity_id: {{ airPurifier.entityId }}
level: {{ '\'{{ states.input_number.' + airPurifier.componentId + '_fan_level.state | int }}\'' }}
{% endif %}
- alias: '[{{ airPurifier.name }} Air Purifier] increase fan speed'
id: {{ airPurifier.entityId }}_fan_speed_increase
trigger:
- platform: numeric_state
entity_id: sensor.{{ airPurifier.componentId }}_air_quality_pm25
above: '12'
action:
- service: fan.set_speed
data:
speed: Favorite
entity_id: {{ airPurifier.entityId }}
- repeat:
while:
- condition: numeric_state
entity_id: sensor.{{ airPurifier.componentId }}_air_quality_pm25
above: '12'
sequence:
- service: xiaomi_miio.fan_set_favorite_level
data_template:
entity_id: {{ airPurifier.entityId }}
level: {{ '\"{{ state_attr(\'' + airPurifier.entityId + '\', \'favorite_level\') | int + 1 }}\"' }}
- service: input_number.set_value
entity_id: input_number.{{ airPurifier.componentId }}_favorite_level
data_template:
value: {{ '\'{{ states.' + airPurifier.entityId + '.attributes.favorite_level }}\'' }}
- delay:
minutes: 1
- alias: '[{{ airPurifier.name }} Air Purifier] decrease fan speed'
id: {{ airPurifier.entityId }}_fan_speed_decrease
trigger:
- platform: numeric_state
entity_id: sensor.{{ airPurifier.componentId }}_air_quality_pm25
below: '10'
action:
- service: fan.set_speed
data:
speed: Favorite
entity_id: {{ airPurifier.entityId }}
- repeat:
while:
- condition: numeric_state
entity_id: sensor.{{ airPurifier.componentId }}_air_quality_pm25
below: '10'
sequence:
- service: xiaomi_miio.fan_set_favorite_level
data_template:
entity_id: {{ airPurifier.entityId }}
level: {{ '\"{{ state_attr(\'' + airPurifier.entityId + '\', \'favorite_level\') | int - 1 }}\"' }}
- service: input_number.set_value
entity_id: input_number.{{ airPurifier.componentId }}_favorite_level
data_template:
value: {{ '\'{{ states.' + airPurifier.entityId + '.attributes.favorite_level }}\'' }}
- delay:
minutes: 1
{% endfor %}

View File

@ -1,7 +0,0 @@
{% for airPurifier in airPurifiers %}
# {{ airPurifier.name }}
- platform: xiaomi_miio
host: {{ airPurifier.ip }}
token: '{{ airPurifier.token }}'
name: '{{ airPurifier.name }} Purifier'
{% endfor %}

View File

@ -1,10 +0,0 @@
{% for airPurifier in airPurifiers %}
# {{ airPurifier.name }}
{{ airPurifier.componentId }}_favorite_level:
name: "Favorite level"
initial: 0
min: 0
max: 14
step: 1
icon: "mdi:weather-windy"
{% endfor %}

View File

@ -1,11 +0,0 @@
{% for airPurifier in airPurifiers %}
# {{ airPurifier.name }}
{{ airPurifier.componentId }}_mode:
name: Mode
options:
- Auto
- Silent
- Favorite
- Fan
icon: "mdi:animation-outline"
{% endfor %}

View File

@ -1,30 +0,0 @@
{% for airPurifier in airPurifiers %}
# {{ airPurifier.name }}
- platform: template
sensors:
{{ airPurifier.componentId }}_temp:
friendly_name: "Temperature"
value_template: {{ '"{{ state_attr(\''+ airPurifier.entityId +'\', \'temperature\') }}"' }}
unit_of_measurement: "°C"
device_class: "temperature"
{{ airPurifier.componentId }}_humidity:
friendly_name: "Humidity"
value_template: {{ '"{{ state_attr(\''+ airPurifier.entityId +'\', \'humidity\') }}"' }}
unit_of_measurement: "%"
device_class: "humidity"
{{ airPurifier.componentId }}_air_quality_pm25:
friendly_name: "Air quality"
value_template: {{ '"{{ state_attr(\''+ airPurifier.entityId +'\', \'aqi\') }}"' }}
unit_of_measurement: "μg/m³"
icon_template: "mdi:weather-fog"
{{ airPurifier.componentId }}_speed:
friendly_name: "Fan speed"
value_template: {{ '"{{ state_attr(\''+ airPurifier.entityId +'\', \'motor_speed\') }}"' }}
unit_of_measurement: "rpm"
icon_template: "mdi:speedometer"
{{ airPurifier.componentId }}_filter_remaining:
friendly_name: "Filter remaining"
value_template: {{ '"{{ state_attr(\''+ airPurifier.entityId +'\', \'filter_life_remaining\') }}"' }}
unit_of_measurement: "%"
icon_template: "mdi:heart-outline"
{% endfor %}

View File

@ -1,41 +0,0 @@
{% for airPurifier in airPurifiers %}
# {{ airPurifier.name }}
- platform: template
switches:
{{ airPurifier.componentId }}_led:
friendly_name: "LED"
value_template: "{{ '{{ is_state_attr(\''+ airPurifier.entityId +'\', \'led\', true) }}"' }}
turn_on:
service: xiaomi_miio.fan_set_led_on
data:
entity_id: {{ airPurifier.entityId }}
turn_off:
service: xiaomi_miio.fan_set_led_off
data:
entity_id: {{ airPurifier.entityId }}
icon_template: "mdi:lightbulb-outline"
{{ airPurifier.componentId }}_child_lock:
friendly_name: "Child lock"
value_template: "{{ '{{ is_state_attr(\''+ airPurifier.entityId +'\', \'child_lock\', true) }}"' }}
turn_on:
service: xiaomi_miio.fan_set_child_lock_on
data:
entity_id: {{ airPurifier.entityId }}
turn_off:
service: xiaomi_miio.fan_set_child_lock_off
data:
entity_id: {{ airPurifier.entityId }}
icon_template: "mdi:lock-outline"
{{ airPurifier.componentId }}_buzzer:
friendly_name: "Buzzer"
value_template: "{{ '{{ is_state_attr(\''+ airPurifier.entityId +'\', \'buzzer\', true) }}"' }}
turn_on:
service: xiaomi_miio.fan_set_buzzer_on
data:
entity_id: {{ airPurifier.entityId }}
turn_off:
service: xiaomi_miio.fan_set_buzzer_off
data:
entity_id: {{ airPurifier.entityId }}
icon_template: "mdi:volume-high"
{% endfor %}

View File

@ -15,16 +15,3 @@ lights:
name: Computer Computer Cave Background
- entityId: light.couch_lamp
name: Couch lamp
airPurifiers:
- entityId: fan.living_room_air_purifier
componentId: living_room_air_purifier
name: Living Room
ip: 192.168.60.6
token: 66e56ff414f359b371b2d0b86e3d37d4
supports_fan_level: true
- entityId: fan.bedroom_air_purifier
componentId: bedroom_air_purifier
name: Bedroom
ip: 192.168.60.5
token: a32c6e74647ac03ad79afaa590b5203c
supports_fan_level: false