Integrate E's bedroom heater with existing automations and scheduling
#256
This commit is contained in:
@@ -6309,3 +6309,27 @@
|
|||||||
who: all
|
who: all
|
||||||
alias: Routing
|
alias: Routing
|
||||||
mode: restart
|
mode: restart
|
||||||
|
- id: '1765674032722'
|
||||||
|
alias: Emma Bedroom Heater
|
||||||
|
description: Turns Emma's bedroom heater on at the scheduled time
|
||||||
|
triggers:
|
||||||
|
- trigger: time
|
||||||
|
at: input_datetime.emma_bedroom_climate
|
||||||
|
alias: Emma Bedroom Climate
|
||||||
|
conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_select.scheduled_climate_mode_emma_bedroom
|
||||||
|
state:
|
||||||
|
- Heat
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.emma_bedroom_heater_installed
|
||||||
|
state:
|
||||||
|
- 'on'
|
||||||
|
actions:
|
||||||
|
- action: climate.set_hvac_mode
|
||||||
|
metadata: {}
|
||||||
|
target:
|
||||||
|
entity_id: climate.emma_bedroom_vtherm
|
||||||
|
data:
|
||||||
|
hvac_mode: heat
|
||||||
|
mode: restart
|
||||||
|
|||||||
@@ -352,6 +352,20 @@ input_number:
|
|||||||
step: 1
|
step: 1
|
||||||
unit_of_measurement: °F
|
unit_of_measurement: °F
|
||||||
icon: mdi:thermometer
|
icon: mdi:thermometer
|
||||||
|
emma_bedroom_heater_run_threshold:
|
||||||
|
name: Emma Bedroom Heater Run Threshold
|
||||||
|
min: 40
|
||||||
|
max: 80
|
||||||
|
step: 1
|
||||||
|
unit_of_measurement: °F
|
||||||
|
icon: mdi:thermometer
|
||||||
|
emma_bedroom_heater_shutoff_threshold:
|
||||||
|
name: Emma Bedroom Heater Shutoff Threshold
|
||||||
|
min: 40
|
||||||
|
max: 80
|
||||||
|
step: 1
|
||||||
|
unit_of_measurement: °F
|
||||||
|
icon: mdi:thermometer
|
||||||
emma_bedroom_aircon_run_threshold:
|
emma_bedroom_aircon_run_threshold:
|
||||||
name: Emma Bedroom Aircon Run Threshold
|
name: Emma Bedroom Aircon Run Threshold
|
||||||
min: 40
|
min: 40
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ input_datetime:
|
|||||||
has_date: false
|
has_date: false
|
||||||
has_time: true
|
has_time: true
|
||||||
icon: mdi:fan-auto
|
icon: mdi:fan-auto
|
||||||
emma_bedroom_cooling:
|
emma_bedroom_climate:
|
||||||
name: Emma Bedroom Cooling
|
name: Emma Bedroom Climate
|
||||||
has_date: false
|
has_date: false
|
||||||
has_time: true
|
has_time: true
|
||||||
icon: mdi:fan-auto
|
icon: mdi:fan-auto
|
||||||
@@ -899,3 +899,6 @@ script:
|
|||||||
- service: input_boolean.turn_off
|
- service: input_boolean.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: input_boolean.white_noise_emma_bedroom
|
entity_id: input_boolean.white_noise_emma_bedroom
|
||||||
|
- service: climate.turn_off
|
||||||
|
target:
|
||||||
|
entity_id: climate.emma_bedroom_vtherm
|
||||||
|
|||||||
@@ -710,33 +710,51 @@ script:
|
|||||||
data:
|
data:
|
||||||
option: >
|
option: >
|
||||||
{% set low = states('sensor.overnight_lowest_temperature') | int %}
|
{% set low = states('sensor.overnight_lowest_temperature') | int %}
|
||||||
{% set run_threshold = states('input_number.emma_bedroom_aircon_run_threshold') | int %}
|
{% set aircon_run_threshold = states('input_number.emma_bedroom_aircon_run_threshold') | int %}
|
||||||
{% set mode_threshold = states('input_number.emma_bedroom_aircon_mode_threshold') | int %}
|
{% set aircon_mode_threshold = states('input_number.emma_bedroom_aircon_mode_threshold') | int %}
|
||||||
{% if is_state('input_boolean.emma_bedroom_aircon_installed','off') %}
|
{% set heater_run_threshold = states('input_number.emma_bedroom_heater_run_threshold') | int %}
|
||||||
|
{% if is_state('input_boolean.emma_bedroom_aircon_installed','off') and is_state('input_boolean.emma_bedroom_heater_installed','off') %}
|
||||||
White Noise
|
White Noise
|
||||||
{% elif low >= run_threshold %}
|
{% elif low >= aircon_run_threshold and is_state('input_boolean.emma_bedroom_aircon_installed','on') %}
|
||||||
{% if low >= mode_threshold %}
|
{% if low >= aircon_mode_threshold %}
|
||||||
AC
|
AC
|
||||||
{% else %}
|
{% else %}
|
||||||
Fan
|
Fan
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% elif low < heater_run_threshold and is_state('input_boolean.emma_bedroom_heater_installed','on') %}
|
||||||
|
Heat
|
||||||
{% else %}
|
{% else %}
|
||||||
White Noise
|
White Noise
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
- delay:
|
||||||
|
milliseconds: 500
|
||||||
- service: input_datetime.set_datetime
|
- service: input_datetime.set_datetime
|
||||||
target:
|
target:
|
||||||
entity_id: input_datetime.emma_bedroom_cooling
|
entity_id: input_datetime.emma_bedroom_climate
|
||||||
data:
|
data:
|
||||||
time: >
|
time: >
|
||||||
{% set high = states('sensor.todays_high_temp') | int %}
|
{% set high = states('sensor.todays_high_temp') | int %}
|
||||||
{% set low = states('sensor.overnight_lowest_temperature') | int %}
|
{% set low = states('sensor.overnight_lowest_temperature') | int %}
|
||||||
{% set bedtime = state_attr('input_datetime.emma_bedtime','timestamp') | int %}
|
{% set bedtime = state_attr('input_datetime.emma_bedtime','timestamp') | int %}
|
||||||
{% if is_state('input_boolean.hot_day','on') %}
|
{% set schedmode = states('input_select.scheduled_climate_mode_emma_bedroom') %}
|
||||||
{{ (bedtime - 5400) | timestamp_custom('%H:%M',false) }}
|
{% if schedmode in ['AC','Fan'] and is_state('input_boolean.emma_bedroom_aircon_installed','on') %}
|
||||||
{% elif high >= 80 or low >= 60 %}
|
{% if is_state('input_boolean.hot_day','on') %}
|
||||||
{{ (bedtime - 3600) | timestamp_custom('%H:%M',false) }}
|
{{ (bedtime - 5400) | timestamp_custom('%H:%M',false) }}
|
||||||
|
{% elif high >= 80 or low >= 60 %}
|
||||||
|
{{ (bedtime - 3600) | timestamp_custom('%H:%M',false) }}
|
||||||
|
{% else %}
|
||||||
|
{{ (bedtime - 1800) | timestamp_custom('%H:%M',false) }}
|
||||||
|
{% endif %}
|
||||||
|
{% elif schedmode == 'Heat' and is_state('input_boolean.emma_bedroom_heater_installed','on') %}
|
||||||
|
{% if low <= 20 %}
|
||||||
|
{{ (bedtime - 5400) | timestamp_custom('%H:%M',false) }}
|
||||||
|
{% elif low <= 32 %}
|
||||||
|
{{ (bedtime - 3600) | timestamp_custom('%H:%M',false) }}
|
||||||
|
{% else %}
|
||||||
|
{{ (bedtime - 1800) | timestamp_custom('%H:%M',false) }}
|
||||||
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ (bedtime - 1800) | timestamp_custom('%H:%M',false) }}
|
{{ bedtime | timestamp_custom('%H:%M',false) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- service: input_boolean.turn_on
|
- service: input_boolean.turn_on
|
||||||
target:
|
target:
|
||||||
|
|||||||
103
scripts.yaml
103
scripts.yaml
@@ -2591,27 +2591,28 @@ kallen_night_meds:
|
|||||||
minutes: 0
|
minutes: 0
|
||||||
seconds: 5
|
seconds: 5
|
||||||
milliseconds: 0
|
milliseconds: 0
|
||||||
- parallel:
|
- alias: Send text notifications
|
||||||
- data:
|
parallel:
|
||||||
|
- alias: Send to parents
|
||||||
|
data:
|
||||||
who: "{% if states('person.christina_stork') in ['Bob Evans','BobEvans'] %}\n
|
who: "{% if states('person.christina_stork') in ['Bob Evans','BobEvans'] %}\n
|
||||||
\ tony\n{% else %}\n parents\n{% endif %}\n"
|
\ tony\n{% else %}\n parents\n{% endif %}\n"
|
||||||
type: alert
|
type: alert
|
||||||
title: Night Meds
|
title: Night Meds
|
||||||
message: Kallen needs to take his night meds (melatonin)
|
message: Kallen needs to take his night meds
|
||||||
tag: kallen-night-meds
|
tag: kallen-night-meds
|
||||||
actions:
|
actions:
|
||||||
- action: KALLEN_NIGHT_MEDS_TAKEN
|
- action: KALLEN_NIGHT_MEDS_TAKEN
|
||||||
title: Taken
|
title: Taken
|
||||||
- action: KALLEN_NIGHT_MEDS_SKIPPED
|
- action: KALLEN_NIGHT_MEDS_SKIPPED
|
||||||
title: Skip
|
title: Skip
|
||||||
alias: Send to parents
|
|
||||||
action: script.text_notify
|
action: script.text_notify
|
||||||
- alias: Send to Kallen
|
- alias: Send to Kallen
|
||||||
data:
|
data:
|
||||||
who: kallen
|
who: kallen
|
||||||
type: alert
|
type: alert
|
||||||
title: Night Meds
|
title: Night Meds
|
||||||
message: You need to take your night meds (melatonin)
|
message: You need to take your night meds
|
||||||
tag: kallen-night-meds
|
tag: kallen-night-meds
|
||||||
actions:
|
actions:
|
||||||
- action: KALLEN_NIGHT_MEDS_TAKEN
|
- action: KALLEN_NIGHT_MEDS_TAKEN
|
||||||
@@ -2619,7 +2620,6 @@ kallen_night_meds:
|
|||||||
- action: KALLEN_NIGHT_MEDS_SKIPPED
|
- action: KALLEN_NIGHT_MEDS_SKIPPED
|
||||||
title: Skip
|
title: Skip
|
||||||
action: script.text_notify
|
action: script.text_notify
|
||||||
alias: Send text notifications
|
|
||||||
icon: mdi:medication
|
icon: mdi:medication
|
||||||
mode: restart
|
mode: restart
|
||||||
reset_annc_switches:
|
reset_annc_switches:
|
||||||
@@ -3071,33 +3071,70 @@ emma_sleep:
|
|||||||
option: Adaptive
|
option: Adaptive
|
||||||
alias: Set lights to adaptive
|
alias: Set lights to adaptive
|
||||||
action: input_select.select_option
|
action: input_select.select_option
|
||||||
- if:
|
- alias: Set climate mode if not already set
|
||||||
- alias: White Noise
|
choose:
|
||||||
condition: and
|
- conditions:
|
||||||
conditions:
|
- alias: White Noise
|
||||||
- condition: state
|
condition: and
|
||||||
entity_id: input_select.scheduled_climate_mode_emma_bedroom
|
conditions:
|
||||||
state: White Noise
|
- condition: state
|
||||||
alias: Scheduled mode is White Noise
|
entity_id: input_select.scheduled_climate_mode_emma_bedroom
|
||||||
- condition: state
|
state: White Noise
|
||||||
entity_id: input_boolean.white_noise_emma_bedroom
|
alias: Scheduled mode is White Noise
|
||||||
state: 'off'
|
- condition: state
|
||||||
alias: White Noise is not already on
|
entity_id: input_boolean.white_noise_emma_bedroom
|
||||||
then:
|
state: 'off'
|
||||||
- target:
|
alias: White Noise is not already on
|
||||||
entity_id: input_boolean.white_noise_emma_bedroom
|
sequence:
|
||||||
data: {}
|
- target:
|
||||||
alias: Turn on white noise
|
entity_id: input_boolean.white_noise_emma_bedroom
|
||||||
action: input_boolean.turn_on
|
data: {}
|
||||||
- data:
|
alias: Turn on white noise
|
||||||
who: parents
|
action: input_boolean.turn_on
|
||||||
title: Emma Climate Schedule
|
- data:
|
||||||
message: White noise has been activated in Emma's Bedroom.
|
who: parents
|
||||||
type: normal
|
title: Emma Climate Schedule
|
||||||
tag: emma-climate
|
message: White noise has been activated in Emma's Bedroom.
|
||||||
alias: Send white noise notification
|
type: normal
|
||||||
action: script.text_notify
|
tag: emma-climate
|
||||||
alias: Select climate mode
|
alias: Send white noise notification
|
||||||
|
action: script.text_notify
|
||||||
|
- conditions:
|
||||||
|
- condition: and
|
||||||
|
conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_select.scheduled_climate_mode_emma_bedroom
|
||||||
|
state:
|
||||||
|
- Heat
|
||||||
|
alias: Heat
|
||||||
|
- condition: state
|
||||||
|
entity_id: climate.emma_bedroom_vtherm
|
||||||
|
state:
|
||||||
|
- 'off'
|
||||||
|
alias: Heat is not already on
|
||||||
|
alias: Heat
|
||||||
|
sequence:
|
||||||
|
- action: climate.set_hvac_mode
|
||||||
|
metadata: {}
|
||||||
|
target:
|
||||||
|
entity_id: climate.emma_bedroom_vtherm
|
||||||
|
data:
|
||||||
|
hvac_mode: heat
|
||||||
|
alias: Turn on heater
|
||||||
|
- action: input_boolean.turn_on
|
||||||
|
metadata: {}
|
||||||
|
target:
|
||||||
|
entity_id: input_boolean.white_noise_emma_bedroom
|
||||||
|
data: {}
|
||||||
|
alias: Turn on white noise
|
||||||
|
- alias: Send heater notification
|
||||||
|
data:
|
||||||
|
who: parents
|
||||||
|
title: Emma Climate Schedule
|
||||||
|
message: The space heater has been activated in Emma's Bedroom.
|
||||||
|
type: normal
|
||||||
|
tag: emma-climate
|
||||||
|
action: script.text_notify
|
||||||
icon: mdi:lightbulb-night
|
icon: mdi:lightbulb-night
|
||||||
mode: restart
|
mode: restart
|
||||||
tina_morning_meds:
|
tina_morning_meds:
|
||||||
|
|||||||
@@ -73,11 +73,11 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% if states('input_select.scheduled_climate_mode_emma_bedroom_aircon') != 'N/A' %}
|
{% if states('input_select.scheduled_climate_mode_emma_bedroom_aircon') != 'N/A' %}
|
||||||
{% if is_state('input_select.scheduled_climate_mode_emma_bedroom_aircon','AC') and is_state('input_boolean.hot_day','on') %}
|
{% if is_state('input_select.scheduled_climate_mode_emma_bedroom_aircon','AC') and is_state('input_boolean.hot_day','on') %}
|
||||||
"Today was a hot day, so Emma's bedroom air conditioner will start cooling a bit earlier tonight at {{ input_datetime_read('input_datetime.emma_bedroom_cooling') }}. "
|
"Today was a hot day, so Emma's bedroom air conditioner will start cooling a bit earlier tonight at {{ input_datetime_read('input_datetime.emma_bedroom_climate') }}. "
|
||||||
{% elif is_state('input_select.scheduled_climate_mode_emma_bedroom_aircon','AC') %}
|
{% elif is_state('input_select.scheduled_climate_mode_emma_bedroom_aircon','AC') %}
|
||||||
"Emma's bedroom air conditioner will start cooling at {{ input_datetime_read('input_datetime.emma_bedroom_cooling') }}. "
|
"Emma's bedroom air conditioner will start cooling at {{ input_datetime_read('input_datetime.emma_bedroom_climate') }}. "
|
||||||
{% elif is_state('input_select.scheduled_climate_mode_emma_bedroom_aircon','Fan') %}
|
{% elif is_state('input_select.scheduled_climate_mode_emma_bedroom_aircon','Fan') %}
|
||||||
"Emma's bedroom air conditioner will activate fan only mode at {{ input_datetime_read('input_datetime.emma_bedroom_cooling') }}. "
|
"Emma's bedroom air conditioner will activate fan only mode at {{ input_datetime_read('input_datetime.emma_bedroom_climate') }}. "
|
||||||
{% elif is_state('input_select.scheduled_climate_mode_emma_bedroom','White Noise') and is_state('input_boolean.white_noise_emma_bedroom','off') %}
|
{% elif is_state('input_select.scheduled_climate_mode_emma_bedroom','White Noise') and is_state('input_boolean.white_noise_emma_bedroom','off') %}
|
||||||
"Emma's white noise generator will activate at {{ input_datetime_read('input_datetime.emma_bedtime') }}. "
|
"Emma's white noise generator will activate at {{ input_datetime_read('input_datetime.emma_bedtime') }}. "
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user