Created
October 21, 2019 11:57
-
-
Save mplinuxgeek/742e548246c2f3383abf2301d06a781b to your computer and use it in GitHub Desktop.
Installing hassio on Fedora
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo dnf install jq curl avahi dbus-daemon docker cockpit-docker | |
$ sudo systemctl enable docker | |
$ sudo systemctl start docker | |
$ sudo firewall-cmd --permanent --add-port=8123/tcp | |
$ sudo firewall-cmd --permanent --add-port=1883/tcp | |
$ sudo firewall-cmd --reload | |
$ sudo curl -sL https://raw.githubusercontent.com/home-assistant/hassio-installer/master/hassio_install.sh | bash -s | |
$ sudo docker pull koenkk/zigbee2mqtt | |
$ sudo docker pull eclipse-mosquitto | |
$ sudo docker run -t --restart always --name=mosquitto -p 1883:1883 eclipse-mosquitto | |
$ sudo docker run -t --restart always --name=zigbee2mqtt --device=/dev/ttyACM0 koenkk/zigbee2mqtt | |
We need to change the address of the mqtt server in zigbee2mqtt's configuration file, before we do that we need to know what the IP is, run the below command to get the IP address of the mosquitto container. | |
$ sudo docker inspect --format '{{ .NetworkSettings.IPAddress }}' mosquitto | |
Theres a few ways to do this, I'm going to show 2 methods, the first is quite simple, it executes a command inside the container using sed which should exist in most containers: | |
$ sudo docker exec -it zigbee2mqtt /bin/sed -i 's/localhost/172.17.0.4/g' data/configuration.yaml | |
Another method which could be easier if you have to make multiple changes is to start an interactive shell, in the case of the zigbee2mqtt container it doesn't have bash installed so we use the sh shell instead. | |
$ sudo docker exec -it zigbee2mqtt /bin/sh | |
Now we are inside the container, all command executed from here happen inside the container, lets open the configuration file in vi: | |
# vi data/configuration.yaml | |
Find the below line: | |
server: 'mqtt://localhost' | |
Change it to: | |
server: 'mqtt://172.17.0.4' | |
Then write and save the file by pressing Escape, then type :wq and press enter. | |
At this point you can logout by pressing ctrl+D together or typing exit and pressing enter. | |
To activate this change we now just need to restart the container: | |
$ sudo docker restart zigbee2mqtt | |
At this point we have docker running on a Fedora Linux server, with separate containers for hass.io, mosquitto and zigbee2mqtt. | |
You can now log into Home Assistant | |
sudo docker cp Hass_io_Saturday_10_Aug_2019.tar homeassistant:/config/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment