Refactor automation scripts to enhance garbage day announcements and thermostat control. Removed deprecated responsibilities automation and updated related references in speech engine and templates. Added new automation for setting thermostats to eco mode when away.

pull/1524/head
Carlo Costanzo 5 months ago
parent b5138cc340
commit aec3e1eb2f

@ -259,10 +259,8 @@ Defining Guest Mode - /config/input_boolean/home_modes.yaml#L1-L4</a><br>
Using Guest mode as a condition - /config/script/speech_engine.yaml#L26-L28</a><br> Using Guest mode as a condition - /config/script/speech_engine.yaml#L26-L28</a><br>
<p></details> <p></details>
<details> <details>
<summary>Track garbage days and chore days for the kids. Voice reminders and Alexa intergration/request for info.'</summary><p align="center"> <summary>Track garbage days. Voice reminders and Alexa intergration/request for info.'</summary><p align="center">
<a href=https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/config/input_boolean/hidden_booleans.yaml#L5-L7> <a href=https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/config/input_boolean/hidden_booleans.yaml#L5-L7>
Defining responsibilities trigger - /config/input_boolean/hidden_booleans.yaml#L5-L7</a><br>
<a href=https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/config/script/speech_engine.yaml#L56-L68>
Responsibility Speech Code - /config/script/speech_engine.yaml#L56-L68</a><br> Responsibility Speech Code - /config/script/speech_engine.yaml#L56-L68</a><br>
<p></details> <p></details>
<details> <details>

@ -50,7 +50,7 @@
{%- endmacro -%} {%- endmacro -%}
{{greeting_sentence(person)}} {{greeting_sentence(person)}}
call_responsibilities: 1 call_garbage_day: 1
call_no_announcement: 1 call_no_announcement: 1
call_garage_check: 1 call_garage_check: 1
call_window_check: 1 call_window_check: 1

@ -26,7 +26,7 @@
- service: script.speech_engine - service: script.speech_engine
data: data:
call_inside_weather: 1 call_inside_weather: 1
call_responsibilities: 1 call_garbage_day: 1
call_outside_weather: 1 call_outside_weather: 1
call_garage_check: 1 call_garage_check: 1
call_window_check: 1 call_window_check: 1

@ -1,23 +0,0 @@
######################################################################
## Announce when one of the nests kick in
## Announce over all Chromecast Audios
######################################################################
- alias: 'Nest Status'
id: 7812fdaf-a3f8-498b-8f07-28e977e528fe
trigger:
- platform: state
entity_id:
- climate.downstairs
- climate.upstairs
from: 'off'
action:
- service: script.speech_engine
data:
NestStatus: "The {{ trigger.entity_id.split('.')[1].split('_')[0]}} {{ trigger.entity_id.split('.')[1].split('_')[1]}} has now been turned on for {{(trigger.to_state.state)}}."
call_window_check: 1

@ -1,22 +0,0 @@
#-------------------------------------------
# Responsibilities Announcement
# Description: Triggers a speech announcement for daily responsibilities
#
# Features:
# - Announces garbage day and recycling reminders
# - Triggered by an input_boolean entity
#
# Integration: Uses speech_engine script for announcements
# Follow me on https://www.vcloudinfo.com/click-here
#-------------------------------------------
- alias: 'responsibilities'
id: f39bd8db-a348-4024-a6a6-a3e3c836646c
trigger:
- platform: state
entity_id: input_boolean.responsibilities
to: 'on'
action:
- service: script.speech_engine
data:
call_responsibilities: 1

@ -41,3 +41,25 @@
entity_id: switch.back_landscaping entity_id: switch.back_landscaping
# Set thermostats to eco mode when everyone is away
- alias: 'Set Thermostats to Eco When Away'
id: 1e2d3c4b-eco-thermostat-away
mode: single
trigger:
- platform: state
entity_id: group.family
to: 'not_home'
condition:
- condition: state
entity_id: group.family
state: 'not_home'
- condition: state
entity_id: input_boolean.guest_mode
state: 'off'
action:
- service: climate.set_preset_mode
data:
entity_id:
- climate.downstairs
- climate.upstairs
preset_mode: 'eco'

@ -1,49 +0,0 @@
blueprint:
name: Motion-activated Light
domain: automation
source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/motion_light.yaml
input:
motion_entity:
name: Motion Sensor
selector:
entity:
domain: binary_sensor
device_class: motion
light_target:
name: Light
selector:
target:
entity:
domain: light
no_motion_wait:
name: Wait time
description: Time to wait until the light should be turned off.
default: 120
selector:
number:
min: 0
max: 3600
unit_of_measurement: seconds
# If motion is detected within the delay,
# we restart the script.
mode: restart
max_exceeded: silent
trigger:
platform: state
entity_id: !input motion_entity
from: "off"
to: "on"
action:
- service: light.turn_on
target: !input light_target
- wait_for_trigger:
platform: state
entity_id: !input motion_entity
from: "on"
to: "off"
- delay: !input no_motion_wait
- service: light.turn_off
target: !input light_target

@ -1,41 +0,0 @@
blueprint:
name: Send notification when a person leaves a zone
domain: automation
source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/notify_leaving_zone.yaml
input:
person_entity:
name: Person
selector:
entity:
domain: person
zone_entity:
name: Zone
selector:
entity:
domain: zone
notify_device:
name: Device to notify
description: Device needs to run the official Home Assistant app to receive notifications.
selector:
device:
integration: mobile_app
trigger:
platform: state
entity_id: !input person_entity
variables:
zone_entity: !input zone_entity
zone_state: "{{ states[zone_entity].name }}"
person_entity: !input person_entity
person_name: "{{ states[person_entity].name }}"
condition:
condition: template
value_template: "{{ trigger.from_state.state == zone_state and trigger.to_state.state != zone_state }}"
action:
domain: mobile_app
type: notify
device_id: !input notify_device
message: "{{ person_name }} has left {{ zone_state }}"

@ -1,74 +0,0 @@
blueprint:
name: Confirmable Notification
description: >-
A script that sends an actionable notification with a confirmation before
running the specified action.
domain: script
source_url: https://github.com/home-assistant/core/blob/master/homeassistant/components/script/blueprints/confirmable_notification.yaml
input:
notify_device:
name: Device to notify
description: Device needs to run the official Home Assistant app to receive notifications.
selector:
device:
integration: mobile_app
title:
name: "Title"
description: "The title of the button shown in the notification."
default: ""
selector:
text:
message:
name: "Message"
description: "The message body"
selector:
text:
confirm_text:
name: "Confirmation Text"
description: "Text to show on the confirmation button"
default: "Confirm"
selector:
text:
confirm_action:
name: "Confirmation Action"
description: "Action to run when notification is confirmed"
default: []
selector:
action:
dismiss_text:
name: "Dismiss Text"
description: "Text to show on the dismiss button"
default: "Dismiss"
selector:
text:
dismiss_action:
name: "Dismiss Action"
description: "Action to run when notification is dismissed"
default: []
selector:
action:
mode: restart
sequence:
- alias: "Send notification"
domain: mobile_app
type: notify
device_id: !input notify_device
title: !input title
message: !input message
data:
actions:
- action: "CONFIRM"
title: !input confirm_text
- action: "DISMISS"
title: !input dismiss_text
- alias: "Awaiting response"
wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
- choose:
- conditions: "{{ wait.trigger.event.data.action == 'CONFIRM' }}"
sequence: !input confirm_action
- conditions: "{{ wait.trigger.event.data.action == 'DISMISS' }}"
sequence: !input dismiss_action

@ -1,7 +1,3 @@
home_stats: home_stats:
name: Home Stats name: Home Stats
initial: off initial: off
responsibilities:
name: responsibilities
initial: off

@ -1,6 +1,8 @@
# -------------------------------------------------- ######################################################################
# AC Filterchange runtime tracker ## AC related automations
# -------------------------------------------------- ## For more info visit https://www.vcloudinfo.com/click-here
## Contact: @CCOSTAN
######################################################################
input_datetime: input_datetime:
downstairs_last_filter_change: downstairs_last_filter_change:
@ -118,6 +120,19 @@ automation:
who: "Carlo" who: "Carlo"
group: "maintenance" group: "maintenance"
- alias: 'AC Status off Announcement'
id: 7812fdaf-a3f8-498b-8f07-28e977e528fe
trigger:
- platform: state
entity_id:
- climate.downstairs
- climate.upstairs
from: 'off'
action:
- service: script.speech_engine
data:
NestStatus: "The {{ trigger.entity_id.split('.')[1].split('_')[0]}} {{ trigger.entity_id.split('.')[1].split('_')[1]}} has now been turned on for {{(trigger.to_state.state)}}."
call_window_check: 1
- alias: Prevent Upstairs Nest Below 76 - alias: Prevent Upstairs Nest Below 76
id: 7812fdaf-a3f8-498b-8f07-28e977e528ff id: 7812fdaf-a3f8-498b-8f07-28e977e528ff
@ -132,3 +147,31 @@ automation:
data: data:
entity_id: climate.upstairs entity_id: climate.upstairs
temperature: 77 temperature: 77
- alias: Set Downstairs Nest to 76 When Both in Bed
id: set_downstairs_nest_76_both_in_bed
trigger:
- platform: state
entity_id:
- binary_sensor.sleepnumber_carlo_carlo_is_in_bed
- binary_sensor.sleepnumber_carlo_stacey_is_in_bed
to: 'on'
- platform: numeric_state
entity_id: climate.downstairs
attribute: temperature
above: 76
condition:
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.sleepnumber_carlo_carlo_is_in_bed
state: 'on'
- condition: state
entity_id: binary_sensor.sleepnumber_carlo_stacey_is_in_bed
state: 'on'
action:
- service: climate.set_temperature
data:
entity_id: climate.downstairs
temperature: 76

@ -7,7 +7,7 @@
# call_dark_outside: # call_dark_outside:
# call_window_check: # call_window_check:
# call_garage_check: # call_garage_check:
# call_responsibilities # call_garbage_day
# call_light_check # call_light_check
# call_inside_weather # call_inside_weather
# call_outside_weather # call_outside_weather
@ -50,9 +50,8 @@ speech_engine:
# Include the speech message from the "speech/briefing.yaml" template file # Include the speech message from the "speech/briefing.yaml" template file
speech_message: !include ../templates/speech/briefing.yaml speech_message: !include ../templates/speech/briefing.yaml
# Turn off the "input_boolean.home_stats" and "input_boolean.responsibilities" input booleans # Turn off the "input_boolean.home_stats"
- service: input_boolean.turn_off - service: input_boolean.turn_off
data: data:
entity_id: entity_id:
- input_boolean.home_stats - input_boolean.home_stats
- input_boolean.responsibilities

@ -21,7 +21,7 @@
The sun has set. I will turn on the outside lights. The sun has set. I will turn on the outside lights.
{%- endmacro -%} {%- endmacro -%}
{%- macro responsibilities() -%} {%- macro garbage_day() -%}
{% set day_of_week = now().strftime('%a') %} {% set day_of_week = now().strftime('%a') %}
{% if day_of_week in ['Wed', 'Sun'] %} {% if day_of_week in ['Wed', 'Sun'] %}
Today is garbage day. Today is garbage day.
@ -346,8 +346,8 @@
{{ light_check() }} {{ light_check() }}
{% endif %} {% endif %}
{% if call_responsibilities == 1 %} {% if call_garbage_day == 1 %}
{{ responsibilities() }} {{ garbage_day() }}
{% endif %} {% endif %}
{% if now().strftime('%H')|int(0) > 21 %} {% if now().strftime('%H')|int(0) > 21 %}

Loading…
Cancel
Save

Powered by TurnKey Linux.