Attempting to automate a space heater in the basement

This commit is contained in:
2025-01-14 05:45:19 -05:00
parent e1bd79e176
commit 515731fc68
2 changed files with 118 additions and 51 deletions

View File

@ -217,6 +217,10 @@ input_boolean:
name: Cold Day name: Cold Day
icon: mdi:snowflake icon: mdi:snowflake
basement_studio_heat_allowed:
name: Basement Studio Heat Allowed
icon: mdi:heating-coil
input_select: input_select:
scheduled_climate_mode_master_bedroom_aircon: scheduled_climate_mode_master_bedroom_aircon:
name: Scheduled Climate Mode - Master Bedroom Aircon name: Scheduled Climate Mode - Master Bedroom Aircon
@ -359,6 +363,37 @@ input_number:
step: 1 step: 1
unit_of_measurement: °F unit_of_measurement: °F
icon: mdi:thermometer icon: mdi:thermometer
basement_studio_inactive_temp:
name: Basement Studio Inactive Temp
min: 50
max: 80
step: 1
unit_of_measurement: °F
icon: mdi:thermometer
basement_studio_active_temp:
name: Basement Studio Active Temp
min: 50
max: 80
step: 1
unit_of_measurement: °F
icon: mdi:thermometer
climate:
- platform: generic_thermostat
unique_id: c2979677-045e-4393-a1cb-e6618978394f
name: Basement Studio Thermostat
heater: switch.basement_studio_heater
target_sensor: sensor.basement_studio_temperature
min_temp: 50
max_temp: 80
target_temp: 62
ac_mode: false
min_cycle_duration:
minutes: 5
cold_tolerance: 1
hot_tolerance: 1
initial_hvac_mode: "off"
precision: 1.0
intent_script: intent_script:
MasterBedroomModes: MasterBedroomModes:

View File

@ -151,15 +151,14 @@ max_brightness:
going_upstairs: going_upstairs:
alias: Going Upstairs alias: Going Upstairs
sequence: sequence:
- service: mqtt.publish - data:
data:
qos: '2' qos: '2'
retain: true retain: true
topic: house/time/night_mode topic: house/time/night_mode
payload: 'on' payload: 'on'
alias: Tell MQTT that it is night mode now alias: Tell MQTT that it is night mode now
- service: input_select.select_option action: mqtt.publish
data: - data:
option: Adaptive option: Adaptive
target: target:
entity_id: entity_id:
@ -168,16 +167,17 @@ going_upstairs:
- input_select.mud_room_scenes - input_select.mud_room_scenes
- input_select.living_room_scenes - input_select.living_room_scenes
alias: Set scenes alias: Set scenes
- service: input_boolean.turn_on action: input_select.select_option
entity_id: input_boolean.night_mode - entity_id: input_boolean.night_mode
alias: Turn on Night Mode alias: Turn on Night Mode
action: input_boolean.turn_on
- alias: Turn off Studio Quiet and Gaming Mode - alias: Turn off Studio Quiet and Gaming Mode
service: input_boolean.turn_off
data: {} data: {}
target: target:
entity_id: entity_id:
- input_boolean.studio_quiet - input_boolean.studio_quiet
- input_boolean.gaming_mode - input_boolean.gaming_mode
action: input_boolean.turn_off
- alias: Thermostat reminder - alias: Thermostat reminder
if: if:
- alias: If triggered from basement - alias: If triggered from basement
@ -186,19 +186,51 @@ going_upstairs:
state: Basement Echo Dot state: Basement Echo Dot
then: then:
- alias: Remind in basement - alias: Remind in basement
service: script.speech_engine
data: data:
who: basement who: basement
message: Remember to set the thermostat for the night message: Remember to set the thermostat for the night
type: alert type: alert
action: script.speech_engine
else: else:
- alias: Remind in living room - alias: Remind in living room
service: script.speech_engine
data: data:
who: living_room who: living_room
message: Remember to set the thermostat for the night message: Remember to set the thermostat for the night
type: alert type: alert
action: script.speech_engine
enabled: false enabled: false
- alias: Basement Studio Climate
if:
- condition: state
entity_id: input_boolean.basement_studio_heat_allowed
state: 'on'
alias: Heat Allowed
then:
- alias: Decide basement studio heater action
if:
- condition: numeric_state
entity_id: weather.iron_nerd_weather_station
attribute: temperature
below: 32
alias: Temperature below freezing
then:
- action: climate.set_temperature
metadata: {}
data:
hvac_mode: heat
temperature: '{{ states(''input_number.basement_studio_inactive_temp'')
| int }}'
target:
entity_id: climate.basement_studio_thermostat
alias: Set basement studio heater to inactive temp
else:
- action: climate.set_hvac_mode
metadata: {}
data:
hvac_mode: 'off'
target:
entity_id: climate.basement_studio_thermostat
alias: Turn basement studio heater off
- if: - if:
- condition: not - condition: not
conditions: conditions:
@ -206,19 +238,19 @@ going_upstairs:
entity_id: media_player.basement_tv entity_id: media_player.basement_tv
state: playing state: playing
then: then:
- service: media_player.turn_off - target:
target:
entity_id: media_player.basement_tv entity_id: media_player.basement_tv
data: {} data: {}
action: media_player.turn_off
alias: Turn basement TV off, unless something is playing alias: Turn basement TV off, unless something is playing
- if: - if:
- condition: state - condition: state
entity_id: input_boolean.kallen_computer_updates entity_id: input_boolean.kallen_computer_updates
state: 'off' state: 'off'
then: then:
- service: script.kallen_desktop_shutdown - data: {}
data: {}
alias: Shut down Kallen desktop alias: Shut down Kallen desktop
action: script.kallen_desktop_shutdown
alias: Shutdown Kallen Desktop, unless it is updating alias: Shutdown Kallen Desktop, unless it is updating
- choose: - choose:
- conditions: - conditions:
@ -227,68 +259,67 @@ going_upstairs:
state: Living Room Echo Dot state: Living Room Echo Dot
alias: If triggered from living room alias: If triggered from living room
sequence: sequence:
- service: script.activate_alexa_actionable_notification - data:
data:
text: <voice name='Joanna'><prosody rate='150%'>Would you like me to shut text: <voice name='Joanna'><prosody rate='150%'>Would you like me to shut
down your computer?</prosody></voice> down your computer?</prosody></voice>
event_id: actionable_notification_shutdown_computer event_id: actionable_notification_shutdown_computer
alexa_device: media_player.living_room_echo_dot alexa_device: media_player.living_room_echo_dot
response_variable: shutdown response_variable: shutdown
alias: Ask in living room alias: Ask in living room
action: script.activate_alexa_actionable_notification
- conditions: - conditions:
- condition: state - condition: state
entity_id: sensor.last_alexa_name entity_id: sensor.last_alexa_name
state: Master Bedroom Echo Dot state: Master Bedroom Echo Dot
alias: If triggered from master bedroom alias: If triggered from master bedroom
sequence: sequence:
- service: script.activate_alexa_actionable_notification - data:
data:
text: <voice name='Joanna'><prosody rate='150%'>Would you like me to shut text: <voice name='Joanna'><prosody rate='150%'>Would you like me to shut
down your computer?</prosody></voice> down your computer?</prosody></voice>
event_id: actionable_notification_shutdown_computer event_id: actionable_notification_shutdown_computer
alexa_device: media_player.master_bedroom_echo_dot alexa_device: media_player.master_bedroom_echo_dot
response_variable: shutdown response_variable: shutdown
alias: Ask in master bedroom alias: Ask in master bedroom
action: script.activate_alexa_actionable_notification
default: default:
- service: script.activate_alexa_actionable_notification - data:
data:
text: <voice name='Joanna'><prosody rate='150%'>Would you like me to shut text: <voice name='Joanna'><prosody rate='150%'>Would you like me to shut
down your computer?</prosody></voice> down your computer?</prosody></voice>
event_id: actionable_notification_shutdown_computer event_id: actionable_notification_shutdown_computer
alexa_device: media_player.basement_echo_dot alexa_device: media_player.basement_echo_dot
response_variable: shutdown response_variable: shutdown
alias: Ask in basement alias: Ask in basement
action: script.activate_alexa_actionable_notification
alias: Ask about shutting down main computer alias: Ask about shutting down main computer
- wait_for_trigger: - wait_for_trigger:
- platform: state - entity_id:
entity_id:
- binary_sensor.basement_studio_door - binary_sensor.basement_studio_door
from: 'off' from: 'off'
to: 'on' to: 'on'
id: door id: door
- platform: state trigger: state
entity_id: - entity_id:
- input_boolean.goodnight - input_boolean.goodnight
from: 'off' from: 'off'
to: 'on' to: 'on'
id: goodnight id: goodnight
- platform: state trigger: state
entity_id: light.master_bedroom_lights - entity_id: light.master_bedroom_lights
to: 'on' to: 'on'
id: lights id: lights
trigger: state
timeout: timeout:
hours: 0 hours: 0
minutes: 30 minutes: 30
seconds: 0 seconds: 0
milliseconds: 0 milliseconds: 0
alias: Figure out where I am alias: Figure out where I am
- service: light.turn_off - data: {}
data: {}
target: target:
entity_id: light.basement_studio_lights entity_id: light.basement_studio_lights
alias: Turn off the lights alias: Turn off the lights
- service: input_datetime.set_datetime action: light.turn_off
data: - data:
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(0,2) datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(0,2)
}} }}
@ -296,12 +327,12 @@ going_upstairs:
target: target:
entity_id: input_datetime.tony_night_meds_notify entity_id: input_datetime.tony_night_meds_notify
alias: Schedule the night meds notification alias: Schedule the night meds notification
action: input_datetime.set_datetime
- if: - if:
- condition: template - condition: template
value_template: '{{ wait.trigger.id in [''goodnight'',''lights''] }}' value_template: '{{ wait.trigger.id in [''goodnight'',''lights''] }}'
then: then:
- service: script.text_notify - data:
data:
type: alert type: alert
who: tony who: tony
title: Basement Shutdown title: Basement Shutdown
@ -315,25 +346,26 @@ going_upstairs:
- action: GU_PC_SHUTDOWN_NOTHING - action: GU_PC_SHUTDOWN_NOTHING
title: Do Nothing title: Do Nothing
alias: Send an actionable notification alias: Send an actionable notification
action: script.text_notify
- wait_for_trigger: - wait_for_trigger:
- platform: event - event_type: ios.notification_action_fired
event_type: ios.notification_action_fired
event_data: event_data:
actionName: GU_PC_SHUTDOWN_YES actionName: GU_PC_SHUTDOWN_YES
id: shutdown-yes id: shutdown-yes
alias: Shutdown Yes alias: Shutdown Yes
- platform: event trigger: event
event_type: ios.notification_action_fired - event_type: ios.notification_action_fired
event_data: event_data:
actionName: GU_PC_SHUTDOWN_LOCK actionName: GU_PC_SHUTDOWN_LOCK
id: shutdown-lock id: shutdown-lock
alias: Shutdown Lock alias: Shutdown Lock
- platform: event trigger: event
event_type: ios.notification_action_fired - event_type: ios.notification_action_fired
event_data: event_data:
actionName: GU_PC_SHUTDOWN_NOTHING actionName: GU_PC_SHUTDOWN_NOTHING
alias: Shutdown Nothing alias: Shutdown Nothing
id: shutdown-nothing id: shutdown-nothing
trigger: event
timeout: timeout:
hours: 0 hours: 0
minutes: 20 minutes: 20
@ -345,41 +377,41 @@ going_upstairs:
- condition: template - condition: template
value_template: '{{ wait.trigger.id == ''shutdown-yes'' }}' value_template: '{{ wait.trigger.id == ''shutdown-yes'' }}'
sequence: sequence:
- service: script.tony_desktop_shutdown - data: {}
data: {} action: script.tony_desktop_shutdown
- conditions: - conditions:
- condition: template - condition: template
value_template: '{{ wait.trigger.id == ''shutdown-lock'' }}' value_template: '{{ wait.trigger.id == ''shutdown-lock'' }}'
sequence: sequence:
- service: script.tony_desktop_lock - data: {}
data: {} action: script.tony_desktop_lock
alias: Run the desired action alias: Run the desired action
- service: script.text_notify - data:
data:
type: alert type: alert
who: tony who: tony
message: clear_notification message: clear_notification
tag: going-upstairs-pc-shutdown tag: going-upstairs-pc-shutdown
alias: Clear the notification alias: Clear the notification
action: script.text_notify
- stop: Automation steps skipped - stop: Automation steps skipped
alias: If I was not in the basement, ask about shutdown via text and then skip alias: If I was not in the basement, ask about shutdown via text and then skip
the rest the rest
- wait_for_trigger: - wait_for_trigger:
- platform: state - entity_id:
entity_id:
- binary_sensor.upstairs_bathroom_motion - binary_sensor.upstairs_bathroom_motion
to: 'on' to: 'on'
id: bathroom id: bathroom
- platform: state trigger: state
entity_id: - entity_id:
- input_boolean.goodnight - input_boolean.goodnight
to: 'on' to: 'on'
id: goodnight id: goodnight
- platform: state trigger: state
entity_id: - entity_id:
- light.master_bedroom_lights - light.master_bedroom_lights
to: 'on' to: 'on'
id: lights id: lights
trigger: state
continue_on_timeout: false continue_on_timeout: false
timeout: timeout:
hours: 0 hours: 0
@ -393,11 +425,11 @@ going_upstairs:
- condition: template - condition: template
value_template: '{{ wait.trigger.id == ''bathroom'' }}' value_template: '{{ wait.trigger.id == ''bathroom'' }}'
sequence: sequence:
- service: input_select.select_option - data:
data:
option: Side Nightlight option: Side Nightlight
target: target:
entity_id: input_select.master_bedroom_scenes entity_id: input_select.master_bedroom_scenes
action: input_select.select_option
- conditions: - conditions:
- condition: template - condition: template
value_template: '{{ wait.trigger.id in [''lights'',''goodnight''] }}' value_template: '{{ wait.trigger.id in [''lights'',''goodnight''] }}'