This guide will show you how to manage multiple instances of room-assistant around your house easily. This is especially interesting as it allows you to define common configuration and update all instances at once. Additionally, it takes care of running all the installation steps for you.
- Recent version of ansible (opens new window) (2.8+) installed on your computer/laptop
Setup your Linux boards (e.g. Pi 3, 4 or Zero W) to the point where you can access them over the network with SSH. If you want a quick reference on how to do this for Raspberry devices you can take a look at the first section of their respective quickstart guides in the documentation.
Clone the repository containing the room-assistant playbook:
git clone https://github.com/mKeRix/ansible-playbooks.git
Switch to the folder that you just cloned and run
ansible-galaxy install -r requirements.ymlto download the dependencies.
Create a file
hosts.ymlin the cloned folder. It should contain a list of network addresses for your devices under
192.168.1.10) and your room-assistant configuration. You can find a more detailed reference of the available options in the repository README (opens new window) and the Ansible documentation (opens new window). Below is an example that configures a generic
room_assistant_global_config, which is partially overridden for the
all: hosts: 'living-room.local': room_assistant_config: global: integrations: - homeAssistant - bluetoothClassic - omronD6t - gpio gpio: binarySensors: - name: Motion Sensor pin: 17 deviceClass: motion 'bedroom.local': vars: room_assistant_version: latest room_assistant_global_config: global: integrations: - homeAssistant - bluetoothClassic homeAssistant: mqttUrl: mqtt://homeassistant.local:1883 mqttOptions: username: room-assistant password: secretpass bluetoothClassic: addresses: - 'xx:xx:xx:xx:xx:xx'
Execute the playbook with
ansible-playbook -i hosts.yml -u pi room-assistant.ymlto install the required dependencies and room-assistant as a service on all of the hosts in your inventory file. Note that some tasks will take a while on the first run, for example the "Install room-assistant" step. Be patient and let it finish.
Congratulations, you have installed room-assistant across a cluster of devices and can manage it from a central point now! 🎉 Whenever you want to change something you can simply edit your
hosts.ymlfile as needed, for example by changing
room_assistant_versionto update. Then re-run
ansible-playbook -i hosts.yml -u pi room-assistant.ymlto apply your changes.