Skip to content

Doug-Wyman/RPi-Home-Assistant-Volume-control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MQTT Alsa Volume control for Home Assistant

Updated Jan 14, 2026

"Requires python3-alsaaudio, use apt to install.

If your Home Assistant uses the MQTT Integration, this is a program
to make a discover-able MQTT remote control of Alsa volume on a Raspberry Pi.
n the Raspberry Pi, the Python program runs at boot.
It is initiated by systemd and runs as the desktop user so it has access to the Alsa Mixer.
The MQTT discovery packet creates an instance of a “light” entity with a brightness of 0 to 100. Home Assistant

Installation

Create a folder where you want the program to reside.

Copy the three files ( rpi_vol_control.py, rpi-volume.service.template and setup.py)
Make that your current directory and run the python setup.py.
Setup will prompt you for a username, a unique entity name for Home Assistant,
the IP address or your MQTT broker and the location of the files. (filled in)
The app must run as the desktop user so it can see the ALSA controls..
Setup creates a service file in /etc/systemd/system.
It executes, “sudo systemctl daemon-reload” to refresy systemctl
It executes, “sudo systemctl enable rpi-volume.service” enabling the service
Finally it executes, “sudo systemctl start rpi-volume.service” to start the service

Homeassistant

Bring up the homeassistant settings and look for the unique name you used.
The MQTT discovery in homeassistant should have found and created the entity.

Notes:

Suggestions branches or anything to improve this is welcome.

About

Creates a Raspberry Pi volume control Entity in Home Assistant

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages