Step 8: Entities

Let’s have a look at what devices can be controlled and connected to Home Assistant with the Z-Wave integration. First you need a Z-Wave hub/controller, in this case an AEON Labs ZW090 Z-Stick Gen5 EU is connected directly via USB into the Raspberry Pi running the Home Assistant software.

To enable Z-Wave within the Home Assistant you’ll need to go to the Integrations section and configure the device.

Configuration -> Integrations

To complete the configuration you’ll need the:

  • usb_path: most likely /dev/ttyACM0
  • network_key: if you want to make use of Z-Wave Plus and the extra security it can provide. Due to the extra bandwidth and battery requirement this is only recommended for certain devices such as locks.

You can generate the network key following the steps included at Home Assistants own documentation they also have a great getting started section with links to many useful resources.

Now Z-Wave compatible devices can be added, managed and removed via the newly enabled Z-Wave configuration panel.

Configuration -> Z-Wave

With this guides initial goal of automatic lighting focus will be given on motion sensors and switches. in this case the following specifics will be utilised:

  • Fibaro FGMS001-ZW5 Motion Sensor – a motion, temperature and luminance sensor
  • Everspring AD142 Plug-in Dimmer Module – a dimmer based pass-through plug socket

These devices have simple pairing functions and can be added via the Z-Wave Configuration panel, with some devices you need to ensure your are registered to receive the sensors outputs through the ‘group associations’. Home Assistant should do this for you automatically, but your experience could differ depending on the controller and devices.

Next: Step 9: Dash via Footstep 3: Rename

Step 7: Senses

Home automation relies on ‘senses’ to be able to understand the situation and apply your rules to. Home Assistant achieves this through Integrations. Devices have entities which need integrating to Home Assistant in order to take advantage of them.

A quick example: Android IP Webcam (available through the Play Store) can be integrated into Home Assistant through the ‘configuration.yaml’ file. In this case there is an old Android phone with a static IP on the local Wi-Fi network running the IP Webcam software.

android_ip_webcam:
  - host: 192.168.10.100
    port: 8080
    name: 'Cam 1'
    sensors:
      - battery_level
      - battery_temp
    switches:
      - torch
      - video_recording 

Add the above configuration and restart Home Assistant to enable two sensors and two switches. The Home Assistant integration documentation shows all the available sensors.

Generally speaking integration devices are going to either connect directly to the host running Home Assistant or wirelessly. When you work out what kind of home automations you want to achieve you can then work out what solutions are going to be best. In this series the simple idea of automating the light switches to not need to manually ever switch a light on or off is the initial goal.

There is loads of choice when it comes to wireless devices that you can connect for home automation. If you are trying to do this in a complete cloud free way it can be tricky, so many systems come with their own cloud account to allow you to remotely manage. This is unnecessary with Home Assistant as this acts as the ‘cloud’ for your home automation giving you one interface to control everything. So you just need to have the devices connect to Home Assistant and then only allow access to Home Assistant externally via a web browser and/or the mobile app. This external and mobile access will be covered in a mini-stride soon, it can also enable your phone as a location tracker for automation.

For this guide and setup it was decided upon utilising Z-Wave wireless mesh technology over Wi-Fi to completely eliminate the potential for cloud based connected devices, ensuring the system will still operate and be locally controllable without Internet connectivity. This requires a Z-Wave hub or controller to manage the mesh network that the devices form.

Next: Step 8: Entities

Step 6: Components

Home Assistant accepts add-ons and custom components to expand the functionality and provide complete customisation by being able to write a new component if one does not exist already.

Custom components are uploaded to a folder within the ‘config’ directory of the Home Assistant installation and add integrations, custom cards and themes. There is a system available to make this process easier called the Home Assistant Community Store or HACS for short, which allows you to install community made components in a couple of clicks.

Before we get to HACS lets look at the built in Add-On store available via the Supervisor, from here you can install updates, take snapshots of the system and install items that expand Home Assistant itself, such as dns services, reverse proxy, smb and ftp access and many more.

Some add-ons can open ports and access to your system and depending on your specific setup on how in-secure this can make you. Thankfully Home Assistant make this very clear with badges detailing the requirements and security level of the add-on. This even covers items such as the ftp and smb as they allow access to the ‘config’ folder’, but you can simply stop the service, ensure that it is not set to run at startup of Home Assistant and only run it when you need to use it.

HACS itself needs to be added via the manual method and requires a GitHub access token, but has well documented the process on their site hacs.xyz, but the run down is:

  1. download HACS from github
  2. upload the contents of hacs.zip to the custom_configuration folder within your ‘config’ folder
  3. restart Home Assistant
    Configuration -> Server Controls -> Server management -> Restart
  4. add HACS from the Integration panel
    Configuration -> Integrations
  5. enter your GitHub access token
  6. access HACS
    HACS

As mentioned, HACS allows you to add integrations, plugins and themes with just a few clicks and prompts you if a restart of Home Assistant is needed to complete the install of the new component to take advantage of.

Next: Step 7: Senses