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

View File

@@ -0,0 +1,50 @@
###################################
## cuckoo Clock simulation.
## Plays the number of cuckoos per hour and 1 on the half hour.
###################################
- alias: Cuckoo Clock
trigger:
- platform: time
minutes: 00
seconds: 20
- platform: time
minutes: 30
seconds: 00
condition:
- condition: time
after: '09:29:00'
before: '21:30:00'
- condition: state
entity_id: group.family
state: 'home'
- condition: template
value_template: >
{% if is_state('media_player.livingroomCC', 'playing') %}
false
{% else %}
true
{% endif %}
action:
- service: script.amp_settings
data:
media_player: 'media_player.livingroomcc'
volume_level: 0.22
- service: media_player.play_media
data_template:
entity_id: >
{% if states.group.bed.state == 'off' %}
media_player.livingroomCC
{% else %}
media_player.alarm_clock, media_player.bedroom_alarm_panel
{% endif %}
media_content_id: >
{% if now().strftime("%M")|int == 30 %}
https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/sounds/cuckoo-clock-01.wav
{% else %}
https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/sounds/cuckoo-clock-{{now().strftime("%I")}}.wav
{% endif %}
media_content_type: audio/mp4

View File

@@ -0,0 +1,12 @@
# [![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!
This directory is primarily used for automations that are just running in the background all the time. Little robots just doing thier thing to help make the house the smartest and most proactive it can be for us.
#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).

View File

@@ -0,0 +1,26 @@
###################################
## Self Healing Section -
## Home Assistant runs on my [Raspberry Pi 3](http://amzn.to/2e3DOBY) with [Aeon Labs Z Wave Stick (GEN 5)](http://amzn.to/2eAiAP0).
###################################
- alias: Heal Components Nightly
hide_entity: True
trigger:
platform: time
at: '2:31:00'
action:
# - service: zwave.heal_network - Not needed anymore since I've migrated to Wink.
- service: homeassistant.turn_on
entity_id: switch.bedroom_restart_on
- service: script.tweet_engine
data_template:
tweet: >
{{ [
"While they sleep, I self heal the #Z-Wave network with #Wink. (http://amzn.to/2E9Vax2)",
"2:30am, Time to restart the #Amazon Alarm Panels for a fresh start in the morning. (http://www.vmwareinfo.com/2017/08/project-update-visualization-of-home.html)",
"Restarting the #Amazon Fire Tablets nightly to clear memory issues or any other bugs (http://www.vmwareinfo.com/2017/07/visualizing-smart-home-using-home.html)",
"Nightly #Z-WAVE Self heals keep all the gear in check! (http://amzn.to/2q17R4S)",
"Every night at 2:31am, I do my self-heal and rebuild the #ZWAVE network.",
"Without my Nightly #ZWave Self Heal, things get a little whackado."
] | random + " #SelfHeal "}}

View File

@@ -0,0 +1,34 @@
- alias: "Wink Update Available Notification"
hide_entity: True
trigger:
platform: template
value_template: "{{ is_state_attr('binary_sensor.carlowink', 'update needed', True) }} != False }}"
action:
- service: script.notify_engine
data_template:
value1: 'Check the Wink Hub. Update is needed.'
value2: "{{ states.binary_sensor.carlowink.attributes }}"
value3: ''
who: 'carlo'
- service: notify.html5
data_template:
title: "Wink Update Available"
message: "Wink Update is available. - {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p %d%b%Y', true) }}"
data:
url: "https://home-assistant.io/getting-started/installation-raspberry-pi-all-in-one/#upgrading"
- service: persistent_notification.create
data:
title: "Wink Update Available"
message: "Wink Update is available. - {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p %d%b%Y', true) }}"
notification_id: "update_available"
- service: script.tweet_engine
data_template:
tweet: >
{{ [
"Check @TheWinkApp Hub @CCostan. Update is needed. {{ states.binary_sensor.carlowink.attributes }}",
"New update from @TheWinkApp. Hop to it @CCostan"
] | random + "(http://amzn.to/2orGEWo)"}}

View File

@@ -0,0 +1,26 @@
###################################
## Uses IFTTT to notify me of bad logins.
###################################
- alias: Login Failure
hide_entity: True
trigger:
platform: template
value_template: "{{ states('persistent_notification.httplogin') != 'unknown' }}"
action:
- service: script.notify_engine
data_template:
value1: 'Bad Login: '
value2: 'There was a Hack attempt!'
value3: 'Go Check the GUI for details.'
who: 'carlo'
- service: script.tweet_engine
data_template:
tweet: >
{{ [
"Seriously, I am a Smart Home. I am logging your hack attempt.",
"If you do not know the password, you get locked out and IP banned.",
"Three Strikes and you are OUT! IP Banned."
] | random + "#Security"}}

View File

@@ -0,0 +1,50 @@
##############################################################################
### Detect when lights are turned on and adjust them accordingly based on time.
### Code by @JesseWebDotCom
##############################################################################
- alias: detect lights and adjust the brightness when turned on based on time
trigger:
- platform: event
event_type: state_changed
condition:
- condition: state
entity_id: group.family
state: 'home'
- condition: state
entity_id: input_boolean.alert_mode
state: 'off'
- condition: template
value_template: "{{ trigger.event.data is not none }}"
- condition: template
value_template: "{{ trigger.event.data.entity_id is not none }}"
- condition: template
value_template: "{{ trigger.event.data.entity_id.split('.')[0] == 'light' }}"
- condition: template
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.tv' }}"
- condition: template
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.couch' }}"
- condition: template
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.office' }}"
- condition: template
value_template: "{{ trigger.event.data.entity_id.split('_')[1] != 'screensaver' }}"
- condition: template
value_template: "{{ trigger.event.data.new_state.state == 'on' }}"
- condition: template
value_template: "{{ trigger.event.data.old_state.state == 'off' }}"
action:
- service: light.turn_on
data_template:
entity_id: "{{ trigger.event.data.entity_id }}"
brightness: >
{% set hour=states("sensor.time").split(':')[0] | int %}
{%- if hour >= 5 and hour < 8 -%}
50
{%- elif hour >= 8 and hour <20 -%}
255
{%- elif hour >= 20 and hour <24 -%}
40
{%- else -%}
15
{%- endif %}

View File

@@ -0,0 +1,37 @@
###################################
## @CCOSTAN
## Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
###################################
- alias: Door Chime
trigger:
- platform: state
entity_id:
- group.entry_points
condition:
- condition: state
entity_id: group.family
state: 'home'
action:
- service: script.amp_settings
data:
media_player: 'media_player.livingroomcc'
volume_level: 0.22
- service: media_player.play_media
data_template:
entity_id: >
{% if states.group.bed.state == 'off' %}
media_player.livingroomCC
{% else %}
media_player.alarm_clock, media_player.bedroom_alarm_panel
{% endif %}
media_content_id: >
{% if trigger.to_state.state == 'on' %}
https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/sounds/one-tone-chime.mp3
{% else %}
https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/sounds/two-tone-chime.mp3
{% endif %}
media_content_type: audio/mp4

View File

@@ -0,0 +1,29 @@
##############################################################################
### Detect when things are on and forgotten about. Like any Good Watchdog.
##############################################################################
##############################################################################
- alias: "NOTIFY IF IP CHANGES"
hide_entity: True
trigger:
- platform: state
entity_id: sensor.ipchange
from: 'False'
to: 'True'
action:
- service: script.notify_engine
data_template:
value1: 'Changed IP address:'
value2: "New IP: {{ states('sensor.exteral_ip') }}"
value3: ' - Be sure to Change DNS!'
who: 'carlo'
- service: script.tweet_engine
data_template:
tweet: >
{{ [
"That's weird. Looks like my IP address changed. @CCostan, please check it out.",
"Time to update @GoDaddy @CCostan. Looks like my IP address changed."
] | random + " #HomeAutomation"}}
##############################################################################

View File

@@ -0,0 +1,29 @@
###################################
## Uses IFTTT to trigger rain delay with rachio
###################################
- alias: Rachio_Rain_Delay
hide_entity: True
trigger:
- platform: numeric_state
entity_id:
- sensor.dark_sky_precip_intensity_max
- sensor.dark_sky_precip_intensity
above: 0.5
- platform: numeric_state
entity_id: sensor.dark_sky_wind_speed
above: 20
action:
- service: ifttt.trigger
data_template: {"event":"Rachio_Rain_Delay"}
- service: script.tweet_engine
data_template:
tweet: >
{{ [
"Looks like Rain, Pausing the @_Rachio for 24 hours. (http://amzn.to/2eoPKBW)",
"Since it is going to rain tomorrow, I'll pause @_Rachio for 24 hours.",
"No reason to water the grass if it's going to rain tomorrow. pausing @_Rachio for 24 hours.",
"Mother Nature is watering the grass today so I can pause @_Rachio for 24 hours."
] | random + " #SavingWater"}}

View File

@@ -0,0 +1,75 @@
###################################
## Trigger Dump
###################################
- alias: Trigger dump - MQTT
trigger:
- platform: event
event_type: feedreader
action:
- service: script.notify_engine
data_template:
value1: 'Check the MQTT Dump'
value2: '/dump/{{ trigger.platform }}'
who: 'carlo'
- service: mqtt.publish
data_template:
topic: '/dump/{{ trigger.platform }}'
retain: false
payload: >-
{%- macro dumpState(statePrefix, stateObj) -%}
{{statePrefix ~ ": "}} {{- stateObj.state }}{{- "\n" -}}
{{statePrefix ~ ".entity_id: "}} {{- stateObj.entity_id }}{{- "\n" -}}
{{statePrefix ~ ".domain: "}} {{- stateObj.domain }}{{- "\n" -}}
{{statePrefix ~ ".object_id: "}} {{- stateObj.object_id }}{{- "\n" -}}
{{statePrefix ~ ".name: "}} {{- stateObj.name }}{{- "\n" -}}
{{statePrefix ~ ".last_updated: "}} {{- stateObj.last_updated }}{{- "\n" -}}
{{statePrefix ~ ".last_changed: "}} {{- stateObj.last_changed }}{{- "\n" -}}
{%- for attrib in stateObj.attributes | sort() %}
{%- if attrib is defined -%}
{{- statePrefix ~ ".attributes." ~ attrib ~ ": " -}} {{- stateObj.attributes[attrib] -}}
{{- "\n" -}}
{%- endif -%}
{%- endfor -%}
{%- endmacro -%}
{% set p = trigger.platform %}
{{"trigger.platform: "}} {{ p }}{{- "\n" -}}
{%- if p == "mqtt" -%}
{{"trigger.topic: "}} {{ trigger.topic }}{{- "\n" -}}
{{"trigger.payload: "}} {{ trigger.payload }}{{- "\n" -}}
{{"trigger.payload_json: "}} {{ trigger.payload_json }}{{- "\n" -}}
{{"trigger.qos: "}} {{ trigger.qos }}{{- "\n" -}}
{%- endif -%}
{%- if p == "event" or p == "sun" or p == "zone" -%}
{{"trigger.event: "}} {{ trigger.event }}{{- "\n" -}}
{%- endif -%}
{%- if p == "numeric_state" -%}
{{"trigger.above: "}} {{ trigger.above }}{{- "\n" -}}
{{"trigger.below: "}} {{trigger.below }}{{- "\n" -}}
{%- endif -%}
{%- if p == "state" -%}
{{"trigger.for: "}} {{ trigger.for }}{{- "\n" -}}
{%- endif -%}
{%- if p == "time" -%}
{{"trigger.now: "}} {{ trigger.now }}{{- "\n" -}}
{%- endif -%}
{%- if p == "zone" -%}
{{"trigger.zone: "}} {{ trigger.zone }}{{- "\n" -}}
{%- endif -%}
{%- if p == "state" or p == "numeric_state" or p == "template" or p == "zone" -%}
{{"trigger.entity_id: "}} {{ trigger.entity_id }}{{- "\n" -}}{{- "\n" -}}
{{"trigger.from_state: "}} {{- "\n" -}}
-------------------{{- "\n" -}}
{{ dumpState("trigger.from_state", trigger.from_state) }} {{- "\n" -}}
trigger.to_state:{{- "\n" -}}
-----------------{{- "\n" -}}
{{ dumpState("trigger.to_state", trigger.to_state) }}
{%- endif -%}

View File

@@ -0,0 +1,34 @@
- alias: "Update Available Notification"
hide_entity: True
trigger:
platform: state
entity_id: updater.updater
condition:
- condition: template
value_template: "{{ states('updater.updater') != 'unknown' }}"
action:
- service: script.notify_engine
data_template:
value1: 'There is a new Version of Home-Assistant Available.'
value2: "{{ states('updater.updater') }}"
who: 'carlo'
- service: script.tweet_engine
data:
tweet: "New version of @Home_Assistant! Cannot wait for @CCostan to install it! - {{ states('updater.updater') }} (http://www.vmwareinfo.com/2017/07/my-smart-home-look-at-parts-that-make.html)"
- service: notify.html5
data_template:
title: "Update Available"
message: "Home Assistant {{ states('updater.updater') }} is available. - {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p %d%b%Y', true) }}"
data:
url: "https://home-assistant.io/getting-started/installation-raspberry-pi-all-in-one/#upgrading"
- service: persistent_notification.create
data:
title: "Update Available"
message: "Home Assistant {{ states('updater.updater') }} is available. - {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p %d%b%Y', true) }}"
notification_id: "update_available"

View File

@@ -0,0 +1,27 @@
##############################################################################
### Detect when things are on and forgotten about. Like any Good Watchdog.
##############################################################################
- alias: Automated Light WatchDog!
trigger:
- platform: state
entity_id:
- light.hallway
- group.hallway_lights
- group.foyer_lights
- switch.printer_outlet
to: 'on'
for: '00:20:00'
- platform: state
entity_id:
- group.upstairs
- switch.garage_outlet
to: 'on'
for: '02:00:00'
#Turn it off!
action:
- service: homeassistant.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"