mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-05-13 19:54:42 +00:00
Automations based on outside AQI
This commit is contained in:
@@ -4,6 +4,10 @@ fan:
|
||||
- platform: philips_airpurifier
|
||||
host: !secret philips_purifier_ip
|
||||
|
||||
input_boolean:
|
||||
purifier_turned_on_for_bad_air:
|
||||
name: Purifier enabled for bad air
|
||||
|
||||
input_select:
|
||||
purifier_speed:
|
||||
name: Speed
|
||||
@@ -280,6 +284,8 @@ automation:
|
||||
action:
|
||||
- service: fan.turn_on
|
||||
entity_id: fan.philips_airpurifier
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.purifier_turned_on_for_bad_air
|
||||
- service: script.say
|
||||
data:
|
||||
message: "Hey, I'm turning on the purifier, because air quality is low"
|
||||
@@ -294,7 +300,7 @@ automation:
|
||||
- service: philips_airpurifier.set_function
|
||||
entity_id: fan.philips_airpurifier
|
||||
data:
|
||||
funcition: "Purification & Humidification"
|
||||
function: "Purification & Humidification"
|
||||
- service: script.say
|
||||
data:
|
||||
message: "Also, switching to humidification, because there is water in the tank"
|
||||
@@ -333,6 +339,35 @@ automation:
|
||||
message: "Purifier Off · Humidity is okay"
|
||||
domain: fan
|
||||
|
||||
- alias: Purifier · Turn off · Air quality returned to normal
|
||||
trigger:
|
||||
platform: numeric_state
|
||||
entity_id: sensor.purifier_air_quality
|
||||
below: 20
|
||||
condition:
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: fan.philips_airpurifier
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: input_boolean.purifier_turned_on_for_bad_air
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: group.bedroom_windows
|
||||
state: "off"
|
||||
|
||||
action:
|
||||
- service: fan.turn_off
|
||||
entity_id: fan.philips_airpurifier
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.purifier_turned_on_for_bad_air
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: "💨 Climate Module · "
|
||||
message: "Purifier Off · Air quality returned to normal"
|
||||
domain: fan
|
||||
|
||||
homeassistant:
|
||||
customize:
|
||||
fan.philips_airpurifier:
|
||||
|
||||
@@ -4,3 +4,80 @@ sensor:
|
||||
locations:
|
||||
- "mladost"
|
||||
- "druzhba"
|
||||
|
||||
binary_sensor:
|
||||
- platform: threshold
|
||||
entity_id: sensor.waqi_mladost_sofia
|
||||
upper: 35
|
||||
name: aqi_above_threshold
|
||||
|
||||
automation:
|
||||
- alias: Cliamate · Air Quality · Alert when opening a window
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id:
|
||||
- binary_sensor.kitchen_window
|
||||
- binary_sensor.living_room_right_window
|
||||
- binary_sensor.bedroom_left_window
|
||||
- binary_sensor.bedroom_right_window
|
||||
from: "off"
|
||||
to: "on"
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.aqi_above_threshold
|
||||
state: "on"
|
||||
action:
|
||||
- service: script.say
|
||||
data:
|
||||
message: "Hey, the air outside is pretty bad. I suggest closing the windows."
|
||||
|
||||
- alias: Cliamate · Air Quality · Alert when AQI drops
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: binary_sensor.aqi_above_threshold
|
||||
from: "off"
|
||||
to: "on"
|
||||
condition:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id:
|
||||
- binary_sensor.kitchen_window
|
||||
- binary_sensor.living_room_right_window
|
||||
- binary_sensor.bedroom_left_window
|
||||
- binary_sensor.bedroom_right_window
|
||||
state: "on"
|
||||
action:
|
||||
- service: script.say
|
||||
data:
|
||||
message: "Hey, the air outside is getting worse, and you have some windows open. I suggest closing them."
|
||||
|
||||
- alias: Cliamate · Air Quality · Turn on purifier in bedroom on window open
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: binary_sensor.aqi_above_threshold
|
||||
from: "off"
|
||||
to: "on"
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: group.bedroom_windows
|
||||
state: "on"
|
||||
|
||||
action:
|
||||
- service: logbook.log
|
||||
data:
|
||||
name: "💨 Climate Module · "
|
||||
message: "Purifier On · Air quality is bad outside and a window was opened"
|
||||
domain: fan
|
||||
- service: fan.turn_on
|
||||
entity_id: fan.philips_airpurifier
|
||||
- service: fan.turn_on
|
||||
entity_id: fan.philips_airpurifier
|
||||
data:
|
||||
speed: "Speed 3"
|
||||
- service: philips_airpurifier.set_function
|
||||
data:
|
||||
entity_id: fan.philips_airpurifier
|
||||
function: "Purification"
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.purifier_turned_on_for_bad_air
|
||||
|
||||
@@ -61,6 +61,16 @@ binary_sensor:
|
||||
value_template: "{{ is_state('sensor.multisensor_6_burglar', '8') }}"
|
||||
|
||||
sensor:
|
||||
- platform: history_stats
|
||||
name: At Desk
|
||||
entity_id: binary_sensor.trisensor_sensor
|
||||
state: "on"
|
||||
type: ratio
|
||||
duration:
|
||||
minutes: 5
|
||||
end: '{{ now() }}'
|
||||
|
||||
|
||||
- platform: history_stats
|
||||
name: Quarantined percent
|
||||
entity_id: device_tracker.carbon
|
||||
|
||||
Reference in New Issue
Block a user