This commit is contained in:
Jeffrey Stone
2019-02-21 12:49:55 -05:00
parent 361375cf5c
commit 46a6f6d271
97 changed files with 3443 additions and 1936 deletions

119
packages/announcements.yaml Normal file
View File

@@ -0,0 +1,119 @@
###############################################################################
# @author : Jeffrey Stone
# @date : 02/19/2019
# @package : Announcements
# @description : Just Normal Announcements.
###############################################################################
script:
annc_storm_statement:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: input_boolean.vacation_mode
state: 'off'
- service: notify.ios_all
data:
message: Severe Storm Statement Issued for Anchorage House
annc_tstorm_watch:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: input_boolean.vacation_mode
state: 'off'
- service: notify.ios_all
data:
message: Severe Thunderstorm Watch Issued for Anchorage House
annc_tstorm_warning:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: input_boolean.vacation_mode
state: 'off'
- service: notify.ios_all
data:
message: Severe Thunderstorm Warning Issued for Anchorage House
annc_tornado_watch:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: input_boolean.vacation_mode
state: 'off'
- service: notify.ios_all
data:
message: Tornado Watch Issued for Anchorage House
annc_security_issue:
sequence:
- condition: state
entity_id: group.family
state: 'on'
- service: tts.google_say
data:
entity_id: media_player.hass_speaker
message: Unauthorized Access
annc_tornado_warning:
sequence:
- condition: state
entity_id: sensor.family_status
state: Home
- service: script.alert_notify
data_template:
message: "Tornado Warning has been Issued"
greeting: "no"
automation:
- id: prebed_routine
alias: Prebed Routine
trigger:
- platform: time
at: '19:00:00'
action:
- service: script.prebed_routine
- id: nightly_report
alias: Nightly Report
trigger:
- platform: time
at: '18:45:00'
action:
- service: script.nightly_report
- id: good_morning_report
alias: Good Morning Report
initial_state: true
trigger:
- platform: time
at: 07:45:00
action:
- service: script.morning_report
- service: script.twitter_notify
data:
message: 'I just provided a morning briefing including weather, and traffic
conditions to the residents of Anchorage House. '
- id: skylar_morning_greeting
alias: Skylar Morning Greeting
initial_state: true
trigger:
- platform: time
at: 07:58:00
condition:
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
- condition: state
entity_id: input_boolean.skylar_dressed_alarm
state: 'on'
action:
- service: script.skylar_morning_greeting

560
packages/disney.yaml Normal file
View File

@@ -0,0 +1,560 @@
###############################################################################
# @author : Jeffrey Stone
# @date : 02/19/2019
# @package : Disney
# @description : A little Imaginering to bring disney into our home.
###############################################################################
input_boolean:
happy_ever_after_show:
name: Happy Ever After Show
haunted_mansion:
name: Haunted Mansion
boo_to_you_show:
name: Boo To You
holiday_wishes:
name: Holiday Wishes
spaceship_earth_ride:
name: Spaceship Earth
boo_to_you:
name: Boo To You
happy_ever_after:
name: Happy Ever After
mk_loop:
name: MK Loop
tiki_room_audio:
name: Tiki Room
illuminations:
name: Illuminations
automation:
- id: mk_loop_on
alias: MK Loop On
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.mk_loop
to: 'on'
action:
- service: script.turn_on
entity_id: script.mk_loop
- id: tiki_room_on
alias: Tiki Room On
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.tiki_room_audio
to: 'on'
action:
- service: script.turn_on
entity_id: script.tiki_room_audio
- id: tiki_room_off
alias: Tiki Room Off
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.tiki_room_audio
to: 'off'
action:
- service: script.turn_off
entity_id: script.tiki_room_audio
- service: script.turn_on
entity_id: script.kill_this_ride
- id: illuminations_on
alias: Illuminations On
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.illuminations
to: 'on'
action:
- service: script.turn_on
entity_id: script.illuminations_audio
- id: illuminations_off
alias: Illuminations Off
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.illuminations
to: 'off'
action:
- service: script.turn_off
entity_id: script.illuminations_audio
- service: script.turn_on
entity_id: script.kill_this_ride
- id: mk_loop_off
alias: MK Loop Off
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.mk_loop
to: 'off'
action:
- service: script.turn_on
entity_id: script.kill_this_ride
- id: happy_ever_after_show_on
alias: Happy Ever After Show On
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.happy_ever_after_show
to: 'on'
action:
- service: script.turn_on
entity_id: script.happy_ever_after_show
- id: happy_ever_after_show_off
alias: Happy Ever After Show Off
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.happy_ever_after_show
to: 'off'
action:
- service: script.turn_on
entity_id: script.kill_this_ride
- id: happy_ever_after_on
alias: Happy Ever After On
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.happy_ever_after
to: 'on'
action:
- service: script.turn_on
entity_id: script.happy_ever_after
- id: happy_ever_after_on
alias: Happy Ever After Off
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.happy_ever_after
to: 'off'
action:
- service: script.turn_on
entity_id: script.kill_this_ride
- id: haunted_mansion_on
alias: Haunted Mansion On
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.haunted_mansion
to: 'on'
action:
- service: script.turn_on
entity_id: script.haunted_mansion_start
- id: haunted_mansion_off
alias: Haunted Mansion Off
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.haunted_mansion
to: 'off'
action:
- service: script.turn_on
entity_id: script.kill_this_ride
- id: spaceship_earth_on
alias: Spaceship Earth On
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.spaceship_earth_ride
to: 'on'
action:
- service: script.turn_on
entity_id: script.spaceship_earth_ride
- id: spaceship_earth_off
alias: Spaceship Earth Off
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.spaceship_earth_ride
to: 'off'
action:
- service: script.turn_on
entity_id: script.kill_this_ride
- id: boo_to_you_show_on
alias: Boo To You Show On
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.boo_to_you_show
to: 'on'
action:
- service: script.turn_on
entity_id: script.boo_to_you_show
- id: boo_to_you_show_off
alias: Boo To You Show Off
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.boo_to_you_show
to: 'off'
action:
- service: script.turn_on
entity_id: script.kill_this_ride
- id: boo_to_you_on
alias: Boo To You On
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.boo_to_you
to: 'on'
action:
- service: script.turn_on
entity_id: script.boo_to_you
- id: boo_to_you_off
alias: Boo To You Off
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.boo_to_you
to: 'off'
action:
- service: script.turn_on
entity_id: script.kill_this_ride
- id: holiday_wisher_on
alias: Holiday Wishes On
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.holiday_wishes
to: 'on'
action:
- service: script.turn_on
entity_id: script.holiday_wishes_start
- id: holiday_wishes_off
alias: Holiday Wishes Off
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.holiday_wishes
to: 'off'
action:
- service: script.turn_on
entity_id: script.kill_this_ride
script:
kill_hurry_back:
sequence:
- service: shell_command.alarm_off
hurry_back_short:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: sensor.family_status
state: Home
- service: shell_command.haunted_mansion_hurry_back_short
hurry_back_full:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: sensor.family_status
state: Home
- service: shell_command.haunted_mansion_hurry_back_full
haunted_lights_on:
sequence:
- delay: 00:02:16
- service: scene.turn_on
data:
entity_id: scene.haunted_preshow
house_lights_on:
sequence:
- delay: 00:04:12
- service: scene.turn_on
data:
entity_id: scene.normal_livingroom_lighting
haunted_lights_out:
sequence:
- delay: 00:02:05
- service: scene.turn_on
data:
entity_id: scene.haunted_lights_out
haunted_preshow:
sequence:
- delay: 00:01:05
- service: scene.turn_on
data:
entity_id: scene.haunted_preshow
haunted_mansion_start:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: sensor.family_status
state: Home
- service: shell_command.haunted_mansion_preshow_full
- data:
entity_id: script.haunted_preshow
service: script.turn_on
- data:
entity_id: script.haunted_lights_out
service: script.turn_on
- data:
entity_id: script.haunted_lights_on
service: script.turn_on
- data:
entity_id: script.house_lights_on
service: script.turn_on
kill_haunted_mansion:
sequence:
- service: shell_command.alarm_off
- service: script.turn_off
data:
entity_id: script.haunted_preshow
- service: script.turn_off
data:
entity_id: script.haunted_lights_out
- service: script.turn_off
data:
entity_id: script.haunted_lights_on
- service: scene.turn_on
data:
entity_id: scene.normal_livingroom_lighting
haunted_ride:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: sensor.family_status
state: Home
- service: shell_command.haunted_mansion_ride
mk_loop:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: sensor.family_status
state: Home
- service: shell_command.mk_audio
kill_this_ride:
sequence:
- service: shell_command.alarm_off
- service: script.turn_off
data:
entity_id: script.haunted_preshow
- service: script.turn_off
data:
entity_id: script.haunted_lights_out
- service: script.turn_off
data:
entity_id: script.haunted_lights_on
- service: script.turn_off
data:
entity_id: script.illuminations_preshow
- service: script.turn_off
data:
entity_id: script.illuminations_lights_out
- service: scene.turn_on
data:
entity_id: scene.normal_livingroom_lighting
- service: input_boolean.turn_off
entity_id: input_boolean.illuminations
- service: script.chromecast_media_stop
- service: script.turn_off
data:
entity_id: script.holiday_wishes
- service: script.turn_off
data:
entity_id: script.holiday_wishes_start
- service: script.turn_off
entity_id: script.illuminations_preshow
- service: script.turn_off
entity_id: script.illuminations_lights_out
- service: script.turn_off
entity_id: script.illuminations_single_light
- service: script.turn_off
entity_id: script.illuminations_dual_light
- service: script.turn_off
entity_id: script.illuminations_triple_light
- service: script.turn_off
entity_id: script.illuminations_show
move_it_shake_it:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: sensor.family_status
state: Home
- service: shell_command.dance_it
spaceship_earth_ride:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: sensor.family_status
state: Home
- service: shell_command.spaceship_earth_ride
welcome_to_magic_kingdom:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: sensor.family_status
state: Home
- service: shell_command.welcome_to_mk
monorail_waiting:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: sensor.family_status
state: Home
- service: shell_command.monorail_waiting
monorail_mk:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: sensor.family_status
state: Home
- service: shell_command.monorail_mk
monorail_resort:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: group.family
state: 'on'
- service: shell_command.monorail_resort
welcome_show_audio:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: sensor.family_status
state: Home
- service: shell_command.welcome_show_crowd
holiday_wishes_start:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: group.family
state: 'on'
- service: shell_command.wishes_preshow
- service: script.holiday_wishes
holiday_wishes:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: sensor.family_status
state: Home
- service: shell_command.holiday_wishes
boo_to_you_show:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: group.family
state: 'on'
- service: shell_command.boo_to_you
happy_ever_after_show:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: sensor.family_status
state: Home
- service: shell_command.happily_ever_after
boo_to_you:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: sensor.family_status
state: Home
- service: shell_command.boo_to_you
tiki_room_audio:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: sensor.family_status
state: Home
- service: shell_command.tiki_room_audio
happy_ever_after:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: sensor.family_status
state: Home
- service: shell_command.happily_ever_after
illuminations_lights_out:
sequence:
- delay: 00:00:47
- service: scene.turn_on
data:
entity_id: scene.haunted_lights_out
illuminations_single_light:
sequence:
- delay: 00:00:52
- service: scene.turn_on
data:
entity_id: scene.dimished_livingroom_lighting
illuminations_dual_light:
sequence:
- delay: 00:00:59
- service: scene.turn_on
data:
entity_id: scene.illuminations_livingroom_lighting_two
illuminations_triple_light:
sequence:
- delay: 00:01:04
- service: scene.turn_on
data:
entity_id: scene.illuminations_livingroom_lighting_three
illuminations_show:
sequence:
- delay: 00:01:10
- service: scene.turn_on
data:
entity_id: scene.normal_livingroom_lighting
illuminations_preshow:
sequence:
- service: scene.turn_on
data:
entity_id: scene.normal_livingroom_lighting
illuminations_audio:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- condition: state
entity_id: sensor.family_status
state: Home
- service: shell_command.illuminations_audio
- service: script.turn_on
entity_id: script.illuminations_preshow
- service: script.turn_on
entity_id: script.illuminations_lights_out
- service: script.turn_on
entity_id: script.illuminations_single_light
- service: script.turn_on
entity_id: script.illuminations_dual_light
- service: script.turn_on
entity_id: script.illuminations_triple_light
- service: script.turn_on
entity_id: script.illuminations_show

213
packages/notify.yaml Normal file
View File

@@ -0,0 +1,213 @@
###############################################################################
# @author : Jeffrey Stone
# @date : 02/19/2019
# @package : Notify
# @description : A Collection of Notification Scripts and Configs.
# Package modified from https://github.com/skalavala/smarthome/blob/master/packages/notify.yaml
###############################################################################
#homeassistant:
#ifttt:
# key: !secret IFTTT_API_KEY
tts:
- platform: google
cache: true
cache_dir: /tmp/tts
time_memory: 300
notify:
- platform: ios
- name: all_ios
platform: group
services:
- service: ios_jeffreystonesiphone
- service: ios_jeffreystonesipad
- service: ios_katherinestonesiphone
- name: jeff_ios
platform: group
services:
- service: ios_jeffreystonesiphone
- service: ios_jeffreystonesipad
- name: 'Master Bedroom Echo'
platform: command_line
command: "/home/homeassistant/bin/alexa_wrapper -d 'Master Bedroom'"
- name: 'Living Room Echo'
platform: command_line
command: "/home/homeassistant/bin/alexa_wrapper -d 'Living Room'"
- name: 'Kitchen Echo'
platform: command_line
command: "/home/homeassistant/bin/alexa_wrapper -d 'Kitchen'"
- name: 'All Echo'
platform: command_line
command: "/home/homeassistant/bin/alexa_wrapper -d 'All'"
- name: twitter
platform: twitter
consumer_key: !secret twitter_consumer_key
consumer_secret: !secret twitter_consumer_secret
access_token: !secret twitter_access_token
access_token_secret: !secret twitter_access_secret
script:
###############################################################################
# Txt Notify
# Conditions:
# => Only Announce when people are home.
# => Only Announce when Audible Notifications are on
###############################################################################
text_notify_all:
sequence:
- service: notify.all_ios
data_template:
message: >
{{ message }}
text_notify_jeff:
sequence:
- condition: state
entity_id: input_boolean.text_notify_jeff
state: 'on'
- service: notify.jeff_ios
data_template:
message: >
{{ message }}
text_notify_kat:
sequence:
- condition: state
entity_id: input_boolean.text_notify_kat
state: 'on'
- service: notify.kat_ios
data_template:
message: >
{{ message }}
###############################################################################
# Alert Notify
# Conditions:
# => Vacation mode should be off
# Services:
# => Audible
# => iOS
###############################################################################
alert_notify:
sequence:
- condition: state
entity_id: input_boolean.vacation_mode
state: 'off'
- service: tts.google_say
data_template:
entity_id: media_player.hass_speaker
message: >
{{ message }}
###############################################################################
# Voice Notify
# Conditions:
# => Only Announce when people are home.
# => Only Announce when Audible Notifications are on
###############################################################################
voice_notify:
sequence:
- condition: template
value_template: '{{ states.input_boolean.audible_notifications.state == "on" }}'
- condition: state
entity_id: sensor.family_status
state: 'Home'
- condition: state
entity_id: input_boolean.vacation_mode
state: 'off'
- service: tts.google_say
data_template:
entity_id: media_player.hass_speaker
message: >
{% set msg = "" %}
{% macro getGreeting() %}
{% if greeting | default('yes', true ) == "yes" %}
{% if now().hour|int < 12 %}
Good morning.
{% elif now().hour|int < 18 %}
Good afternoon.
{% else %}
Good evening.
{% endif %}
{% endif %}
{% endmacro %}
{% set msg = msg + getGreeting() %}
{% set msg = msg + " " + message %}
{{ msg }}
###############################################################################
# Twitter
###############################################################################
twitter_notify:
sequence:
- service: notify.twitter
data_template:
message: >
{% set msg = "" %}
{% set msg = msg + " " + message %}
{% set msg = msg + " #homeassistant #iot #itscomingfrominsidethehouse" %}
{{ msg }}
twitter_snark:
sequence:
- service: notify.twitter
data_template:
message: !include ../templates/twitter_snark.yaml
twitter_github:
sequence:
- service: notify.twitter
data_template:
message: >
{% set msg = "" %}
{% set msg = msg + " " + message %}
{% set msg = msg + " #smarthome #iot " %}
{{ msg }}
twitter_new_ha:
sequence:
- service: notify.twitter
data_template:
message: !include ../templates/twitter_new_ha.yaml
###############################################################################
# Morning Report
###############################################################################
morning_report:
sequence:
- service: script.voice_notify
data_template:
message: !include ../templates/morning_report.yaml
###############################################################################
# Skylar Get Dressed
###############################################################################
skylar_morning_greeting:
sequence:
- service: script.voice_notify
data_template:
message: !include ../templates/skylar_morning.yaml
###############################################################################
# Nightly Report
###############################################################################
nightly_report:
sequence:
- service: script.voice_notify
data_template:
message: !include ../templates/nightly_report.yaml
###############################################################################
# Prebed Routing
###############################################################################
prebed_routine:
sequence:
- service: script.voice_notify
data_template:
message: >
Bed time is in 30 mins. If you are taking a bath now is the time to get in the tub, otherwise time to put on pajamas and brush teeth.

89
packages/space.yaml Normal file
View File

@@ -0,0 +1,89 @@
###############################################################################
# @author : Jeffrey Stone
# @date : 02/19/2019
# @package : Space
# @description : Tracking space. Inspiration and code taking from https://github.com/CCOSTAN/Home-AssistantConfig#logo
# @original : https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/config/packages/space.yaml
###############################################################################
homeassistant:
customize:
binary_sensor.iss:
icon: mdi:satellite-variant
friendly_name: ISS Visibility
hidden: False
homebridge_hidden: true
sensor.launch_window:
hidden: False
icon: mdi:rocket
friendly_name: Rocket Launch Window
binary_sensor:
- platform: iss
show_on_map: true
sensor:
- platform: moon
- platform: launch_library
- platform: rest
scan_interval: 1800
resource: https://launchlibrary.net/1.2.2/launch/next/10
# resource: https://raw.githubusercontent.com/cribbstechnologies/ha_config/master/www/test_launch.json
name: launch window
# if the current timestamp is in the launch window
# this sensor will return the UTC timestamp of the launch
value_template: >-
{%- for launch in value_json.launches %}
{% if launch.location.id == 16 or launch.location.id == 17 %}
{% if strptime(launch.isostart, '%Y%m%dT%H%M%SZ').strftime('%Y-%m-%d') == now().strftime('%Y-%m-%d') %}
{% set utc_offset_string = now().strftime('%z') %}
{% set utc_offset_direction = utc_offset_string[:1] %}
{% set utc_offset_hours = now().strftime('%z')[-4:] %}
{% set utc_offset_seconds = (utc_offset_hours| int /100) * 60 * 60 %}
{% if utc_offset_direction == '-' %}
{{ launch.wsstamp - utc_offset_seconds}}
{% else %}
{{ launch.wsstamp + utc_offset_seconds}}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
automation:
- id: iss_tweet
alias: 'ISS Tweet'
trigger:
- platform: state
entity_id:
- binary_sensor.iss
to: 'on'
from: 'off'
action:
- service: script.twitter_notify
data_template:
message: >-
{{ [
"The #ISS is passing over. Wave.",
"The #ISS just flew by and there is 1 Starman driving a #Tesla and {{states.binary_sensor.iss.attributes.number_of_people_in_space}} people in",
"The #ISS just flew by and there are {{states.binary_sensor.iss.attributes.number_of_people_in_space}} people in"
] | random + " #Space #theycanseeourhouse"}}
- id: full_moon_tweet
alias: 'Full Moon -Tweet'
trigger:
- platform: state
entity_id: sensor.moon
to: 'Full Moon'
action:
- delay: '0{{ (range(1, 5)|random|int) }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:00'
- service: script.twitter_notify
data_template:
message: >-
{{ [
"There is a Full Moon out tonight, and this time it's the actual moon and not the neighbor.",
"Hey look kids, There's the full moon.",
"The moon is huge! And full."
] | random + "#Space #fullmoon"}}

65
packages/sysmon.yaml Normal file
View File

@@ -0,0 +1,65 @@
###############################################################################
# @author : Jeffrey Stone
# @date : 02/19/2019
# @package : Sysmon
# @description : A collection of Home Assistant and Pi Sensors
###############################################################################
sensor:
- platform: systemmonitor
resources:
- type: disk_use_percent
arg: /
- type: memory_use_percent
- type: network_in
arg: eth0
- type: network_out
arg: eth0
- type: last_boot
- type: load_15m
- type: processor_use
- type: last_boot
- platform: cpuspeed
name: CPU
- platform: time_date
display_options:
- 'time'
- 'date'
- 'date_time'
- 'time_date'
- 'time_utc'
- 'beat'
- platform: cert_expiry
host: !secret ahsl_base_url
name: SSL Cert Expiration
- platform: command_line
name: "HA Uptime"
command: echo "$(($(date +%s) - $(date -d "$(head -n1 /home/homeassistant/.homeassistant/home-assistant.log | cut -d' ' -f-2)" +%s)))"
scan_interval: 720
value_template: >-
{% set uptime = value | int %}
{% set seconds = uptime % 60 %}
{% set minutes = ((uptime % 3600) / 60) | int %}
{% set hours = ((uptime % 86400) / 3600) | int %}
{% set days = (uptime / 86400) | int %}
{%- if days > 0 -%}
{%- if days == 1 -%}
1 day
{%- else -%}
{{ days }} days
{%- endif -%}
{{ ', ' }}
{%- endif -%}
{{ '%02d' % hours }}:{{ '%02d' % minutes }}
- platform: command_line
command: python3 -c "import requests; print(requests.get('https://pypi.python.org/pypi/homeassistant/json').json()['info']['version'])"
name: Current HA Version
- platform: command_line
name: Installed version
command: "head -5 /home/homeassistant/.homeassistant/.HA_VERSION"
- platform: command_line
name: ha_v2db
command: "ls -sh /home/homeassistant/.homeassistant/home-assistant_v2.db | cut -f1 -d ' '"
- platform: command_line
name: ha_log
command: "ls -sh /home/homeassistant/.homeassistant/home-assistant.log | cut -f1 -d ' '"

113
packages/usps.yaml Normal file
View File

@@ -0,0 +1,113 @@
###############################################################################
# @author : Jeffrey Stone
# @date : 02/19/2019
# @package : USPS
# @description : Notifies us of mails and packages.
# Package modified from https://github.com/skalavala/smarthome/blob/master/packages/usps.yaml
###############################################################################
homeassistant:
customize:
sensor.usps_mail:
friendly_name: USPS Mail
icon: mdi:mailbox
sensor.usps_packages:
friendly_name: USPS Packages
icon: mdi:package-variant
sensor:
- platform: mqtt
name: 'USPS Mail'
state_topic: 'house/usps/mails'
value_template: "{{ value }}"
- platform: mqtt
name: USPS Packages
state_topic: 'house/usps/packages'
value_template: "{{ value }}"
camera:
- platform: generic
name: USPS Mail Pictures
still_image_url: !secret usps_camera_url
automation:
- id: reset_usps
alias: Reset USPS
trigger:
- platform: time
at: '00:00:10'
action:
- service: shell_command.usps
- service: script.add_logbook_entry
data_template:
name: USPS
message: Reset Mail Count
- id: get_usps
alias: Get USPS
trigger:
- platform: time
at: '10:00:00'
action:
- service: shell_command.usps
- service: script.add_logbook_entry
data_template:
name: USPS
message: Checking for mail
# Notify USPS mails via TTS, and iOS notification with attachment
###############################################################################
- id: notify_usps_mail
alias: Notify USPS Mail
initial_state: true
trigger:
- platform: state
entity_id: sensor.usps_mail
condition:
- condition: template
value_template: '{{ states.sensor.usps_mail.state | int > 0 }}'
- condition: template
value_template: '{{ ((now().hour | int) > 7) and ((now().hour | int) < 16) }}'
action:
- service: script.voice_notify
data_template:
message: >
{%- if states.sensor.usps_mail.state | int == 1 -%}
Attention: USPS is delivering {{ states.sensor.usps_mail.state }} piece of mail today.
{%- else -%}
Attention: USPS is delivering {{ states.sensor.usps_mail.state }} pieces of mail today.
{%- endif -%}
- service: notify.jeff_ios
data_template:
message: "USPS will be delivering {{ states.sensor.usps_mail.state }} piece(s) of mail today."
data:
push:
category: camera
entity_id: "camera.usps_mail_pictures"
attachment:
url: "{{ states.camera.usps_mail_pictures.attributes.entity_picture }}"
content-type: jpg
# Notify USPS packages via TTS. Usually there are no pictures for packages
###############################################################################
- id: notify_usps_packages
alias: Notify USPS Packages
initial_state: true
trigger:
- platform: state
entity_id: sensor.usps_packages
condition:
- condition: template
value_template: '{{ states.sensor.usps_packages.state | int > 0 }}'
- condition: template
value_template: '{{ ((now().hour | int) > 7) and ((now().hour | int) < 16) }}'
action:
- service: script.voice_notify
data_template:
message: >
{%- if states.sensor.usps_packages.state | int == 1 -%}
Attention: USPS is delivering {{ states.sensor.usps_packages.state }} package today.
{%- else -%}
Attention: USPS is delivering {{ states.sensor.usps_packages.state }} packages today.
{%- endif -%}

View File

@@ -0,0 +1,200 @@
###############################################################################
# @author : Jeffrey Stone
# @date : 02/19/2019
# @package : NWS Alerts
# @description : NWS Alerts
# @original : https://github.com/Vasiley/Home-Assistant-Main/blob/master/packages/weather_alerts_nws.yaml
###############################################################################
homeassistant:
customize:
package.node_anchors:
customize: &customize
package: 'weather_alerts'
sensor.nws_alert_count:
friendly_name: Alerts
icon: mdi:alert-outline
group:
alerts_card:
name: Alerts
entities:
- sensor.nws_alerts
### You first need to find either your NWS Zone ID or County ID. Im not sure which is better but I used my Zone ID here.
### You can find your Zone ID by going to https://alerts.weather.gov/ 7, scroll down to your state and click on the “zone list” then look for the entry for your county.
### I recommond useing both
#Ive taken much of the underlying work here and created a custom component for nws alerts sensor.
#The sensor can be created by adding the nws_alerts.py file to <config_directory>/custom_components/sensor/ and adding the following to your sensor definitions:
sensor:
- platform: nws_alerts
zone_id: 'GAZ034'
automation:
- alias: 'NWS Weather Alert Pop Up Control'
initial_state: 'on'
trigger:
platform: state
entity_id: sensor.nws_alerts
condition:
- condition: template
value_template: '{{states.sensor.nws_alerts.state | int > 0}}'
- condition: template
value_template: '{{ trigger.to_state.state|float > trigger.from_state.state|float }}'
action:
service: script.nws_popup_on_wx_alert
data_template:
title: >
{% if states.sensor.nws_alerts.attributes.title.split(' - ')[5] is defined %}
"{{ states.sensor.nws_alerts.attributes.title.split(' - ')[5] }}"
{% elif states.sensor.nws_alerts.attributes.title.split(' - ')[4] is defined %}
"{{ states.sensor.nws_alerts.attributes.title.split(' - ')[4] }}"
{% elif states.sensor.nws_alerts.attributes.title.split(' - ')[3] is defined %}
"{{ states.sensor.nws_alerts.attributes.title.split(' - ')[3] }}"
{% elif states.sensor.nws_alerts.attributes.title.split(' - ')[2] is defined %}
"{{ states.sensor.nws_alerts.attributes.title.split(' - ')[2] }}"
{% elif states.sensor.nws_alerts.attributes.title.split(' - ')[1] is defined %}
"{{ states.sensor.nws_alerts.attributes.title.split(' - ')[1] }}"
{% else %}
"{{ states.sensor.nws_alerts.attributes.title.split(' - ')[0] }}"
{% endif %}
message: >
{% if states.sensor.nws_alerts.attributes.display_desc.split('\n\n-\n\n')[5] is defined %}
"{{ states.sensor.nws_alerts.attributes.display_desc.split('\n\n-\n\n')[5] }}"
{% elif states.sensor.nws_alerts.attributes.display_desc.split('\n\n-\n\n')[4] is defined %}
"{{ states.sensor.nws_alerts.attributes.display_desc.split('\n\n-\n\n')[4] }}"
{% elif states.sensor.nws_alerts.attributes.display_desc.split('\n\n-\n\n')[3] is defined %}
"{{ states.sensor.nws_alerts.attributes.display_desc.split('\n\n-\n\n')[3] }}"
{% elif states.sensor.nws_alerts.attributes.display_desc.split('\n\n-\n\n')[2] is defined %}
"{{ states.sensor.nws_alerts.attributes.display_desc.split('\n\n-\n\n')[2] }}"
{% elif states.sensor.nws_alerts.attributes.display_desc.split('\n\n-\n\n')[1] is defined %}
"{{ states.sensor.nws_alerts.attributes.display_desc.split('\n\n-\n\n')[1] }}"
{% else %}
"{{ states.sensor.nws_alerts.attributes.display_desc.split('\n\n-\n\n')[0] }}"
{% endif %}
- alias: NWS Notification Weather Alert
initial_state: 'on'
trigger:
platform: state
entity_id: sensor.nws_alerts
condition:
- condition: template
value_template: '{{states.sensor.nws_alerts.state | int > 0}}'
- condition: template
value_template: '{{ trigger.to_state.state|float > trigger.from_state.state|float }}'
action:
- service: notify.all_ios
data_template:
message: >
{% if states.sensor.nws_alerts.attributes.title.split(' - ')[5] is defined %}
"NWS: {{ states.sensor.nws_alerts.attributes.title.split(' - ')[5] }}"
{% elif states.sensor.nws_alerts.attributes.title.split(' - ')[4] is defined %}
"NWS: {{ states.sensor.nws_alerts.attributes.title.split(' - ')[4] }}"
{% elif states.sensor.nws_alerts.attributes.title.split(' - ')[3] is defined %}
"NWS: {{ states.sensor.nws_alerts.attributes.title.split(' - ')[3] }}"
{% elif states.sensor.nws_alerts.attributes.title.split(' - ')[2] is defined %}
"NWS: {{ states.sensor.nws_alerts.attributes.title.split(' - ')[2] }}"
{% elif states.sensor.nws_alerts.attributes.title.split(' - ')[1] is defined %}
"NWS: {{ states.sensor.nws_alerts.attributes.title.split(' - ')[1] }}"
{% else %}
"NWS: {{ states.sensor.nws_alerts.attributes.title.split(' - ')[0] }}"
{% endif %}
- alias: NWS Announce Weather Alert
initial_state: 'on'
trigger:
- platform: state
entity_id: sensor.nws_alerts
condition:
condition: and
conditions:
- condition: template
value_template: "{{states.sensor.nws_alerts.state | int > 0}}"
- condition: template
value_template: '{{ trigger.to_state.state|float > trigger.from_state.state|float }}'
- condition: template
value_template: "{{ (('Severe' in states.sensor.nws_alerts.attributes.title) or ('Thunderstorm' in states.sensor.nws_alerts.attributes.title) or ('Flood' in states.sensor.nws_alerts.attributes.title)) and 'Warning' in states.sensor.nws_alerts.attributes.title }}"
action:
- service: script.voice_notify
data_template:
message: >
{% if states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] is defined %}
The National Weather Service Has issued a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] }}
{% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[4] is defined %}
The National Weather Service Has issued a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[4] }}
{% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[3] is defined %}
The National Weather Service Has issued a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[3] }}
{% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[2] is defined %}
The National Weather Service Has issued a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[2] }}
{% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[1] is defined %}
The National Weather Service Has issued a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[1] }}
{% else %}
The National Weather Service Has issued a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[0] }}
{% endif %}
- delay: '00:00:15'
- service: script.voice_notify
data_template:
message: >
{% if states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] is defined %}
The National Weather Service Has issued a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] }}
{% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[4] is defined %}
The National Weather Service Has issued a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[4] }}
{% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[3] is defined %}
The National Weather Service Has issued a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[3] }}
{% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[2] is defined %}
The National Weather Service Has issued a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[2] }}
{% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[1] is defined %}
The National Weather Service Has issued a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[1] }}
{% else %}
The National Weather Service Has issued a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[0] }}
{% endif %}
- alias: NWS Announce Weather Alert for Tornado
initial_state: 'on'
trigger:
- platform: state
entity_id: sensor.nws_alerts
condition:
condition: and
conditions:
- condition: template
value_template: "{{states.sensor.nws_alerts.state | int > 0}}"
- condition: template
value_template: "{{ 'Tornado' in states.sensor.nws_alerts.attributes.title and 'Warning' in states.sensor.nws_alerts.attributes.title }}"
action:
- service: script.alert_notify
data_template:
message: "Attention!,,,Attention!,,,The National Weather Service Has issued a Tornado Warning for our area."
- delay: '00:00:15'
- service: script.alert_notify
data_template:
message: "Attention!,,,Attention!,,,The National Weather Service Has issued a Tornado Warning for our area."
- delay: '00:00:15'
- service: input_boolean.turn_on
entity_id: input_boolean.tornado_alarm
- service: script.text_notify_all
data_template:
message: "Attention!,,,Attention!,,,The National Weather Service Has issued a Tornado Warning for our area."
script:
nws_popup_on_wx_alert:
alias: NWS Weather Alert Pop Up
sequence:
## Dismiss any current alert so the UI isn't filled
## up with these if there are more then one.
## Only show the latest alert
- service: persistent_notification.dismiss
data:
notification_id: "nwswxalert"
## Create a new persistant notification in the UI for a new alert
- service_template: >
{% if states.sensor.nws_alerts.state != '0' %}
persistent_notification.create
{% endif %}
data_template:
notification_id: "nwswxalert"
message: "{{ message }}"
title: '{{ title }}'

162
packages/weekday.yaml Normal file
View File

@@ -0,0 +1,162 @@
###############################################################################
# @author : Jeffrey Stone
# @date : 02/19/2019
# @package : Weekday
# @description : Weekday Sensor for use as a condition in automations and scripts
###############################################################################
sensor:
- platform: mqtt
name: weekday
state_topic: "house/week/day"
script:
monday:
sequence:
- service: mqtt.publish
data:
topic: house/week/day
payload: mon
retain: true
tuesday:
sequence:
- service: mqtt.publish
data:
topic: house/week/day
payload: tue
retain: true
wednesday:
sequence:
- service: mqtt.publish
data:
topic: house/week/day
payload: wed
retain: true
thursday:
sequence:
- service: mqtt.publish
data:
topic: house/week/day
payload: thu
retain: true
friday:
sequence:
- service: mqtt.publish
data:
topic: house/week/day
payload: fri
retain: true
saturday:
sequence:
- service: mqtt.publish
data:
topic: house/week/day
payload: sat
retain: true
sunday:
sequence:
- service: mqtt.publish
data:
topic: house/week/day
payload: sun
retain: true
automation:
- alias: set weekday mon
initial_state: true
trigger:
- platform: time
at: 00:00:01
- platform: homeassistant
event: start
condition:
- condition: time
weekday:
- mon
action:
- service: script.monday
id: set_weekday_mon
- alias: set weekday tue
initial_state: true
trigger:
- platform: time
at: 00:00:01
- platform: homeassistant
event: start
condition:
- condition: time
weekday:
- tue
action:
- service: script.tuesday
id: set_weekday_tue
- alias: set weekday wed
initial_state: true
trigger:
- platform: time
at: 00:00:01
- platform: homeassistant
event: start
condition:
- condition: time
weekday:
- wed
action:
- service: script.wednesday
id: set_weekday_wed
- alias: set weekday thu
initial_state: true
trigger:
- platform: time
at: '00:00:01'
- platform: homeassistant
event: start
condition:
- condition: time
weekday:
- thu
action:
- service: script.thursday
id: set_weekday_thu
- alias: set weekday fri
initial_state: true
trigger:
- platform: time
at: '00:00:01'
- platform: homeassistant
event: start
condition:
- condition: time
weekday:
- fri
action:
- service: script.friday
id: set_weekday_fri
- alias: set weekday sat
initial_state: true
trigger:
- platform: time
at: '00:00:01'
- platform: homeassistant
event: start
condition:
- condition: time
weekday:
- sat
action:
- service: script.saturday
id: set_weekday_sat
- alias: set weekday sun
initial_state: true
trigger:
- platform: time
at: '00:00:01'
- platform: homeassistant
event: start
condition:
- condition: time
weekday:
- sun
action:
- service: script.sunday
id: set_weekday_sun