/hass-config

My Home Assistant configuration

The UnlicenseUnlicense

Home Assistant Config

Build Status

My Home Assistant (HA) Config, updated pretty regularly.

-- this document is still very much work in progress --

Interesting Bits

Workflow / Build Pipeline

My config is validated by Travis CI using the latest version of Home Assistant after each push. HA uses a sensor to monitor the Travis build state and sends me notifications of the outcome for each build.

Notification Example

After a successful build I use the Makefile to push the update to Home Assistant and restart the service.

TODO: Create a Hassio addon which can automate updating the config. Then update the notifications for a successful build to provide an actionable "Update and Restart" prompt.

Day Phase Sensor

The Day Phase Sensor is one of the lynch pins of my HA setup. It uses a combination of time and sun position to decide if the it's currently Morning, Day, Evening or Night. This allows me to easily keep automations that rely on the time of day in sync and removes a lot of duplication.

- platform: template
  sensors:
    day_phase:
      friendly_name: 'Day Phase'
      value_template: >
        {% if now() > now().replace(hour=5).replace(minute=0).replace(second=0) and
            now() < now().replace(hour=9).replace(minute=0).replace(second=0) %}
            Morning
        {% elif states.sun.sun.state == "above_horizon" %}
            Day
        {% elif now() < now().replace(hour=22).replace(minute=0).replace(second=0) and
            now() > now().replace(hour=9).replace(minute=0).replace(second=0) %}
            Evening
        {% else %}
            Night
        {% endif %}

Actual sensor config

Lighting Automations (Philips Hue)

The Day Phase Sensor allows me to keep my lighting automations very simple. For rooms with motion sensors I generally have three basic automations:

...