Skip to content
Andy's Home Assistant Configuration
HTML Shell
Branch: master
Clone or download
Latest commit 8b5d9ae Aug 16, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
automation Tweak Settings Aug 15, 2019
lovelace
panels Migrate to v0.97.0 Aug 9, 2019
shell Lovelace & Porch PIR Mar 30, 2019
.gitignore add google tracker Mar 31, 2019
LICENSE Minor fixes, add Licence & Readme Mar 4, 2019
README.md remove Life360 Aug 16, 2019
configuration.yaml Tweak Settings Aug 15, 2019
customize.yaml Migrate to v0.97.0 Aug 9, 2019
device_tracker.yaml remove Life360 Aug 16, 2019
frontend.yaml add themes Aug 8, 2019
groups.yaml remove Life360 Aug 16, 2019
known_devices.yaml remove Life360 Aug 16, 2019
lightwave.yaml add themes Aug 8, 2019
media_players.yaml Migrate to v0.97.0 Aug 9, 2019
options.xml Add Z-Wave Mar 22, 2019
recorder.yaml
scripts.yaml Lighting Adjustments Jul 9, 2019
sensors.yaml Tweak Settings Aug 15, 2019
switches.yaml mod usb disc controls Aug 7, 2019
tuya.yaml First Commit Mar 3, 2019
ui-lovelace.yaml mod usb disc controls Aug 7, 2019

README.md

Overview

Welcome to my personal Home Assistant configurations.

All the automations included in this repository are working with Home Assistant Version 0.97.0 and are provided for information and guidance and with no guarantees; They are updated as and when I add or modify my home assistant implementation at home.

Prior to introducing Home Assistant into my home I was using Lightwave RF Gen 1 hub with various switches and lighting control (described below) around the house; I also had a Tuya compatible HowiseAcc Smart WiFi Power Strip; these have been integrated into my Home Assistant powered system.

Home assistant runs on a Raspberry Pi 3+ with a Z-Wave USB Adapter (Aeon Labs Z‐Stick Gen5) to allow the Pi to act as a Z-Wave Hub.

I use Z-Wave sensors and either Lightwave or Tuya switches.

Presence Detection After various experiments with BLE fob devices, WiFi detection and BlueTooth detection I decided that all these methods are not reliable (and that BLE is currently immature, not to be trusted). I decided that these methods are too slow to use to trigger events that need to happen quickly (eg turn on lights when arrive home)... so use a dedicated sensor for this; I opted to use a combination of Bluetooth, Wifi and Google Maps location sharing to determine (coarsely) if individuals are at home or away; this is not fast enough to use for automations but is OK for use in automation conditions (eg only trigger something if someone is home). (Life360 (introduced in Home Assistant release 0.95) did not track my wife's phone very well)

Contents

Lounge Mancave Kitchen Hallway Welcome Home Automation PC Start Automations

Lounge

Top

In the lounge there are two things I control; a media system and lighting

The media system consists of a TV, BluRay Player, Kodi Box, AV Amplifier, PVR and Bass Amp. All these devices are connected to my network so are 'detectable' using NMap. The Bass Amp is seperately powered (controlled by a LightwaveRF switch). The Kodi Box has an attached USB Drive which is also powered via a LightwaveRF switch). I use a sensor located outside to measure how dark it is and flag when its dark.

Automations

  1. When it's dark, and we are at home, the lights switch on if the TV is switched on.
  2. When we are at home, if the TV is switched on, if the outside sensor then detects that it is dark then the lights are switched on.
  3. The Bass Amp is turned on and off in sympathy with the AV Amplifier.
  4. The Kodi USB Drive is turned on and off in sympathy with the Kodi Box.

Mancave

Top

In my mancave there are two things I control; a media system and lighting

The media system consists of a TV, BluRay Player, Kodi Box and AV Amplifier. All devices except the AV Amplifier are connected to my network and are 'detectable' using NMap. The Kodi Box has two attached USB Drives one of which is powered via a LightwaveRF switch, the other via a Tuya switch.

Automations

  1. When the TV is switched on, if it is dark, the light is turned on; it is turned off 2 minutes after the TV is turned off.
  2. If the TV is switched on, and the outside sensor then detects that it is dark then the lights are switched on.
  3. The Kodi USB Drives are turned on and off in sympathy with the Kodi Box.
  4. When the sun goes down, if the TV is switched on, the light is turned on.

Kitchen

Top

In the kitchen there are two things I control; a Radio and lighting

Automations

  1. In the morning, when movement is detected in the hall, the Radio is switched on and tuned to our local station
  2. TODO in the evening, when movement is detected in the hall, the lighting is switched on.

Hallway

Top

I run Hassbian on a Raspberry Pi 3+. This is located in the hall and connected to my router which is also in the hall near my front door. This is convenient for the presence detection used in Welcome Home (below); I use a Z-Wave Aeotec Multisensor 6 to realise the motion detection. There is also a light in the hallway which is controlled through a LightwaveRF switch.

Automations

  1. When movement is detected in the hall, and the sun is down, the light is switched on; the light stays switched on until movement is no longer detected for a period of 1 minute.

Welcome Home Automation

Top

Welcome Home switches the porch light and the hall light on for 2 minutes when movement is detected in the porch (and the sun is down); I use a Neo Coolcam Motion Sensor 2 with temperature sensor for the motion detection.

PC

Top

I have several USB drives attached to my main PC (Andy-Ubuntu), a NAS Drive (Defiant) and a second PC (Excelsior) which has several USB Drives attached. The PCs and NAS are connected to my network so are detectable using NMap. Everything except my main PC is controllable through LightwaveRF or tuya switches.

I have a group: 'computers' which consists of my Main PC and Second PC (excelsior).

I have two other groups representing usb drives connected to computers (main_pc_usb_drives and excelsior_usb_drives).

Automations

  1. When Defiant NAS is switched off it is also disconnected from mains supply.
  2. When Excelsior is switched off it is also disconnected from mains power supply.
  3. When my main PC is switched off, all attached USB Drives are also switched off.
  4. When Excelsior is switched off, all attached USB Drives and power to Excelsior are also switched off.
  5. When a PC in group 'computers' is switched on my NAS drive is switched on using Wake-on-LAN
  6. When all PCs in group 'computers' are switched off my NAS drive is switched off using script.turn_off_defiant
  7. Excelsior is turned on once a day at 4:00am.

Excelsior

My Excelsior PC has a wake_on_lan component associated with it See Here. This component is used to switch the PC off via a lovelace Entity Button.

Excelsior can be switched off from the lovelace interface; this uses a shell command and ssh. This switch off can be unconditional (forced) or by request. In the former case Excelsior will be shutdown immediately, in the latter case a request is sent and Exelsior shutd down when it is ready to do so.

Defiant

Defiant is an (ancient but still going strong) Netgear ReadyNAS Duo v2.

My Defiant NAS PC has a wake_on_lan component associated with it See Here. This component is used to switch the NAS off via a lovelace Entity Button.

Defiant can be manually and unconditionally switched off from the lovelace interface; this uses a shell command and ssh.

Start Automations Automation

When commissioning my Home Assistant system I experienced problems with automations firing in an unwanted manner during startup. To fix this I used the initial_state: false switch in the affected automation. The Start Automations Automation turns these automations on 20 seconds after start-up or restart but not after a reload automations operation (in other words, beware, all such automations are off following a reload automations operation).

You can’t perform that action at this time.