Open iot-root opened 6 months ago
For homeassistant:
You need a mqtt broker either on the gardyn pi or homeassistant.
To install on the pi run
sudo apt-get install mosquitto mosquitto-clients
Add mqtt-broker username and password:
sudo mosquitto_passwd -c /etc/mosquitto/passwd <USERNAME>
Note: make sure to update the .env file which is used by
config.py
formqtt.py
Run sudo nano /etc/mosquitto/mosquitto.conf
and change the following lines to match:
allow_anonymous false
password_file /etc/mosquitto/passwd
listener 1883
Restart the service
sudo systemctl restart mosquitto
you just need to edit the .env
Next run the ./bin/setup.sh
, this will install all OS dependencies, install the python libs, and run services pigpiod, mqtt.service
Ensure the pigpiod, mqtt, and broker daemon is running
sudo systemctl status pigpiod
sudo systemctl status mqtt.service
sudo systemctl status mosquitto
Example:
installing
apt install -y mosquitto
Setup password mosquitto_pub -h localhost -t testtopic -m "Hello, MQTT!" -u "yourusername" -P "yourpassword"
setup the
.env
with port and broker host