-
Notifications
You must be signed in to change notification settings - Fork 0
Installation on HaOS
The installation on HaOS is relatively simple, but involves the installation of a few additional add-ons. For this guide, it is assumed that:
- There is no other MQTT broker
- You have basic knowledge about editing configuration files
- Your Alpha 2 is configured with the hostname
EZR01A3AF.lan
. This can be replaced by an IP address if necessary. - HaOS is set up and running
- SSH will be used for the transfer of ezr2mqtt. You can also use SAMBA, but this is not covered by this guide. You need an SFTP client on the local machine to upload the required files. FileZilla is used during this guide.
- All passwords shown here are insecure and should not be used.
- Enabling Advanced Mode might be necessary (You can do this on your Profile page)
Head over to the add-on store (Supervisor -> Add-on Store) and install the following add-ons:
- Mosquitto broker
- File editor
- Terminal & SSH
The first add-on that needs to be configured is the MQTT broker. By default, it is not started and does not contain credentials for ezr2mqtt to connect. So head over to the add-on configuration page of of the Mosquitto broker and add credentials for ezr2mqtt. Add username and password for ezr2mqtt:
logins:
- username: ezr2mqtt
password: ezr2mqtt
customize:
active: false
folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false
Click Save
and restart the broker.
Then, the Mosquitto integration needs to be added to Home Assistant. Head over to Configuration -> Integrations and add the newly discovered MQTT integration.
Now, the installation of ezr2mqtt is a bit more complex. Make sure that the Terminal & SSH add-on and the File editor add-on are started (Supervisor).
For the transfer of ezr2mqtt, The SSH add-on needs a password set. The configuration for the SSH add-on looks like this:
authorized_keys: []
apks: []
password: homeassistant
server:
tcp_forwarding: false
Make sure to also configure the SSH port on the host - I used 22. Then, restart the add-on.
On your main machine, use an SFTP client to transfer ezr2mqtt to your add-ons folder. I prefer FileZilla and set it up like this:
Hostname: homeassistant.local
Port: 22
Username: root
Password: homeassistant
Then, connect to Home Assistant and navigate in the left pane to the downloaded ezr2mqtt files and on the right pane to /addons
. On the right, create a new folder called ezr2mqtt
and then upload the following files/folders to HaOS:
- pyezr
- Dockerfile
- config.json
- ezr2mqtt.py
- run.sh
Now, navigate on the right hand side to /config
and upload:
- ezr2mqtt.yaml
For the configuration of ezr2mqtt, we use the File editor add-on. Head over to Supervisor -> File editor -> Open web ui to start the file editor. Look for the file ezr2mqtt.yaml
and open it. Here, the add-on needs to be configured:
ezr:
- host: EZR01A3AF.lan
name: EG
prefix: eg
mqtt:
host: core-mosquitto
port: 1883
debug: false
username: ezr2mqtt
password: ezr2mqtt
discovery_prefix: homeassistant
topic: alpha2
general:
interval: 60
Adapt the host in the second line to your needs as well as the name and the prefix. If you are satisfied, save the file and start the add-on.
Usually, ezr2mqtt is not visible in the add-on menu. Reload the menu by going to Supervisor -> Add-on store and clicking the three-dot menu button in the top right corner. There, select Reload
to refresh the available add-ons. A new repository Local add-ons
should now pop up and ezr2mqtt should be visible. Install it from there and start it.
If everything was correct, the add-on starts. A new device with entities should be available in Home Assistant. Go to Configuration -> Integrations and check the MQTT integration.
If it doesn't work right away, check the log file of the add-on. You can set debug
to true
in ezr2mqtt.yaml
to get more output.