HomeAssistant - johnosbb/Automation GitHub Wiki
HomeAssistant 2021 VM Install
Configuring MQTT Broker
Add a new user, first turn on the advanced mode in your profile, then go to configurastion->users
Adding NodeRed
Install the Addon Configure as follows
Styling LoveLace
Installing in a Container
Controlling SonOff devices from HomeAssistant (Now Outdated)
Controlling Home Assistant
- sudo systemctl stop [email protected]
- sudo systemctl start [email protected]
- sudo systemctl restart [email protected]
Installing components in Hassbian (not HASIO)
- sudo apt update && sudo apt upgrade
- sudo hassbian-config upgrade hassbian-script
Installing mosquitto in Hassbian
- sudo hassbian-config install mosquitto
- Adding a user: sudo mosquitto_passwd -c /etc/mosquitto/pwfile yourusername
- sudo systemctl stop mosquitto.service
- sudo systemctl start mosquitto.service
- sudo systemctl restart mosquitto.service
- sudo systemctl enable mosquitto.service
- sudo systemctl status mosquitto.service
Controlling under systemd
- You need to add the following to create file called /lib/systemd/system/mosquitto.service
- Add this content to it:
[Unit] Description=Mosquitto MQTT Broker daemon ConditionPathExists=/etc/mosquitto/mosquitto.conf After=network.target Requires=network.target
[Service] Type=forking RemainAfterExit=no StartLimitInterval=0 PIDFile=/var/run/mosquitto.pid ExecStart=/bin/sh -c "/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf -d" ExecReload=/bin/kill -HUP $MAINPID Restart=on-failure RestartSec=2
[Install] WantedBy=multi-user.target
Configuration directory is at /etc/mosquitto/mosquitto.conf -d
- Installing Samba in Hassbian
- sudo hassbian-config install samba
Node Red (Install Guide)
- Run this script to update rasbian or hassbian image: bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)
- node-red-start
- Then point your browser to localhost:1880
- To start nodered as a service use: sudo systemctl enable nodered.service
Integrating with HomeAssistant
- Open nodered in a browser
- Got to the menu selector on the top right
- select mange pallette
- select the install tab
- select and install the 'node-red-contrib-home-assistant' package
- Restart nodered service with - sudo systemctl restart nodered.service
- See Here (HASS & Node-Red - Integrating Them Together)
Setting up DuckDNS
- mkdir duckdns
- cd duckdns
- vi duck.sh
- echo url="https://www.duckdns.org/update?domains=YOURDOMAINz&token=YOURTOKEN&ip=" | curl -k -o ~/duckdns/duck.log -K -
- chmod 700 duck.sh
- crontab -e
- */5 * * * * ~/duckdns/duck.sh >/dev/null 2>&1
- ./duck.sh
- cat duck.log, confirm* it says 'OK'
- sudo service cron start
Managing Systems Services
- systemctl list-units
Adding Audio services to Home Assistant
Guide to Configuring Home Assistant
Integrating with Owen Tracks