Pick climate settings better when E naps during the day
This commit is contained in:
@ -118,6 +118,13 @@ input_select:
|
||||
- White Noise
|
||||
- N/A
|
||||
icon: mdi:home-thermometer
|
||||
naptime_climate_mode_emma_aircon:
|
||||
name: Naptime Climate Mode - Emma Aircon
|
||||
options:
|
||||
- AC
|
||||
- White Noise
|
||||
- N/A
|
||||
icon: mdi:home-thermometer
|
||||
scheduled_climate_mode_kallen_fan:
|
||||
name: Scheduled Climate Mode - Kallen Fan
|
||||
options:
|
||||
@ -183,6 +190,13 @@ input_number:
|
||||
step: 1
|
||||
unit_of_measurement: °F
|
||||
icon: mdi:thermometer
|
||||
emma_naptime_aircon_threshold:
|
||||
name: Emma Naptime Aircon Threshold
|
||||
min: 40
|
||||
max: 80
|
||||
step: 1
|
||||
unit_of_measurement: °F
|
||||
icon: mdi:thermometer
|
||||
kallen_fan_threshold:
|
||||
name: Kallen Fan Threshold
|
||||
min: 40
|
||||
|
@ -82,6 +82,35 @@ automation:
|
||||
target:
|
||||
entity_id: input_boolean.emma_sleeping
|
||||
|
||||
- id: e44c2ab8-00cd-40ab-9b42-824511ac20aa
|
||||
alias: Emma Naptime Climate
|
||||
description: Sets the climate mode for when Emma goes down for nap
|
||||
mode: restart
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: sensor.pirateweather_temperature
|
||||
- platform: state
|
||||
entity_id: input_number.emma_naptime_aircon_threshold
|
||||
- platform: state
|
||||
entity_id: input_boolean.hot_day
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.emma_sleeping
|
||||
state: 'off'
|
||||
action:
|
||||
- service: input_select.select_option
|
||||
target:
|
||||
entity_id: input_select.naptime_climate_mode_emma_aircon
|
||||
data:
|
||||
option: >
|
||||
{% set temp = states('sensor.pirateweather_temperature') | int %}
|
||||
{% set threshold = states('input_number.emma_naptime_aircon_threshold') | int %}
|
||||
{% if (temp >= threshold) or is_state('input_boolean.hot_day','on') %}
|
||||
AC
|
||||
{% else %}
|
||||
White Noise
|
||||
{% endif %}
|
||||
|
||||
script:
|
||||
emma_sleep:
|
||||
alias: 'Emma Sleep'
|
||||
@ -139,6 +168,25 @@ script:
|
||||
- input_select.upstairs_hallway_scenes
|
||||
data:
|
||||
option: Adaptive
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.early_night_mode
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.emma_bedroom_light
|
||||
- service: script.emma_bedroom_scheduling_evening
|
||||
- delay:
|
||||
seconds: 2
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: >
|
||||
{% set time = states('sensor.time') %}
|
||||
{% set bedtime = state_attr('input_datetime.emma_bedtime','timestamp') | timestamp_custom('%H:%M', false) %}
|
||||
{{ time >= bedtime }}
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
@ -148,10 +196,6 @@ script:
|
||||
- service: fan.turn_on
|
||||
target:
|
||||
entity_id: fan.emma_air_conditioner
|
||||
- if:
|
||||
- condition: template
|
||||
value_template: "{{ states('sensor.time') >= state_attr('input_datetime.emma_bedtime','timestamp') | timestamp_custom('%H:%M', false) }}"
|
||||
then:
|
||||
- service: script.text_notify
|
||||
data:
|
||||
who: "parents"
|
||||
@ -167,10 +211,6 @@ script:
|
||||
- service: input_boolean.turn_on
|
||||
target:
|
||||
entity_id: input_boolean.white_noise_emma_bedroom
|
||||
- if:
|
||||
- condition: template
|
||||
value_template: "{{ states('sensor.time') >= state_attr('input_datetime.emma_bedtime','timestamp') | timestamp_custom('%H:%M', false) }}"
|
||||
then:
|
||||
- service: script.text_notify
|
||||
data:
|
||||
who: "parents"
|
||||
@ -179,10 +219,6 @@ script:
|
||||
type: normal
|
||||
tag: emma-climate
|
||||
default:
|
||||
- if:
|
||||
- condition: template
|
||||
value_template: "{{ states('sensor.time') >= state_attr('input_datetime.emma_bedtime','timestamp') | timestamp_custom('%H:%M', false) }}"
|
||||
then:
|
||||
- service: script.text_notify
|
||||
data:
|
||||
who: "parents"
|
||||
@ -191,29 +227,25 @@ script:
|
||||
type: normal
|
||||
tag: emma-climate
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.early_night_mode
|
||||
state: 'off'
|
||||
- condition: template
|
||||
value_template: >
|
||||
{% set time = states('sensor.time') %}
|
||||
{% set bedtime = state_attr('input_datetime.emma_bedtime','timestamp') | timestamp_custom('%H:%M', false) %}
|
||||
{{ time < bedtime }}
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.emma_bedroom_light
|
||||
- service: script.emma_bedroom_scheduling_evening
|
||||
- delay:
|
||||
seconds: 2
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.scheduled_climate_mode_emma_aircon
|
||||
state: 'AC'
|
||||
entity_id: input_select.naptime_climate_mode_emma_aircon
|
||||
state: AC
|
||||
sequence:
|
||||
- service: fan.turn_on
|
||||
target:
|
||||
entity_id: fan.emma_air_conditioner
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.scheduled_climate_mode_emma_aircon
|
||||
state: 'White Noise'
|
||||
entity_id: input_select.naptime_climate_mode_emma_aircon
|
||||
state: White Noise
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
target:
|
||||
|
Reference in New Issue
Block a user