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

@@ -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,33 +710,51 @@ 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 %}
{% if is_state('input_boolean.hot_day','on') %}
{{ (bedtime - 5400) | timestamp_custom('%H:%M',false) }}
{% elif high >= 80 or low >= 60 %}
{{ (bedtime - 3600) | timestamp_custom('%H:%M',false) }}
{% 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 %}
{{ (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 %}
{{ (bedtime - 1800) | timestamp_custom('%H:%M',false) }}
{{ bedtime | timestamp_custom('%H:%M',false) }}
{% endif %}
- service: input_boolean.turn_on
target: