Manages power of a Home Assistant entity based on hardware playing state, to control speakers, amps, etc...
Warning
This script only support ALSA cards, not Bluetooth connections. However, any type of software that opens and closes the ALSA card are supported. Snapcast is not supported as it opens the card at startup and never close it even if no source is connected.
- Put the script somewhere (in your home for example) and modify variables to enter credentials.
- Make it executable :
chmod +x /home/user/home-assistant-moode.sh- Put
home-assistant-moode.servicefile in/etc/systemd/system/ - Modify the path and the user/group that correspond to the script's path and your user/group you are connecting with, in this service file.
- Enable and start the service:
sudo systemctl daemon-reload sudo systemctl enable home-assistant-moode.service sudo systemctl start home-assistant-moode.service