The default MQTT integration for Home Assistant does not have support for Media Players. To get the speakers from sonos2mqtt into homeassistant you have to use this component (and enable discovery for sonos2mqtt)
- Install HACS (Home Assistant Community Store)
- Add a custom repository
- Look for the mqtt integration and click install
Custom repository details:
- Repository:
svrooij/home-assistant-mqtt-component/
- Category:
Integration
This integration and Sonos2mqtt are both build by me and work perfectly toghether. If you build a media player that also emits mqtt messages, you should be able to get it to work for your own media player with minor changes. Just send a PR
The latest beta version of Sonos2mqtt (3.2.0-beta.7) has support for sending the correct mqtt discovery messages. And works perfectly in combination with this home assistant integration.
Thousands of users are already using this application, according to the amount of Dockerhub pulls.
The most noteworthy feature is support for notifications, which actually restore playback after playing.
This integration is licensed under MIT license, so feel free to copy or adjust. I like contributions but use for your own good otherwise.
Start by installing the Dev Containers Extension
This repository has a custom crafted devcontainer that downloads the latest version of Home Assistant upon creation.
Let's say you changed something to this module and want to test your changes. Just press F5
(for the default debug action). It's that easy, a clean version Home Assistant instance will start on the local 8123
port, with the debugger connected.
Note The first time you start home assistant you'll have to do the regular onboarding flow. And the first time it might take a little longer to install all the requirements (they are not installed when we just install home assistant).
Additional debug sessions will go much faster, I promise.
This repository does not have the code for Home Assistant, it just has a requirements file that is uses to install home assistant upon container creation.
If you want to update your dev envirionment press CTRL + SHIFT + P
and execute Dev Containers: Rebuild container
.
You won't be able to commit your changes until you set your git information inside the container, but the script is configured to copy the GIT_NAME
and GIT_EMAIL
environment variables from your local system when the container is created.
You can also execute these commands afterwards if you already made changes and want to commit those.
git config --global user.name "your name"
git config --global user.email "[email protected]"