Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time

Home Assistant

An Ansible Role that installs Home Assistant. Installation tasks are derived from the manual installation instructions.

Tested with the help of Molecule and Docker for:

  • Debian 9 Stretch
  • Debian 10 Buster
  • Debian 11 Bullseye
  • Ubuntu 18.04
  • Ubuntu 18.10
  • Ubuntu 19.04
  • Fedora 28
  • Fedora 29
  • Fedora 30
  • Centos 7

Used in real life only with Raspbian (Debian 9 Stretch).


  • ansible >= 2.6

Role Variables

  • hass_version: The version of Home Assistant which will get installed. By default it is not defined and automatically gets the lastest version available during installation. For Debian 9 if not specified hass_version is set to 0.95.4 (the last supported version with Python 3.5). If a newer hass_version for Debian 9 should be installed you have to make sure to have a supported version of Python installed before.
  • hass_user: The linux user running Home Assistant. Defaults to hass.
  • hass_virtualenv: The directory the virtual environment for Home Assistant gets installed to. Defaults to /opt/hass.
  • hass_config: The directory the configuration for Home Assistant is stored in. Defaults to /home/hass/.homeassistant.
  • hass_w1 Enables One Wire for Raspberry Pis. Usefull if you connect One Wire sensors directly to your Raspberry Pi and want to add them to Home Assistant. By default it is disabled (false). If enabled a restart of the system is needed after the playbook has been deployed.
  • hass_bluetooth: Enables bluetooth support for Raspberry Pis and installs necessary packages (e.g. for EQ3 Bluetooth thermostat). By default it is disabled (false).
  • hass_pip_packages: List of pip packages which should be installed in addition. E.g. for EQ3 Bluetooth thermostat "python-eq3bt" is needed. By default it is not defined.
  • hass_apt_packages List of apt packages which should be installed in addition. Might be useful if you use Home Assistant components which depend on additional packages (e.g. FRITZ!Box Net Monitor). By default it is not defined.



Example Playbook

- hosts: hass
    - hass
- hosts: hass
    hass_user: "pi"
    hass_virtualenv: "/srv/hass"
    hass_w1: true
      - libxslt-dev
      - libxml2-dev
      - python3-lxml
     - hass


Copyright (c) 2018 Johannes Krausmueller - ISC License

Author Information

Johannes Krausmueller (