Integrate E's bedroom heater with existing automations and scheduling

#256
This commit is contained in:
2025-12-13 20:16:31 -05:00
parent bd9c7190ed
commit 5ae5e5021e
6 changed files with 145 additions and 49 deletions

View File

@@ -6309,3 +6309,27 @@
who: all
alias: Routing
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

View File

@@ -352,6 +352,20 @@ input_number:
step: 1
unit_of_measurement: °F
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:
name: Emma Bedroom Aircon Run Threshold
min: 40

View File

@@ -48,8 +48,8 @@ input_datetime:
has_date: false
has_time: true
icon: mdi:fan-auto
emma_bedroom_cooling:
name: Emma Bedroom Cooling
emma_bedroom_climate:
name: Emma Bedroom Climate
has_date: false
has_time: true
icon: mdi:fan-auto
@@ -899,3 +899,6 @@ script:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.white_noise_emma_bedroom
- service: climate.turn_off
target:
entity_id: climate.emma_bedroom_vtherm

View File

@@ -710,27 +710,34 @@ script:
data:
option: >
{% set low = states('sensor.overnight_lowest_temperature') | int %}
{% set run_threshold = states('input_number.emma_bedroom_aircon_run_threshold') | int %}
{% set mode_threshold = states('input_number.emma_bedroom_aircon_mode_threshold') | int %}
{% if is_state('input_boolean.emma_bedroom_aircon_installed','off') %}
{% set aircon_run_threshold = states('input_number.emma_bedroom_aircon_run_threshold') | int %}
{% set aircon_mode_threshold = states('input_number.emma_bedroom_aircon_mode_threshold') | int %}
{% 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
{% elif low >= run_threshold %}
{% if low >= mode_threshold %}
{% elif low >= aircon_run_threshold and is_state('input_boolean.emma_bedroom_aircon_installed','on') %}
{% if low >= aircon_mode_threshold %}
AC
{% else %}
Fan
{% endif %}
{% elif low < heater_run_threshold and is_state('input_boolean.emma_bedroom_heater_installed','on') %}
Heat
{% else %}
White Noise
{% endif %}
- delay:
milliseconds: 500
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.emma_bedroom_cooling
entity_id: input_datetime.emma_bedroom_climate
data:
time: >
{% set high = states('sensor.todays_high_temp') | int %}
{% set low = states('sensor.overnight_lowest_temperature') | int %}
{% set bedtime = state_attr('input_datetime.emma_bedtime','timestamp') | int %}
{% set schedmode = states('input_select.scheduled_climate_mode_emma_bedroom') %}
{% if schedmode in ['AC','Fan'] and is_state('input_boolean.emma_bedroom_aircon_installed','on') %}
{% if is_state('input_boolean.hot_day','on') %}
{{ (bedtime - 5400) | timestamp_custom('%H:%M',false) }}
{% elif high >= 80 or low >= 60 %}
@@ -738,6 +745,17 @@ script:
{% 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 %}
{{ bedtime | timestamp_custom('%H:%M',false) }}
{% endif %}
- service: input_boolean.turn_on
target:
entity_id: input_boolean.emma_scheduling_evening_ran

View File

@@ -2591,27 +2591,28 @@ kallen_night_meds:
minutes: 0
seconds: 5
milliseconds: 0
- parallel:
- data:
- alias: Send text notifications
parallel:
- alias: Send to parents
data:
who: "{% if states('person.christina_stork') in ['Bob Evans','BobEvans'] %}\n
\ tony\n{% else %}\n parents\n{% endif %}\n"
type: alert
title: Night Meds
message: Kallen needs to take his night meds (melatonin)
message: Kallen needs to take his night meds
tag: kallen-night-meds
actions:
- action: KALLEN_NIGHT_MEDS_TAKEN
title: Taken
- action: KALLEN_NIGHT_MEDS_SKIPPED
title: Skip
alias: Send to parents
action: script.text_notify
- alias: Send to Kallen
data:
who: kallen
type: alert
title: Night Meds
message: You need to take your night meds (melatonin)
message: You need to take your night meds
tag: kallen-night-meds
actions:
- action: KALLEN_NIGHT_MEDS_TAKEN
@@ -2619,7 +2620,6 @@ kallen_night_meds:
- action: KALLEN_NIGHT_MEDS_SKIPPED
title: Skip
action: script.text_notify
alias: Send text notifications
icon: mdi:medication
mode: restart
reset_annc_switches:
@@ -3071,7 +3071,9 @@ emma_sleep:
option: Adaptive
alias: Set lights to adaptive
action: input_select.select_option
- if:
- alias: Set climate mode if not already set
choose:
- conditions:
- alias: White Noise
condition: and
conditions:
@@ -3083,7 +3085,7 @@ emma_sleep:
entity_id: input_boolean.white_noise_emma_bedroom
state: 'off'
alias: White Noise is not already on
then:
sequence:
- target:
entity_id: input_boolean.white_noise_emma_bedroom
data: {}
@@ -3097,7 +3099,42 @@ emma_sleep:
tag: emma-climate
alias: Send white noise notification
action: script.text_notify
alias: Select climate mode
- 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
mode: restart
tina_morning_meds:

View File

@@ -73,11 +73,11 @@
{% endif %}
{% 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') %}
"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') %}
"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') %}
"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') %}
"Emma's white noise generator will activate at {{ input_datetime_read('input_datetime.emma_bedtime') }}. "
{% endif %}