mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-09-13 15:26:58 +00:00
You can find the entire repo here.
This commit is contained in:
62
config/automation/Speech/High_Wind_Speed_Check.yaml
Executable file
62
config/automation/Speech/High_Wind_Speed_Check.yaml
Executable file
@@ -0,0 +1,62 @@
|
||||
###################################
|
||||
## Tornados are no Joke.
|
||||
###################################
|
||||
|
||||
- alias: 'High Wind Speed Notification'
|
||||
hide_entity: True
|
||||
trigger:
|
||||
- platform: numeric_state
|
||||
entity_id: sensor.dark_sky_wind_speed
|
||||
above: 24
|
||||
- platform: numeric_state
|
||||
entity_id: sensor.dark_sky_wind_speed
|
||||
above: 40
|
||||
- platform: numeric_state
|
||||
entity_id: sensor.dark_sky_wind_speed
|
||||
above: 60
|
||||
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: >
|
||||
{%- if states.automation.high_wind_speed_notification.attributes.last_triggered -%}
|
||||
{{ (as_timestamp(now()) - as_timestamp(states.automation.high_wind_speed_notification.attributes.last_triggered)) > 3600 }}
|
||||
{%- else -%}
|
||||
true
|
||||
{%- endif -%}
|
||||
|
||||
action:
|
||||
- service: script.notify_engine
|
||||
data_template:
|
||||
value1: 'VERY HIGH WINDS:'
|
||||
value2: "{{ states('sensor.dark_sky_wind_speed')}}"
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.alert_mode
|
||||
|
||||
- service: script.speech_engine
|
||||
data_template:
|
||||
value1: >
|
||||
{% set windspeed = states.sensor.dark_sky_wind_speed.state | round %}
|
||||
{% if ( windspeed > 25 ) and ( windspeed <= 40 ) %}
|
||||
HEAVY WINDS!!! Current Wind Speed is : {{windspeed}} mph! Be VERY careful outdoors!
|
||||
{% elif ( windspeed > 40 ) and ( windspeed <= 60 ) %}
|
||||
Warning! Wind speed is {{windspeed}} MPH. FIND SHELTER IMMEDIATELY!
|
||||
{% elif ( windspeed > 60 ) %}
|
||||
HURRICANE WINDS. FIND SHELTER, AND STAY INDOORS!
|
||||
{% endif %}
|
||||
call_window_check: 1
|
||||
call_garage_check: 1
|
||||
|
||||
- service: script.emergency
|
||||
|
||||
- service: script.tweet_engine
|
||||
data_template:
|
||||
tweet: >
|
||||
{% set windspeed = states.sensor.dark_sky_wind_speed.state | round %}
|
||||
{% if ( windspeed > 25 ) and ( windspeed <= 40 ) %}
|
||||
HEAVY WINDS!!! Current Wind Speed is : {{windspeed}} mph! Be VERY careful outdoors! #Florida #Weather (http://amzn.to/2jQLpVQ)
|
||||
{% elif ( windspeed > 40 ) and ( windspeed <= 60 ) %}
|
||||
Current Wind Speed is : {{windspeed}} mph! Warning! #Florida #Weather (http://amzn.to/2jQLpVQ) FIND SHELTER IMMEDIATELY! #Florida #Weather (http://amzn.to/2jQLpVQ)
|
||||
{% elif ( windspeed > 60 ) %}
|
||||
Current Wind Speed is : {{windspeed}} mph! HURRICANE WINDS. FIND SHELTER, AND STAY INDOORS! #Florida #Weather (http://amzn.to/2jQLpVQ)
|
||||
{% endif %}
|
12
config/automation/Speech/README.md
Executable file
12
config/automation/Speech/README.md
Executable file
@@ -0,0 +1,12 @@
|
||||
# [](https://travis-ci.org/CCOSTAN/Home-AssistantConfig) Home-Assistant Config by [@ccostan](http://www.twitter.com/ccostan)
|
||||
[Home Assistant](https://home-assistant.io/) configuration files (YAMLs)
|
||||
|
||||
Be sure to :star: my repo so you can keep up to date on the daily progress!
|
||||
|
||||
This directory is for all the speech only Automations. These speech scripts use a speechengine in the scripts folder but the automations generate all the text (mostly).
|
||||
|
||||
#Still have questions on my Config?
|
||||
Follow me on twitter : [@CCostan](https://twitter.com/ccostan)
|
||||
Follow the Smart Home on twitter : [@BearStoneHA](https://twitter.com/BearStoneHA)
|
||||
|
||||
You can also vist my [Blog](http://www.vmwareinfo.com/search/label/iot) for all of my [Home Automation Posts](http://www.vmwareinfo.com/search/label/iot).
|
41
config/automation/Speech/announcements.yaml
Executable file
41
config/automation/Speech/announcements.yaml
Executable file
@@ -0,0 +1,41 @@
|
||||
########## ############################################################
|
||||
## Announce when people come or go.
|
||||
## Announce over all Chromecast Audios
|
||||
######################################################################
|
||||
- alias: 'People Greeting'
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- device_tracker.carlo
|
||||
- device_tracker.stacey
|
||||
- device_tracker.franco
|
||||
- device_tracker.yolanda
|
||||
from: 'not_home'
|
||||
to: 'home'
|
||||
for: '00:02:00'
|
||||
|
||||
action:
|
||||
- service: script.speech_engine
|
||||
data_template:
|
||||
personarriving: >
|
||||
{% set person = trigger.entity_id.split('.')[1]|replace('_', ' ')%}
|
||||
{%- macro greeting_sentence(person) -%}
|
||||
{{ [
|
||||
"Welcome back home " ~ person,
|
||||
"Guess who is home?" ~ person +" is!",
|
||||
person + " is now in the house.",
|
||||
"Welcome Home " ~ person + ". We have missed you. Or at least Molly did.",
|
||||
"Our home is now complete, Rest your head and relax your feet! Welcome Back " ~ person,
|
||||
"Life is like a song, you’re back where you belong. Welcome home " ~ person,
|
||||
"Hey there " ~ person + " Welcome Home!",
|
||||
"Knock Knock. Who is There? " ~ person +" is!",
|
||||
person ~ "! You are home!",
|
||||
"I know a secret! " ~ person +" is home!"
|
||||
] | random }}
|
||||
{%- endmacro -%}
|
||||
{{greeting_sentence(person)}}
|
||||
call_responsibilities: 1
|
||||
call_no_announcement: 1
|
||||
call_garage_check: 1
|
||||
call_window_check: 1
|
35
config/automation/Speech/door_opened.yaml
Executable file
35
config/automation/Speech/door_opened.yaml
Executable file
@@ -0,0 +1,35 @@
|
||||
######################################################################
|
||||
## Door Open Announcements
|
||||
######################################################################
|
||||
- alias: 'Door Opened'
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.mcu1_gpio5 # Front door #
|
||||
- binary_sensor.mcu2_gpio5 # Back door #
|
||||
- binary_sensor.MCU2_GPIO12 # Main Slider
|
||||
- binary_sensor.MCU1_GPIO12 # Interior Garage Door #
|
||||
from: 'off'
|
||||
|
||||
condition:
|
||||
- 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: script.notify_engine
|
||||
data_template:
|
||||
who: 'parents'
|
||||
value1: "The {{ trigger.to_state.attributes.friendly_name }} has been {{ (trigger.to_state.state)|replace('_', ' ') }}."
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.alert_mode
|
||||
|
||||
- service: script.speech_engine
|
||||
data_template:
|
||||
call_window_check: 1
|
||||
call_inside_weather: 1
|
48
config/automation/Speech/garadget_Wind_Speed_Check.yaml
Executable file
48
config/automation/Speech/garadget_Wind_Speed_Check.yaml
Executable file
@@ -0,0 +1,48 @@
|
||||
###################################
|
||||
## Garadget Stuff - [Garadget](http://amzn.to/2jQLpVQ) - Garage Door opener/sensor
|
||||
###################################
|
||||
|
||||
- alias: 'Wind Speed Garage Door Check'
|
||||
# hide_entity: True
|
||||
trigger:
|
||||
- platform: numeric_state
|
||||
entity_id: sensor.dark_sky_wind_speed
|
||||
above: 20
|
||||
|
||||
condition:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: template
|
||||
value_template: "{{ states('cover.large_garage') == 'opened' }}"
|
||||
- condition: template
|
||||
value_template: "{{ states('cover.small_garage') == 'opened'}}"
|
||||
|
||||
action:
|
||||
- service: script.notify_engine
|
||||
data_template:
|
||||
value1: 'Check Garage Doors:'
|
||||
value2: "Small: {{ states('cover.small_garage')}}"
|
||||
value3: "Large: {{ states('cover.large_garage')}}"
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.alert_mode
|
||||
|
||||
- service: script.speech_engine
|
||||
data_template:
|
||||
value1: >
|
||||
"The winds are picking up outside. The wind speed is {{ states('sensor.dark_sky_wind_speed')|round}} miles per hour. For safety, please close the garage doors.
|
||||
{% if is_state('cover.large_garage', 'open') -%}
|
||||
The Large Garage Door is open
|
||||
{% endif -%}
|
||||
{% if is_state('cover.small_garage', 'open') -%}
|
||||
{% if is_state('cover.large_garage', 'open') -%}and
|
||||
{%- endif %} The small Garage Door is open.
|
||||
{% endif %}"
|
||||
|
||||
- service: script.tweet_engine
|
||||
data_template:
|
||||
tweet: >
|
||||
{{ [
|
||||
"Wind speed is {{ states('sensor.dark_sky_wind_speed')|round}} miles per hour. For safety, I'm going to close the @garadget doors.",
|
||||
"Getting pretty windy! {{ states('sensor.dark_sky_wind_speed')|round}}MPH. Time to ask @Garadget to close the garage doors."
|
||||
] | random + "(http://amzn.to/2jQLpVQ)"}}
|
19
config/automation/Speech/garage_closed.yaml
Executable file
19
config/automation/Speech/garage_closed.yaml
Executable file
@@ -0,0 +1,19 @@
|
||||
######################################################################
|
||||
## Garage Status Announcements - Only during normal hours.
|
||||
######################################################################
|
||||
- alias: 'Garage Door closed'
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- cover.large_garage
|
||||
- cover.small_garage
|
||||
from: 'open'
|
||||
to: 'closed'
|
||||
for: '00:02:00'
|
||||
|
||||
action:
|
||||
- service: script.speech_engine
|
||||
data_template:
|
||||
DoorClosed: "The {{ trigger.entity_id.split('.')[1]|replace('_', ' ') }} is now {{ (trigger.to_state.state)|replace('_', ' ') }}."
|
||||
call_garage_check: 1
|
28
config/automation/Speech/garage_opened.yaml
Executable file
28
config/automation/Speech/garage_opened.yaml
Executable file
@@ -0,0 +1,28 @@
|
||||
######################################################################
|
||||
## Garage Status Announcements
|
||||
######################################################################
|
||||
- alias: 'Garage Opened'
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- cover.large_garage
|
||||
- cover.small_garage
|
||||
from: 'closed'
|
||||
to: 'open'
|
||||
for: '00:02:30'
|
||||
|
||||
action:
|
||||
- service_template: >
|
||||
{% set hour=states("sensor.time").split(':')[0] | int %}
|
||||
{% if hour >= 7 and hour <= 9 and states.input_boolean.school_mode.state == 'on'%}
|
||||
input_boolean.turn_off
|
||||
{% else %}
|
||||
input_boolean.turn_on
|
||||
{% endif %}
|
||||
entity_id: input_boolean.alert_mode
|
||||
|
||||
- service: script.speech_engine
|
||||
data_template:
|
||||
value1: "The {{ trigger.entity_id.split('.')[1]|replace('_', ' ') }} is now {{ (trigger.to_state.state)|replace('_', ' ') }}."
|
||||
call_garage_check: 1
|
32
config/automation/Speech/home_stats.yaml
Executable file
32
config/automation/Speech/home_stats.yaml
Executable file
@@ -0,0 +1,32 @@
|
||||
######################################################################
|
||||
## Some home facts when we get back home from being away.
|
||||
######################################################################
|
||||
- alias: 'Home Stats'
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- group.family
|
||||
from: 'not_home'
|
||||
to: 'home'
|
||||
for: '00:03:00'
|
||||
|
||||
- platform: state
|
||||
entity_id: input_boolean.home_stats
|
||||
to: 'on'
|
||||
from: 'off'
|
||||
|
||||
action:
|
||||
|
||||
- wait_template: >-
|
||||
{{ is_state('group.garage_doors', 'closed') }}
|
||||
timeout: 00:05:30
|
||||
|
||||
- service: script.speech_engine
|
||||
data:
|
||||
call_inside_weather: 1
|
||||
call_responsibilities: 1
|
||||
call_outside_weather: 1
|
||||
call_garage_check: 1
|
||||
call_window_check: 1
|
||||
call_light_check: 1
|
24
config/automation/Speech/nest.yaml
Executable file
24
config/automation/Speech/nest.yaml
Executable file
@@ -0,0 +1,24 @@
|
||||
######################################################################
|
||||
## Announce when one of the nests kick in
|
||||
## Announce over all Chromecast Audios
|
||||
######################################################################
|
||||
- alias: 'Nest Status'
|
||||
|
||||
trigger:
|
||||
|
||||
- platform: state
|
||||
entity_id:
|
||||
- sensor.downstairs_thermostat_hvac_state
|
||||
- sensor.upstairs_thermostat_hvac_state
|
||||
from: 'off'
|
||||
|
||||
# condition:
|
||||
# - condition: template
|
||||
# value_template: >-
|
||||
# {{ as_timestamp(states.automation.nest_status.attributes.last_triggered) > as_timestamp(now()) - (1800) }}
|
||||
|
||||
action:
|
||||
- service: script.speech_engine
|
||||
data_template:
|
||||
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
|
25
config/automation/Speech/new_device.yaml
Executable file
25
config/automation/Speech/new_device.yaml
Executable file
@@ -0,0 +1,25 @@
|
||||
##############################################################################
|
||||
### New Device has connected to the network. let everyone know.
|
||||
##############################################################################
|
||||
|
||||
- alias: "New device connected"
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: device_tracker_new_device
|
||||
|
||||
action:
|
||||
- wait_template: >-
|
||||
{{ not is_state('media_player.livingroomCC', 'playing') }}
|
||||
|
||||
- service: script.speech_engine
|
||||
data_template:
|
||||
NewDevice: "There has been a new device detected on the network. Be sure to appropriately catagorize {{trigger.event.data.host_name}} within Circle."
|
||||
|
||||
- service: script.tweet_engine
|
||||
data_template:
|
||||
tweet: >
|
||||
{{ [
|
||||
"New Device on the Network! @MeetCircle has alerted me me and now it is locked down.",
|
||||
"Constant monitoring of the network by @MeetCircle has detected a new device in the environment."
|
||||
] | random + " (http://amzn.to/2eAgaA6)"}}
|
||||
##############################################################################
|
15
config/automation/Speech/responsibilities.yaml
Executable file
15
config/automation/Speech/responsibilities.yaml
Executable file
@@ -0,0 +1,15 @@
|
||||
######################################################################
|
||||
## Who's day is it anyway? Pretty sure my parent's didn't code to figure this out.
|
||||
######################################################################
|
||||
- alias: 'responsibilities'
|
||||
|
||||
trigger:
|
||||
|
||||
- platform: state
|
||||
entity_id: input_boolean.responsibilities
|
||||
to: 'on'
|
||||
|
||||
action:
|
||||
- service: script.speech_engine
|
||||
data:
|
||||
call_responsibilities: 1
|
Reference in New Issue
Block a user