You can find the entire repo here.

This commit is contained in:
ccostan
2018-02-28 19:43:00 -05:00
parent ddcf503781
commit 40f8fd2edc
263 changed files with 0 additions and 194 deletions

202
config/script/README.md Executable file
View File

@@ -0,0 +1,202 @@
# [![Build Status](https://travis-ci.org/CCOSTAN/Home-AssistantConfig.svg?branch=master)](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!
All of my Scripts are in this directory. These scripts can be used over and over by different automations. I try to modulize most of my scripts so that they can be passed variables from different automations and still keep all the settings normailized and centralized.
#Still have questions on my Config?
Follow me on twitter : [@CCostan](https://twitter.com/ccostan)
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).
<a target='_blank' rel='nofollow' href='https://app.codesponsor.io/link/3MkgeKFUVKPNW45Vtwu9Abd4/CCOSTAN/Home-AssistantConfig'>
<img alt='Sponsor' width='888' height='68' src='https://app.codesponsor.io/embed/3MkgeKFUVKPNW45Vtwu9Abd4/CCOSTAN/Home-AssistantConfig.svg' />
</a>
Original mapping work by @beed2112
Modified by [@CCOSTAN](https://twitter.com/ccostan)
Repo : https://github.com/beed2112/condo
This is a map of the script references from my repo.
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/amp_settings.yaml
amp_settings
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/System/door_chime.yaml: - service: script.amp_settings
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/dog_bark.yaml
dog_bark
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/customize/scripts.yaml:script.dog_bark:
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/dog_bark.yaml: # service: script.dog_bark
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/front_house_motion.yaml: - service: script.dog_bark
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/guard_dog.yaml: - service: script.dog_bark
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/emergency.yaml
emergency
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/emergency.yaml:# - service: script.emergency
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/nest_protects.yaml: - service: script.emergency
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/Speech/High_Wind_Speed_Check.yaml: - service: script.emergency
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/flash_notify.yaml
flash_notify
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/customize/scripts.yaml:script.flash_notify:
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/skybell_pressed.yaml: - service: script.flash_notify
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/flash_notify.yaml:# - service: script.flash_notify
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/ifttt_calendar.yaml: - service: script.flash_notify
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/front_house_motion.yaml
front_house_motion
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/customize/scripts.yaml:script.front_house_motion:
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/front_house_motion.yaml:# - service: script.front_house_motion
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/skybellhd.yaml: - service: script.front_house_motion
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/interior_off.yaml
interior_off
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/customize/scripts.yaml:script.interior_off:
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/interior_off.yaml:# - service: script.interior_off
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/away.yaml: - service: script.interior_off
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/good_night.yaml: - service: script.interior_off
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/Timed_Triggers/sunrise_turn_off.yaml: - service: script.interior_off
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/monthly_color_scene.yaml
monthly_color_scene
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/customize/scripts.yaml:script.monthly_color_scene:
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/front_house_motion.yaml: - service: script.monthly_color_scene
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/monthly_color_scene.yaml:# - service: script.monthly_color_scene
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/late_night_outside_helper.yaml: - service: script.monthly_color_scene
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/Timed_Triggers/sunset_turn_on.yaml: - service: script.monthly_color_scene
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/notify_engine.yaml
notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/customize/scripts.yaml:script.notify_engine:
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/notify_engine.yaml: # service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/hasspodcast.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/epson_printer.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/network.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/nest_protects.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/nest_protects.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/battery_levels.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/processmonitor.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/processmonitor.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/processmonitor.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/space.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/space.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/fitbit.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/alarm.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/juicenet.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/juicenet.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/garadget.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/garadget.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/Speech/garadget_Wind_Speed_Check.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/Speech/door_opened.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/Speech/High_Wind_Speed_Check.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/medicine_logger.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/System/update_notification.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/System/bad_logins.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/System/ip_change.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/System/Wink_update_notification.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/Timed_Triggers/startup_notification.yaml: - service: script.notify_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/skybell_pressed.yaml
skybell_pressed
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/customize/scripts.yaml:script.skybell_pressed:
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/skybell_pressed.yaml:# - service: script.skybell_pressed
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/skybellhd.yaml: - service: script.skybell_pressed
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/speech_engine.yaml
speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/customize/scripts.yaml:script.speech_engine:
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/speech_engine.yaml: # service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/speech_processing.yaml: # service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/skybell_pressed.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/front_house_motion.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/triggers/sleepy_dog.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/network.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/nest_protects.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/alarm.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/juicenet.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/garadget.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/Speech/new_device.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/Speech/garadget_Wind_Speed_Check.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/Speech/garage_closed.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/Speech/responsibilities.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/Speech/announcements.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/Speech/garage_opened.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/Speech/door_opened.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/Speech/High_Wind_Speed_Check.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/Speech/nest.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/Speech/home_stats.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/good_night.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/dark_rainy_day.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/Timed_Triggers/sunset_turn_on.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/Timed_Triggers/sunset_turn_on.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/Timed_Triggers/2200.yaml: - service: script.speech_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/speech_processing.yaml
speech_processing
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/customize/scripts.yaml:script.speech_processing:
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/speech_engine.yaml: - service: script.speech_processing
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/switch_turn_off_all.yaml
switch_turn_off_all
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/customize/scripts.yaml:script.switch_turn_off_all:
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/interior_off.yaml: - service: script.switch_turn_off_all
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/switch_turn_off_all.yaml:# - service: script.switch_turn_off_all
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/script/tweet.yaml
tweet_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/logger.yaml: - service: script.tweet_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/hasspodcast.yaml: - service: script.tweet_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/epson_printer.yaml: - service: script.tweet_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/skybellhd.yaml: - service: script.tweet_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/neato.yaml: - service: script.tweet_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/pihole.yaml: - service: script.tweet_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/pihole.yaml: - service: script.tweet_engine
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/packages/nest_protects.yaml: - service: script.tweet_engine

46
config/script/amp_settings.yaml Executable file
View File

@@ -0,0 +1,46 @@
######################################################################################################
###Standardize AMP settings.
## @CCOSTAN
## Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
######################################################################################################
amp_settings:
sequence:
- service: media_player.volume_set
data_template:
entity_id: >-
{% if media_player | length == 0 %}
{% set media_player = [
'media_player.livingroomcc',
'media_player.alarm_clock',
'media_player.bedroom_alarm_panel'
] %}
{% endif %}
{% if media_player is not string and media_player is sequence %}
{% set media_player = media_player|join(', ') %}
{% endif %}
{{ media_player }}
volume_level: >-
{% if volume_level is none %}
{% if now().strftime('%H')|int < 12 and now().strftime('%H')|int > 6 %}
0.3
{% elif now().strftime('%H')|int > 12 and now().strftime('%H')|int < 20 %}
0.5
{% else %}
0.3
{% endif %}
{% endif %}
{{volume_level}}
- condition: state
entity_id: switch.living_room_amp
state: 'off'
- condition: state
entity_id: group.bed
state: 'off'
- service: switch.turn_on
data:
entity_id: switch.living_room_amp

51
config/script/dog_bark.yaml Executable file
View File

@@ -0,0 +1,51 @@
######################################################################################################
###Script to send notifications to the ChromeCast Audios during normal hours and only when we are home! Call like this:
# action:
# service: script.dog_bark
# data_template:
# value1: 'Startup: Home Assistant is Up and Running!'
######################################################################################################
dog_bark:
sequence:
- wait_template: >-
{{ not is_state('media_player.livingroomCC', 'playing') }}
timeout: 00:01:30
- condition: template
value_template: >
{% if is_state('media_player.livingroomCC', 'playing') %}
false
{% else %}
true
{% endif %}
- condition: state
entity_id: input_boolean.speech_notifications
state: 'on'
- service: switch.turn_on
entity_id: switch.living_room_amp
- service: media_player.turn_on
entity_id: media_player.livingroomCC
- service: media_player.volume_set
entity_id:
- media_player.livingroomCC
data_template:
volume_level: >
{% if now().strftime("%H")|int < 12 and now().strftime("%H")|int > 6%}
0.45
{% elif now().strftime("%H")|int > 12 and now().strftime("%H")|int < 17%}
0.7
{% else %}
0.40
{% endif %}
- service: media_player.play_media
data_template:
entity_id:
- media_player.livingroomCC
- media_player.entry_alarm_panel
- media_player.bedroom_alarm_panel
media_content_id: "https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/sounds/dog-barking-2-bullmastiff.mp3"
media_content_type: audio/mp4

42
config/script/emergency.yaml Executable file
View File

@@ -0,0 +1,42 @@
######################################################################################################
###Script to turn on Front light FULL bright for 15m when motion is detected and then return to the normal colors.
# action:
# - service: script.emergency
# @CCOSTAN
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
######################################################################################################
emergency:
sequence:
# Switch all outside front lights to Red to indicate emergency
- service: light.turn_on
entity_id:
- group.outdoor_front_lights
data:
color_name: 'red'
# Flash All LIGHTS
- service: light.turn_on
entity_id:
- group.all_lights
data:
flash: long
# Rachio is already inergrated Natively with Protects to run SPRINKLERS with smoke conditions..
# - service: ifttt.trigger
# data_template: {"event":"rachio_start_front"}
# Turn on All LIGHTS 100% Brightness
- service: light.turn_on
entity_id:
- group.all_lights
data:
brightness: 255
# Turn on Outside LED lights strobing White
- service: light.turn_on
entity_id:
- light.led_garage_large
- light.led_garage_small
- light.led_outdoor_den
- light.led_garage_snip
data:
effect: white_strobe

16
config/script/flash_notify.yaml Executable file
View File

@@ -0,0 +1,16 @@
######################################################################################################
###Script to turn on Front light FULL bright for 15m when motion is detected and then return to the normal colors.
# action:
# - service: script.flash_notify
#
######################################################################################################
flash_notify:
sequence:
- service: light.turn_on
entity_id:
- light.m1_slider
- light.office_lamp
- light.outdoor_foyer
data:
flash: long

View File

@@ -0,0 +1,48 @@
######################################################################################################
###[SkyBell HD](http://amzn.to/2dcexIB) Script to turn on Front light FULL bright for 5 to 20m when motion is detected and then return to the normal colors.
# action:
# - service: script.front_house_motion
#
######################################################################################################
front_house_motion:
sequence:
- service: logbook.log
data:
name: "SkyBell HD Doorbell:"
message: "Someone is by the door."
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- service: input_boolean.turn_on
entity_id: input_boolean.alert_mode
- service: script.speech_engine
data:
value1: 'Motion has been detected by the front door.'
- service: scene.turn_on
entity_id: scene.front_full_brightness
- service: switch.turn_on
entity_id:
- switch.back_landscaping
- switch.front_landscaping
- service: light.turn_on
data:
entity_id:
- light.outdoor_bathroom
- group.outdoor_pool_lights
brightness: 255
- service: script.dog_bark
- delay: '00:{{ (range(5, 20)|random|int) }}:00'
- service: light.turn_off
entity_id:
- group.outdoor_front_lights
- group.outdoor_pool_lights
- service: light.turn_on
entity_id: light.outdoor_bathroom
data:
brightness: 15
- delay: '00:00:10'
- service: script.monthly_color_scene

19
config/script/header.md Executable file
View File

@@ -0,0 +1,19 @@
# [![Build Status](https://travis-ci.org/CCOSTAN/Home-AssistantConfig.svg?branch=master)](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!
All of my Scripts are in this directory. These scripts can be used over and over by different automations. I try to modulize most of my scripts so that they can be passed variables from different automations and still keep all the settings normailized and centralized.
#Still have questions on my Config?
Follow me on twitter : [@CCostan](https://twitter.com/ccostan)
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).
Original mapping work by @beed2112
Modified by [@CCOSTAN](https://twitter.com/ccostan)
Repo : https://github.com/beed2112/condo
This is a map of the script references from my repo.

18
config/script/interior_off.yaml Executable file
View File

@@ -0,0 +1,18 @@
######################################################################################################
###Script to shut switches with a 30 second delay to not trample codes
### Sample Call
# action:
# - service: script.interior_off
######################################################################################################
interior_off:
sequence:
- service: homeassistant.turn_off
entity_id:
- group.interior_lights
- service: script.switch_turn_off_all
- service: media_player.turn_off
entity_id:
- group.media_players
- service: ifttt.trigger
data_template: {"event":"noon_off"}

View File

@@ -0,0 +1,94 @@
######################################################################################################
###Script to turn on scene for the appropriate month for the front of the house but only when the sun is down.
# action:
# - service: script.monthly_color_scene
#
# scenes should be named month_[01-12]_colors (month_06_colors)
# Color help - http://www.esbnyc.com/explore/tower-lights/calendar
######################################################################################################
monthly_color_scene:
sequence:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- service: scene.turn_on
data_template:
entity_id: >
scene.month_
{%- if states.sensor.flag.state == "True" -%}
RWB
{%- elif now().strftime("%m%d")|int == 101 -%}
new_years_day
{%- elif now().strftime("%m%d")|int >= 210
and now().strftime("%m%d")|int <= 214-%}
valentine
{%- elif now().strftime("%m%d")|int == 228 -%}
marti_gras
{%- elif now().strftime("%m%d")|int == 314 -%}
pi
{%- elif now().strftime("%m%d")|int >= 315
and now().strftime("%m%d")|int <= 317-%}
st_patty
{%- elif now().strftime("%m%d")|int >= 414
and now().strftime("%m%d")|int <= 416-%}
easter
{%- elif now().strftime("%m%d")|int == 422 -%}
st_patty
{%- elif now().strftime("%m%d")|int == 504 -%}
starwars
{%- elif now().strftime("%m%d")|int == 505 -%}
cinco_de_mayo
{%- elif now().strftime("%m%d")|int == 514 -%}
valentine
{%- elif now().strftime("%m%d")|int == 618 -%}
fathers_day
{%- elif now().strftime("%m%d")|int >= 1001
and now().strftime("%m%d")|int <= 1031-%}
halloween
{%- elif now().strftime("%m%d")|int >= 1123
and now().strftime("%m%d")|int <= 1124-%}
thanksgiving
{%- elif now().strftime("%m%d")|int >= 1125
and now().strftime("%m%d")|int <= 1211-%}
christmas
{%- elif now().strftime("%m%d")|int >= 1212
and now().strftime("%m%d")|int <= 1220-%}
hanukkah
{%- elif now().strftime("%m%d")|int >= 1221
and now().strftime("%m%d")|int <= 1230-%}
christmas
{%- elif now().strftime("%m%d")|int == 1231 -%}
new_years_day
{%- else -%}
standard
{%- endif -%}_colors
# http://www.calendar-365.com/holidays/2017.html
# 101 New_years_day (colorloop)
# RWB 212 Lincoln's Birthday
# 214 Valentine's Day (pink, red)
# RWB 220 President's Day
# 228 Mardi Gras (purple, green, gold )
# 317 st Patty (green)
# 414 Good Friday
# 416 Easter
# 422 Earth Day
# 505 Cinco de Mayo (green, white, red)
# 514 Mother's Day (pink, red) - Same as Valentine
# RWB 520 Armed Forces Day
# RWB 529 Memorial Day
# RWB 614 Flag Day
# 618 Fathers day (Orange, Blue)
# RWB 704 July 4th
# RWB 904 Labor Day
# RWB 911 Patriots day
# RWB 1009 columbus day
# 1005 - 1031 halloween
# RWB 1111 veterans day
# 1123 Thanksgiving
# 1212 Hanukkah start 8 days.
# 1225 Chrismas
# 1231 New years eve

View File

@@ -0,0 +1,37 @@
######################################################################################################
###Script to send notifications to IFTTT to notify me on the mobile Phone! Call like this:
# action:
# service: script.notify_engine
# data_template:
# value1: 'Startup: Home Assistant is Up and Running!'
# value2: ''
# value3: "{{ trigger.to_state.state }}"
# who: "stacey | carlo | paige | family | parents"
# IFTTT Maker channel should look like this: https://files.gitter.im/home-assistant/home-assistant/phkx/blob
######################################################################################################
notify_engine:
sequence:
- condition: or
conditions:
- condition: state
entity_id: input_boolean.text_notifications
state: 'on'
# - service: ifttt.trigger
# data_template: {"event":"notify_engine", "value1":"{{ value1 }}", "value2":"{{ value2 }}", "value3":"{{ value3 }}"}
- service_template: >
{% if who == 'stacey' %}
notify.ios_staceys_iphone
{% elif who == 'carlo' %}
notify.ios_carlo_6s
{% elif who == 'parents' %}
notify.ios_parents
{% else %}
notify.ios_family
{% endif %}
data_template:
message: "{{ value1 }} {{ value2 }} {{ value3 }}"
data:
subtitle: "Home Assistant Notify"

View File

@@ -0,0 +1,27 @@
######################################################################################################
###[SkyBell HD](http://amzn.to/2dcexIB)
# Script to turn on Front light FULL bright for 15m when motion is detected and then return to the normal colors.
# action:
# - service: script.skybell_pressed
#
######################################################################################################
skybell_pressed:
sequence:
- service: logbook.log
data:
name: "SkyBell HD Doorbell:"
message: "Someone Pressed the Doorbell."
- service: script.flash_notify
- service: script.speech_engine
data:
value1: 'Please check the Front Door. Someone Pressed the Doorbell.'
- service: notify.ios_family
data:
message: Someone Pressed the Doorbell!
data:
push:
category: camera
entity_id: camera.stone_door

235
config/script/speech_engine.yaml Executable file
View File

@@ -0,0 +1,235 @@
######################################################################################################
###Script to send notifications to the ChromeCast Audios during normal hours and only when we are home! Call like this:
# action:
# service: script.speech_engine
# data:
# call_no_announcement:
# call_dark_outside:
# call_window_check:
# call_garage_check:
# call_responsibilities
# call_light_check
# call_inside_weather
# call_outside_weather
# # @CCOSTAN
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
######################################################################################################
speech_engine:
sequence:
- condition: or
conditions:
- condition: state
entity_id: group.family
state: 'home'
- condition: state
entity_id: input_boolean.guest_mode
state: 'on'
- service: script.speech_processing
data_template:
media_player: >-
{% if media_player | length == 0 %}
{% set media_player = [
'media_player.livingroomcc',
'media_player.alarm_clock',
'media_player.bedroom_alarm_panel'
] %}
{% endif %}
{% if media_player is not string and media_player is sequence %}
{% set media_player = media_player|join(', ') %}
{% endif %}
{{ media_player }}
speech_message: >-
{%- macro dark_outside() -%}
{{ [
'It is pretty dark outside. I will turn on the outside lights now.',
'It is a little past Sunset. Time to turn on the outside lights. I am on it.',
'I will switch on the outside lights. It is getting dark outside.',
'Time to turn on the front lights. I will take care of it.'
]|random }}
{%- endmacro -%}
{%- macro responsibilities() -%}
{% if now().strftime('%a') == 'Wed' or now().strftime('%a') == 'Sun' %}
Today is {{ now().strftime('%A') }} and {{ now().strftime('%A') }} is garbage day.
{% endif %}
{% if now().strftime('%a') == 'Wed' %}
Both Recycling and regular Garbage goes out. Please take out all of the garbage cans tonight.
{% endif %}
{% if now().strftime('%j')|int % 2 != 0 %}
Today is Justin's day to do the chores.
{% else %}
Today is Paige's day to do the chores.
{% endif %}
{%- endmacro -%}
{%- macro inside_weather() -%}
Inside the house, it is {{ states.climate.downstairs.attributes['current_temperature'] }} degrees with around {{ states('sensor.downstairs_thermostat_humidity') }} percent humidity.
{%- endmacro -%}
{%- macro outside_weather() -%}
Outside, it is going to be {{ states('sensor.dark_sky_minutely_summary') }}
{%- endmacro -%}
{%- macro light_check() -%}
{% if states.group.all_lights.state != 'off' -%}
There are
{% for state in states.light if state.state == 'on' -%}
{%- if loop.last -%}
{{ loop.index }}
{%- endif -%}
{%- endfor %}
lights on right now.
{% set comma = joiner(', ') %}
The
{% for group in states.group|groupby('state') -%}
{%- for entity in group.list if entity.state == 'on' and entity.name.split(' ')[1]|lower == 'lights' and entity.name.split(' ')[0]|lower != 'all' and entity.name.split(' ')[0]|lower != 'interior' -%}
{{ ' and' if loop.last and not loop.first else comma() }}
{{ entity.name }}
{%- endfor -%}
{%- endfor -%}
.
{%- endif -%}
{%- endmacro -%}
{%- macro window_check() -%}
{% if states.group.entry_points.state != 'off' -%}
{% set comma = joiner(', ') %}
The
{% for state in states.binary_sensor if state.state == 'on' and state.attributes.device_class == 'opening' -%}
{%- endfor %}
{% for group in states.binary_sensor|groupby('state') -%}
{%- for entity in group.list if entity.state == 'on' and entity.attributes.device_class == 'opening' -%}
{{ ' and' if loop.last and not loop.first else comma() }}
{{ entity.attributes.friendly_name }}
{%- endfor -%}
{% endfor %}
need to be closed.
{%- endif -%}
{%- endmacro -%}
{%- macro garage_check() -%}
{% if states.group.garage_doors.state !='closed' -%}
The
{%- for state in states.cover -%}
{%- endfor %}
{% for group in states.cover|groupby('state') -%}
{%- for entity in group.list if entity.state == 'open' and entity.attributes.device_class == 'garage' -%}
{{ ' and' if loop.last and not loop.first }}
{{ entity.attributes.friendly_name }}
{%- endfor -%}
{%- endfor %}
need to be closed.
{%- endif -%}
{%- endmacro -%}
{%- macro medicine() -%}
{% if is_state('input_boolean.medicine', 'off') -%}
It looks like Carlo has not taken his medicine yet. Please make sure Carlo takes his medicine now.
{% endif -%}
{%- endmacro -%}
{%- macro iss() -%}
{% if is_state('binary_sensor.iss', 'on') -%}
Here is something interesting. The international space station is above us now. There are {{ states.binary_sensor.iss.attributes['number_of_people_in_space'] }} people in space right now.
{{ outside_weather() }}
{% endif -%}
{%- endmacro -%}
{%- macro moon() -%}
{%- if states.sensor.moon.state == 'Full moon' -%}
Check out the full moon tonight!
{%- endif -%}
{%- endmacro -%}
{%- macro uv() -%}
{% if states.sensor.dark_sky_uv_index.state|int >= 6 and states.sensor.dark_sky_uv_index.state|int <= 7.9 %}
Today's UV index is {{ states.sensor.dark_sky_uv_index.state }}. You should wear sunscreen if going outside.
{% elif states.sensor.dark_sky_uv_index.state|int >= 8 and states.sensor.dark_sky_uv_index.state|int <=10.9 %}
Today's UV index is {{ states.sensor.dark_sky_uv_index.state }}. This is VERY HIGH. Be sure wear sunscreen and re-apply.
{% elif states.sensor.dark_sky_uv_index.state|int >= 11 %}
Today's UV index is {{ states.sensor.dark_sky_uv_index.state }}. This is EXTREME. You should be very cautious going outside.
{% endif %}
{%- endmacro -%}
{%- macro holiday() -%}
{% if states.sensor.holiday.state != '' %}
Today is {{ states.sensor.holiday.state }}.
{% endif %}
{%- endmacro -%}
{# ********************************************* #}
{# ******** Start the Speech routines ******** #}
{# ********************************************* #}
{% if call_no_announcement != 1 %}
{% if now().strftime('%H')|int < 12 and now().strftime('%H')|int > 6 %}
Good morning.
{% elif now().strftime('%H')|int >= 12 and now().strftime('%H')|int < 17 %}
Good afternoon.
{% else %}
Good evening.
{% endif %}
{% endif %}
{# Called from Annoucenments #}
{{ personarriving }}
{# Called from Nest when thermostats turn on #}
{{ NestStatus }}
{% if call_inside_weather == 1 %}
{{ inside_weather() }}
{% endif %}
{% if call_outside_weather == 1 and is_state('sun.sun', 'above_horizon') %}
{{ outside_weather() }}
{% endif %}
{{ DoorOpened }}
{{ DoorClosed }}
{% if call_dark_outside == 1 %}
{{ dark_outside() }}
{% endif %}
{% if call_garage_check == 1 or is_state('sun.sun', 'below_horizon') %}
{{ garage_check() }}
{% endif %}
{% if (call_window_check == 1 or is_state('sun.sun', 'below_horizon')) or is_state('group.entry_points', 'on') %}
{{ window_check() }}
{% endif %}
{{ NewDevice }}
{% if call_light_check == 1 %}
{{ light_check() }}
{% endif %}
{% if call_responsibilities == 1 %}
{{ responsibilities() }}
{% endif %}
{% if now().strftime('%H')|int > 21 %}
{{ medicine() }}
{% endif %}
{% if value1 is not none %}
{{ value1 }}
{% endif %}
{# call a Random fact about the house #}
{{ ([iss, moon, uv, holiday]|random)() }}
- service: input_boolean.turn_off
data:
entity_id:
- input_boolean.home_stats
- input_boolean.responsibilities

View File

@@ -0,0 +1,79 @@
######################################################################################################
###Script to actually send notifications to the ChromeCast Audios during normal hours and only when we are home! Call like this:
# action:
# service: script.speech_engine
# speech_message:
# # @CCOSTAN
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
######################################################################################################
speech_processing:
sequence:
- service: mqtt.publish
data_template:
topic: 'polly/lastmsg'
payload: "This message is from {{ now().strftime('%-I') }}:{{ now().strftime('%M') }} {{ now().strftime('%p') }}. {{ speech_message | truncate(254)}}"
retain: true
- condition: and
conditions:
- condition: or
conditions:
- condition: state
entity_id: group.family
state: 'home'
- condition: state
entity_id: input_boolean.guest_mode
state: 'on'
- condition: or
conditions:
- condition: and
conditions:
- condition: state
entity_id: group.bed
state: 'off'
- condition: time
after: '08:00:00'
before: '20:00:00'
- condition: state
entity_id: input_boolean.alert_mode
state: 'on'
- condition: state
entity_id: input_boolean.speech_notifications
state: 'on'
- service: switch.turn_on
entity_id: switch.living_room_amp
- service: media_player.volume_set
data_template:
entity_id: >
{{ media_player }}
volume_level: >-
{% if now().strftime('%H')|int < 12 and now().strftime('%H')|int > 6 %}
0.3
{% elif now().strftime('%H')|int > 12 and now().strftime('%H')|int < 20 %}
0.5
{% else %}
0.3
{% endif %}
- service: tts.amazon_polly_say
data_template:
entity_id: >
{% if states.group.bed.state == 'off' %}
media_player.livingroomCC
{% else %}
media_player.alarm_clock, media_player.bedroom_alarm_panel
{% endif %}
message: >-
<speak>
{{ speech_message }}
</speak>
cache: true
- service: input_boolean.turn_off
data:
entity_id:
- input_boolean.alert_mode
- input_boolean.lastmsg

View File

@@ -0,0 +1,48 @@
######################################################################################################
###Script to send notifications to the ChromeCast Audios during normal hours and only when we are home! Call like this:
# action:
# service: script.speechcons
# data_template:
# speechcon: 'Bazinga'
# @CCOSTAN
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
######################################################################################################
speechcon:
sequence:
- condition: template
value_template: >
{% if is_state('media_player.livingroomCC', 'playing') %}
false
{% else %}
true
{% endif %}
- condition: state
entity_id: input_boolean.speech_notifications
state: 'on'
- service: switch.turn_on
entity_id: switch.living_room_amp
- service: media_player.turn_on
entity_id: media_player.livingroomCC
- service: media_player.volume_set
entity_id:
- media_player.livingroomCC
data_template:
volume_level: >
{% if now().strftime("%H")|int < 12 and now().strftime("%H")|int > 6%}
0.3
{% elif now().strftime("%H")|int > 12 and now().strftime("%H")|int < 17%}
0.6
{% else %}
0.3
{% endif %}
- service: media_player.play_media
entity_id:
- media_player.LivingRoomCC
data_template:
media_content_id: >
"https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/sounds/speechcons/{{speechcon}}._TTH_.mp3"
media_content_type: audio/mp4

View File

@@ -0,0 +1,13 @@
######################################################################################################
###Script to shut switches with a 30 second delay to not trample codes
### Sample Call
# action:
# - service: script.switch_turn_off_all
######################################################################################################
switch_turn_off_all:
sequence:
- service: switch.turn_off
entity_id: group.interior_switches
- service: switch.turn_off
entity_id: switch.living_room_amp

30
config/script/tweet.yaml Executable file
View File

@@ -0,0 +1,30 @@
######################################################################################################
###Script to send notifications to Twitter as @BearStoneHA.
## Publish on Facebook as well - https://www.facebook.com/BearStoneHA/
## Enhancements by @dale3h
######################################################################################################
tweet_engine:
sequence:
- service: mqtt.publish
data_template:
topic: 'ifttt/message'
payload: >-
{{ tweet }}
retain: true
- service: notify.BearStoneHA
data_template:
message: >-
{{ tweet }} #IOT #SmartHome
# - service: ifttt.trigger
# data_template: {"event":"facebook_tweet", "value1":"{{ tweet }}", "value2":"{{ value2 }}", "value3":"{{ value3 }}"}
#
# - service: ifttt.trigger
# data_template:
# event: >-
# facebook_tweet
# value1: >
# {{states.sensor.ifttt_formatted_message.state}} #IOT #SmartHome