English
Create and configure Home Assistant stack
We will configure the Home Assistant Docker stack and bring the stack up through Arcane. The stack consists of the following containers:
- Home Assistant: Home automation engine.
- Z-WaveJS: Z-Wave device driver.
Steps
- If you are not going to use Z-Wave devices, edit the script:
nano ./scripts/create_home_assistant_folder.shand delete the last 3 lines related tozwavejs. Save and exit withCtrl + X, Y, Enter. - Run:
./scripts/create_home_assistant_folder.shto generate the containers' directories on the SSD. - If you are going to use Zigbee or Z-Wave usb dongles, make sure to connect them to your server in an usb port.
- Run:
ls /dev/serial/by-id/and write down the paths of your usb dongles. For example/dev/serial/by-id/usb-Itead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_V2_12345678901234567890123456789012-1234-port0. - Edit the stack file:
nano ./files/home-assistant-stack.yml. - Replace
TZ=America/New_Yorkwith your system time zone. You can use this list as a reference: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. - Set the attribute
ipv4_addressin thehomeassistantcontainer with an IP in the non-assignable range of the DHCP. For example 192.168.1.11. - Under the
homeassistantcontainer, underdevices, replace the device/dev/serial/by-id/usb-zigbee_donglewith the path to your Zigbee dongle. If you don't have a Zigbee dongle, delete thedevicessection from this container. - Under the
zwavejscontainer, underdevices, replace the device/dev/serial/by-id/usb-zwavejs_donglewith the path to your Z-Wave dongle. If you don't have a Z-Wave dongle, delete the entire container. Notice that the device is being mapped to:/dev/zwave. This is important because it is the default path the service will look for. If you don't map it, you will need to manually configure the path of the device. - Copy all contents of the file to the clipboard. Save and exit with
Ctrl + X, Y, Enter. - Add stack in Arcane from the browser.
- Access Arcane through https://arcane.myhome.duckdns.org.
- Click "Projects" on the left menu and create a new project.
- Name it "home-assistant" and paste the content of the home-assistant-stack.yml that you copied to the clipboard and create the stack. From now on, modifications to the stack must be made through Arcane and not in the file.
- Access Home Assistant through https://homeassistant.myhome.duckdns.org.
- Use the wizard to create a user account and password. It is again recommended to use Bitwarden for the same.
- Configure the name of the Home Assistant instance and your data and preferences with the wizard.
- Choose whether you want to send usage data to the Home Assistant page.
- Finish the wizard.
- Navigate to "Settings" > "System" > "Network".
- Under
HTTP serverinReverse proxy, enableTrust X-Forwarded-For. - Click "Add Trusted proxies" and add
172.21.1.0/24. Repeat with172.21.4.0/24. We allow proxies from the172.21.1.0/24and172.21.4.0/24networks which are thehomeassistantandainetworks respectively that we configured in the stack in Arcane. - Under
Network adapter, disable "Autoconfigure" and enable the adapter with IP192.168.1.10/24. Do not disable the other adapter. - Click on "Save".
- Configure Restful Command for notifications.
- Edit Home Assistant configuration:
nano /Apps/homeassistant/configuration.yaml. - Add the following section to the end of the file. Replace the
{your_token_here}with the Home Assistant token you generated in Gotify andmyhomewith your domain registered in DuckDNS. We register a restful command that communicates with Gotify to send notifications.ymlrest_command: notify_through_gotify: url: "https://gotify.myhome.duckdns.org/message?token={your_token_here}" method: "post" content_type: "application/json" payload: '{ "title": "{{ title }}", "message": "{{ message }}", "priority": {{ priority }} }' - Save and exit with
Ctrl + X, Y, Enter. - Back in Home Assistant, navigate to
Developer tools. - Press
Restart. Now you can create automations that call this service and get notifications through Gotify.
- Edit Home Assistant configuration:
- Configure Voice Assistant.
- Navigate to "Settings" > "Devices & Services".
- Click "Add Integration".
- Search for "Wyoming Protocol" and select it.
- Set Host to
whisper. - Set Port to
10300. - Click "Submit".
- Click "Wyoming Protocol".
- Click "Add Service".
- Set Host to
piper. - Set Port to
10200. - Click "Submit".
- Go back to "Integrations".
- Click "Add Integration".
- Search for "Ollama" and select it.
- Set Url to
http://ollama:11434. - Click "Submit".
- Click "Ollama".
- Click the "..." button next to "http://ollama:11434".
- Click "Add conversation agent".
- Select the model you wish to use. The recommended is
qwen2.5:7b-instruct. - Enable "Assist" under "Control Home Assistant".
- Click "Submit".
- If "Ollama Conversation" does not show "1 service and 1 entity", click the same "..." as before and click "Reload".
- Navigate to "Settings" > "Voice Assistants".
- Select "Home Assistant".
- Set "Conversation agent" to
Ollama Conversation. - Set "Speech-to-text" to
faster-whisper. - Set "Text-to-speech" to
piper. - You can change the Language for the assistant, Speech-to-Text and Text-to-Speech. You can also change the voice for Text-to-Speech.
- Click "Update".
- Configure Zigbee Automation (Only if you have Zigbee dongle).
- Navigate to "Settings" > "Devices & Services".
- Home Assistant should autodetect and suggest you to add the "Zigbee Home Automation". Add the integration.
- Select from the dropdown the device path of your Zigbee dongle and click "Submit".
- You can now register your Zigbee devices, but that is out of the scope of this guide.
- Configure Z-Wave Automation (Only if you have Z-Wave dongle).
- Access in another tab to https://zwavejs.myhome.duckdns.org.
- Click the settings icon.
- Under
General, enableAuth. This will log you out. - Log back in using
adminandzwaveas credentials. - Click the lock pad icon to change the password. It is again recommended to use Bitwarden for the same.
- Back in the settings page, Under
Z-Wave, generate the 6 Security Keys using the randomizer icon. Backup these keys in a safe location like Bitwarden. - Choose your RF Region.
- Under
Home Assistant, enableWS Serverand set theServer Hosttozwavejs. - Click "Save".
- Back in Home Assistant tab, navigate to "Settings" > "Devices & Services".
- Click "Add integration".
- Search for
Z-Waveintegration. - Enter
ws://zwavejs:3000and click "Submit". - You can now register your Z-Wave devices, but that is out of the scope of this guide.
TIP
If you want to use a small external device for voice commands similar to Alexa, check this guide to build you own Wyoming Satellite: https://www.youtube.com/watch?v=Bd9qlR0mPB0.
TIP
You can test your new voice assistant from your mobile phone with the Home Assistant app. From the Dashboard, click the "..." at the top and select "Assistant" to launch the Assistant.
TIP
You can install Home Assistant Community Store (HACS) if you want more integrations. From Arcane containers tab, click the Home Assistant container, go to the Shell tab. Run the following command: wget -O - https://get.hacs.xyz | bash -. If you are not confortable running blind commands, you can go to the oficial site: https://hacs.xyz/. Next, restart Home Assistant, go to Settings > Devices & services and add the HACS integration. Follow the instructions to finalize the installation.