-
1Download and edit
Download the files from here:
https://hackaday.io/project/186946-heos-mqtt-translation#menu-files
Edit the MQTT_config.py with the details of your own MQTT-broker;
Edit the Heos_MQTT_daemon.py file with the details of your HEOS systems. You can let it do anything you want.
Edit the Heos_MQTT.service file with the details of your Raspberry System.
Upload the files to your Raspberry Pi, somewhere in your home directory for instance (should match content of the service file)
Make the Heos_MQTT_daemon.py executable: "chmod +x Heos_MQTT_daemon.py"
Test the edited Heos_MQTT_daemon by running it: "./Heos_MQTT_daemon.py"
-
2Check on Home Assistant
On the first run, all buttons are created in Home Assistant. With the python script still running, test the buttons and functions. If you're happy, stop the python script and clap your hands. There is much rejoicing!
-
3Make the python script run as a service and start at bootup
Copy Heos_MQTT.service into /etc/systemd/system as root, for example:
sudo cp Heos_MQTT.service /etc/systemd/system/Heos_MQTT.service
Once this has been copied, you have to inform systemd that a new service has been added. This is done with the following command:
sudo systemctl daemon-reload
Now you can attempt to start the service using the following command:
sudo systemctl start Heos_MQTT.service
And check if its running with:
sudo systemctl status Heos_MQTT.service
This should show something like:
Stop it using following command:
sudo systemctl stop Heos_MQTT.service
When you are happy that this starts and stops your app, you can have it start automatically on reboot by using this command:
sudo systemctl enable myscript.service
sudo systemctl enable myscript.service
And once more start it and check if its running
-
4Configure Home Assistant
Your buttons should be added in Home Assistant. Add the buttons to your desired dashboard.
The buttons are also easy to use in scripting.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.