Add more configuration for air-purifier
This commit is contained in:
parent
8875c3ec2b
commit
67dd0ba00b
@ -8,23 +8,23 @@
|
||||
- service: light.turn_on
|
||||
data:
|
||||
flash: long
|
||||
brightness: 120
|
||||
brightness: 200
|
||||
rgb_color:
|
||||
- 0
|
||||
- 0
|
||||
- 255
|
||||
entity_id: light.computer_cave_2
|
||||
entity_id: light.desk_lamp
|
||||
mode: single
|
||||
|
||||
- id: daily_off
|
||||
alias: Daily notificaion off
|
||||
trigger:
|
||||
- platform: time
|
||||
at: '10:55'
|
||||
at: '11:25'
|
||||
condition: []
|
||||
action:
|
||||
- service: light.turn_on
|
||||
data:
|
||||
kelvin: 3200
|
||||
entity_id: light.computer_cave_2
|
||||
entity_id: light.desk_lamp
|
||||
mode: single
|
||||
|
30
automations/tasks/air-purifier.yaml
Normal file
30
automations/tasks/air-purifier.yaml
Normal file
@ -0,0 +1,30 @@
|
||||
---
|
||||
- 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
|
@ -2,8 +2,6 @@
|
||||
- name: Build lights automations
|
||||
template:
|
||||
src: lights.yaml.j2
|
||||
dest: build/lights.yaml
|
||||
- name: Build air purifiers automations
|
||||
template:
|
||||
src: air-purifier.yaml.j2
|
||||
dest: build/air-purifier.yaml
|
||||
dest: build/automations/lights.yaml
|
||||
|
||||
- include_tasks: air-purifier.yaml
|
7
automations/templates/air-purifier/fan.yaml.j2
Normal file
7
automations/templates/air-purifier/fan.yaml.j2
Normal file
@ -0,0 +1,7 @@
|
||||
{% for airPurifier in airPurifiers %}
|
||||
# {{ airPurifier.name }}
|
||||
- platform: xiaomi_miio
|
||||
host: {{ airPurifier.ip }}
|
||||
token: '{{ airPurifier.token }}'
|
||||
name: '{{ airPurifier.name }} Purifier'
|
||||
{% endfor %}
|
10
automations/templates/air-purifier/input_number.yaml.j2
Normal file
10
automations/templates/air-purifier/input_number.yaml.j2
Normal file
@ -0,0 +1,10 @@
|
||||
{% 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 %}
|
10
automations/templates/air-purifier/input_select.yaml.j2
Normal file
10
automations/templates/air-purifier/input_select.yaml.j2
Normal file
@ -0,0 +1,10 @@
|
||||
{% for airPurifier in airPurifiers %}
|
||||
# {{ airPurifier.name }}
|
||||
{{ airPurifier.componentId }}_mode:
|
||||
name: Mode
|
||||
options:
|
||||
- Auto
|
||||
- Silent
|
||||
- Favorite
|
||||
icon: "mdi:animation-outline"
|
||||
{% endfor %}
|
30
automations/templates/air-purifier/sensor.yaml.j2
Normal file
30
automations/templates/air-purifier/sensor.yaml.j2
Normal file
@ -0,0 +1,30 @@
|
||||
{% 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 %}
|
41
automations/templates/air-purifier/switch.yaml.j2
Normal file
41
automations/templates/air-purifier/switch.yaml.j2
Normal file
@ -0,0 +1,41 @@
|
||||
{% 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 %}
|
@ -1,6 +1,5 @@
|
||||
---
|
||||
# vars file for automations
|
||||
|
||||
lights:
|
||||
- entityId: light.tv_left
|
||||
name: TV Left
|
||||
@ -40,6 +39,10 @@ airPurifiers:
|
||||
- entityId: fan.xiaomi_miio_device
|
||||
componentId: xiaomi_miio_device
|
||||
name: Living Room
|
||||
ip: 192.168.60.6
|
||||
token: 66e56ff414f359b371b2d0b86e3d37d4
|
||||
- entityId: fan.bedroom_air_purifier
|
||||
componentId: bedroom_air_purifier
|
||||
name: Bedroom
|
||||
ip: 192.168.60.5
|
||||
token: a32c6e74647ac03ad79afaa590b5203c
|
Loading…
Reference in New Issue
Block a user