Skip to content

Commit

Permalink
Merge branch 'release/2018-06-26'
Browse files Browse the repository at this point in the history
  • Loading branch information
renemarc committed Jun 26, 2018
2 parents 6534ca7 + e1c3bd6 commit 9a6af52
Show file tree
Hide file tree
Showing 142 changed files with 3,164 additions and 771 deletions.
1 change: 1 addition & 0 deletions .HA_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.72.1
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
__pycache__/
deps/
gtfs/*
homebridge/
tts/
ip_bans.yaml
known_devices.yaml
Expand All @@ -29,4 +28,5 @@ secrets.yaml
!.github
!.gitignore
!.gitkeep
!/.HA_VERSION
!/.travis.yml
66 changes: 41 additions & 25 deletions README.md

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions appdaemon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,14 @@ For third-party, custom and modified dashboard widgets.
### [`🖼 ./dashboards/`](dashboards)

For the dashboards used in HADashboard.


## Files

### [`⚙️ ./appdaemon.yaml`](appdaemon.yaml)

AppDaemon configuration file.

### [`🔑 ./secrets-dummy.yaml`](secrets-dummy.yaml)

Placeholder file for sensitive information, to be copied to `secrets.yaml` and modified according to the target environment.
13 changes: 8 additions & 5 deletions appdaemon/appdaemon.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
secrets: /config/secrets.yaml
log:
logfile: STDOUT
errorfile: STDERR
appdaemon:
threads: 10
app_dir: /config/appdaemon/apps
app_dir: !secret appdaemon_app_dir
disable_apps: 1
elevation: !secret appdaemon_elevation
latitude: !secret appdaemon_latitude
longitude: !secret appdaemon_longitude
time_zone: !secret appdaemon_time_zone
plugins:
HASS:
type: hass
ha_url: http://hassio/homeassistant
ha_key: f411986db776442b864aa2a31f2d948c
ha_url: !secret appdaemon_hass_url
ha_key: !secret appdaemon_hass_key
hadashboard:
dash_url: !secret hadashboard_dash_url
dash_dir: /config/appdaemon/dashboards
dash_dir: !secret hadashboard_dash_dir
dash_compile_on_start: 1
3 changes: 2 additions & 1 deletion appdaemon/custom_css/modern/variables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
#

head_includes:
- <! head tags go here ->
- <! Refresh every 15 minutes to avoid memory issues with slideshows. ->
- <meta http-equiv="Refresh" content="900">

#
# Custom body includes - should be a YAML List, e.g.:
Expand Down
19 changes: 10 additions & 9 deletions appdaemon/dashboards/Main.dash
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,17 @@ label:
slideshow:
widget_type: entitycamera
refresh: 5
cache: 600
img_list:
- http://hassio.local:8123/api/camera_proxy/camera.environment_canada_snow?token=72401f9a299bbf9f8521bd46bb8e2366d29d59af19006522910aaed73502cb47
- http://hassio.local:8123/api/camera_proxy/camera.bing_wallpaper?token=bc9ccd0575dfb05d63df105cc8ed76d6578d63e60083e48fe265a07513a9861d
- http://hassio.local:8123/api/camera_proxy/camera.noaa_geocolor?token=c5c3e871bce6c743f4bb50b41cfed061fb9ac474735d22710d6d44d23725a961
- http://hassio.local:8123/api/camera_proxy/camera.astronomy_picture_of_the_day?token=8a93f72de0a6538bd4c8348a338bd13a65be0bab41545f1b2f97676fb584c150
- !secret camera_environment_canada_snow_1
- !secret camera_bing
- !secret camera_noaa_geocolor
- !secret camera_apod
title_entity_list:
- ""
- sensor.bing_wallpaper_info
- sensor.bing_wallpaper
- ""
- sensor.apod_info
- sensor.apod
title_style: "line-height:2em;opacity:0.8;"


Expand All @@ -98,17 +99,17 @@ quiet_mode:
low_power_mode:
widget_type: input_boolean
entity: input_boolean.low_mode
title2: Dim lights
title2: Low power

nap_mode:
widget_type: input_boolean
entity: input_boolean.nap_mode
title2: Take a nap
title2: Go to sleep

night_mode:
widget_type: input_boolean
entity: input_boolean.night_mode
title2: Go to sleep
title2: Good night!

scene:
widget_type: input_select
Expand Down
24 changes: 13 additions & 11 deletions appdaemon/dashboards/Weather.dash
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,23 @@ label:
camera_environment_canada:
widget_type: entitycamera
refresh: 1
cache: 600
img_list:
- http://hassio.local:8123/api/camera_proxy/camera.environment_canada_rain_3?token=21543de1f2ce8ca84d2114b452f839ddd98a9ca5147b37f01c4f14adb62ed6f0
- http://hassio.local:8123/api/camera_proxy/camera.environment_canada_rain_2?token=3df6d563b3d938aadb132e4b9e4c00c3311c55eae4361a70b1e13cfa32114340
- http://hassio.local:8123/api/camera_proxy/camera.environment_canada_rain?token=d660cfd7fc10367a52571370758a826b697b4c43c0a91a40ab04327e7a791487
- http://hassio.local:8123/api/camera_proxy/camera.environment_canada_snow_3?token=42607ab03e61e5b8d72e90d6ceda618fac2e66ff7e92d3fb8af9e1ef45cfcdc7
- http://hassio.local:8123/api/camera_proxy/camera.environment_canada_snow_2?token=b63878776c5c84d4fb46f9fc0ad82a47991894d40bfc9c383cb78871c4b441e4
- http://hassio.local:8123/api/camera_proxy/camera.environment_canada_snow?token=de27298acdc2fabc70a4f18e2f73cc13f4d63a091d6b7969514e34e8acf488df
- !secret camera_environment_canada_rain_3
- !secret camera_environment_canada_rain_2
- !secret camera_environment_canada_rain_1
- !secret camera_environment_canada_snow_3
- !secret camera_environment_canada_snow_2
- !secret camera_environment_canada_snow_1
title_style: "background-color: rgba(0, 0, 0, 1);"

camera_noaa:
widget_type: entitycamera
refresh: 3
cache: 600
img_list:
- http://hassio.local:8123/api/camera_proxy/camera.noaa_geocolor?token=5d9b9b5a6681e174ce772563564c6f9eacfa8d060c6eb53c82e1f9a9dfbab623
- http://hassio.local:8123/api/camera_proxy/camera.noaa_water_vapour?token=af621c3ed64cb4c7e1383fc275ff5d71e4a01174596d70d80b23fe913029d803
- !secret camera_noaa_geocolor
- !secret camera_noaa_water_vapour
title_style: "background-color: rgba(0, 0, 0, 1);"

wind:
Expand Down Expand Up @@ -125,7 +127,7 @@ weekly_forecast:
temperature_today:
widget_type: entitysensor
title: Today
entity: sensor.dark_sky_daily_high_temperature
entity: sensor.dark_sky_daytime_high_temperature
sub_entity: sensor.weather_low_friendly
title2_entity: sensor.feels_like
widget_style: "background-color:inherit;"
Expand All @@ -136,7 +138,7 @@ temperature_today:
temperature_tomorrow:
widget_type: entitysensor
title: Tomorrow
entity: sensor.dark_sky_daily_high_temperature_1
entity: sensor.dark_sky_daytime_high_temperature_1
sub_entity: sensor.weather_low_1_friendly
title2_entity: sensor.feels_like_1
widget_style: "background-color:inherit;"
Expand All @@ -147,7 +149,7 @@ temperature_tomorrow:
temperature_after_tomorrow:
widget_type: entitysensor
title: After Tomorrow
entity: sensor.dark_sky_daily_high_temperature_2
entity: sensor.dark_sky_daytime_high_temperature_2
sub_entity: sensor.weather_low_2_friendly
title_entity: sensor.after_tomorrow
title2_entity: sensor.feels_like_2
Expand Down
63 changes: 63 additions & 0 deletions appdaemon/secrets-dummy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#
# Appdaemon dummy secrets file
#
# Placeholder file to be copied to `/appdaemon/secrets.yaml` and adapted.
# These dummy values are optimized for a Docker development environment.
#
# Hassio sample values:
# appdaemon_app_dir: /config/appdaemon/apps
# appdaemon_hass_url: http://hassio/homeassistant
# camera_*: http://[HOST]:[PORT]/
# hadashboard_dash_dir: /config/appdaemon/dashboards
# hadashboard_dash_url: http://127.0.0.1:[PORT]
#
# @link http://appdaemon.readthedocs.io/en/latest/INSTALL.html#secrets
#


#
# AppDaemon basic info
#
# @see /appdaemon/appdaemon.yaml
#
appdaemon_app_dir: /conf/apps
appdaemon_hass_key: ""
appdaemon_hass_url: http://homeassistant


#
# AppDaemon location
#
# @see /appdaemon/appdaemon.yaml
#
appdaemon_elevation: 0
appdaemon_latitude: 0
appdaemon_longitude: 0
appdaemon_time_zone: America/Toronto


#
# Image widgets
#
# @see /appdaemon/dashboards/Main.yaml
# @see /appdaemon/dashboards/Weather.yaml
#
camera_apod: http://homeassistant:8123/api/camera_proxy/camera.astronomy_picture_of_the_day?token=
camera_bing: http://homeassistant:8123/api/camera_proxy/camera.bing_wallpaper?token=
camera_environment_canada_rain_1: http://homeassistant:8123/api/camera_proxy/camera.environment_canada_rain?token=
camera_environment_canada_rain_2: http://homeassistant:8123/api/camera_proxy/camera.environment_canada_rain_2?token=
camera_environment_canada_rain_3: http://homeassistant:8123/api/camera_proxy/camera.environment_canada_rain_3?token=
camera_environment_canada_snow_1: http://homeassistant:8123/api/camera_proxy/camera.environment_canada_snow?token=
camera_environment_canada_snow_2: http://homeassistant:8123/api/camera_proxy/camera.environment_canada_snow_2?token=
camera_environment_canada_snow_3: http://homeassistant:8123/api/camera_proxy/camera.environment_canada_snow_3?token=
camera_noaa_geocolor: http://homeassistant:8123/api/camera_proxy/camera.noaa_geocolor?token=
camera_noaa_water_vapour: http://homeassistant:8123/api/camera_proxy/camera.noaa_water_vapour?token=


#
# HaDashboard basic info
#
# @see /appdaemon/appdaemon.yaml
#
hadashboard_dash_dir: /conf/dashboards
hadashboard_dash_url: http://localhost:5050
129 changes: 126 additions & 3 deletions automations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,133 @@

## Publishers and subscribers

To prevent _spaghettification_ of automations as this project grows, I employ a [publish–subscribe pattern](https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern) (kind of a lightweight [mediator pattern](https://en.wikipedia.org/wiki/Mediator_pattern)) where some automations will trigger changes on [`/misc/input_booleans.yaml`](../misc/input_booleans.yaml) and [`/misc/variables.yaml`](../misc/variables.yaml) while others listen to those changes.
<div align="center">
<figure>
<div>
<img src="https://media.giphy.com/media/CmFMWpEa4IFtS/giphy.gif" alt="Ticket clerk hidden inside a turnstile">
</div>
<figcaption>
<p><strong>Pub/sub!</strong></p>
</figcaption>
</figure>
</div>

For example, one push of a button will lead to enabling the **night mode** by setting the relevant boolean to _true_. Every room has an automation that listens to changes on that **night mode** boolean, and is responsible for turning devices on and off accordingly. This makes every room reactive to one central direction, without having to maintain a monolithic [`/scripts/go_to_sleep.yaml`](../scripts/go_to_sleep.yaml) that lists all the devices that must be acted upon.
To prevent [spaghetti code](https://www.youtube.com/watch?v=vZA6h7djGmc) in automations as this project grows, I employ a [publish–subscribe pattern](https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern) (kind of a lightweight [mediator pattern](https://en.wikipedia.org/wiki/Mediator_pattern)) where some automations will trigger changes on [`/misc/input_booleans.yaml`](../misc/input_booleans.yaml) and [`/misc/variables.yaml`](../misc/variables.yaml) while others listen to those changes.

For example, one push of a button will lead to enabling the **night mode** by setting the relevant boolean to _true_. Every room has an automation that listens to changes on that **night mode** boolean, and is responsible for turning devices on and off accordingly. This makes every room reactive to one central direction, without having to maintain a monolithic `/scripts/go_to_sleep.yaml` that lists all the devices that must be acted upon.

It's a bit like a boss giving orders to managers, and letting them figure out how to best accomplish these goals based on what they know about their respective teams. Less micromanagement = smarter teams.

In the comments, automations annotated with **@publish** are the ones that issue orders, and those annotated with **@subscribe** are listening for such orders. Some automations will be both **publishers** and **subscribers** of different orders.
To help clarify and document this pattern in the files' comments, automations annotated with **@publish** are the ones that issue orders, and those annotated with **@subscribe** are listening for such orders. Some automations will be both **publishers** and **subscribers** of different orders.

<div align="center">
<figure>
<div>
<a href="https://www.youtube.com/watch?v=vZA6h7djGmc" title="Understanding spaghetti code"><img src="https://media.giphy.com/media/IVoBdwlksSq7m/giphy.gif" alt="Someone adding a meatball to an already overflowing spaghetti takeaway container"></a>
</div>
<figcaption>
<p><strong><a href="https://www.youtube.com/watch?v=vZA6h7djGmc" title="Understanding spaghetti code">Understanding spaghetti code.</a></strong></p>
</figcaption>
</figure>
</div>


## Folders

### [`📂 ./areas/`](areas)

Contains automations related to smart areas.


### [`📂 ./devices/`](devices)

For automations related to individual smart devices.


### [`📂 ./modes/`](modes)

For all automations related to modes.


## Files

### [`💡️ ./cct_lifx.yaml`](cct_lifx.yaml)

Adjust LIFX bulbs colour temperature (CCT) based on cyrcadian rythm.


### [`💡️ ./cct_limitlessled.yaml`](cct_limitlessled.yaml)

Adjust LimitlessLED/MiLight colour temperature (CCT) based on cyrcadian rythm.


### [`🗣️️ ./daily_greeting.yaml`](daily_greeting.yaml)

Greet the day with a daily briefing.


### [`🚪 ./doors_notify.yaml`](doors_notify.yaml)

Warn someone if a door was left open for too long.


### [`🚪️ ./doors_verify.yaml`](doors_verify.yaml)

Verify the state of all external doors.


### [`🚪️ ./front_door_notify.yaml`](front_door_notify.yaml)

Warn whenever the front door is opening or closing.


### [`⚗️️ ./humidity_notify.yaml`](humidity_notify.yaml)

Check if humidity is too high or too low.


### [`🔆️ ./scene_daylight.yaml`](scene_daylight.yaml)

Toggle the daylight scene.


### [`👾 ./scene_gaming.yaml`](scene_gaming.yaml)

Toggle the gaming scene.


### [`💏️ ./scene_romantic.yaml`](scene_romantic.yaml)

Toggle the romantic scene.


### [`🔘️️ ./scene_select.yaml`](scene_select.yaml)

Manually select a global scene.


### [`🖐 ./tamper_notify.yaml`](tamper_notify.yaml)

Warn someone if the tamper flag has changed.


### [`🌈️ ./theme_auto.yaml`](theme_auto.yaml)

Set theme to "normal" during daytime and "dark" during night mode.


### [`🆕️ ./update_notify.yaml`](update_notify.yaml)

Notify when a new version of Home Assistant is available.


### [`⏰️ ./wake_up.yaml`](wake_up.yaml)

Wake up all devices.


## Customization

The bulk of the customization is done in [`/customize.yaml`](../customize.yaml) and [`/customize_glob.yaml`](../customize_glob.yaml).

The looks of many state cards depend on Custom UI and other templates in [`/www/custom_ui/`](../www/custom_ui).
Loading

0 comments on commit 9a6af52

Please sign in to comment.