I am using shairport to airplay music in a whole-home audio solution. Shairport supports MQTT, and I am able to get shairport to publish topics for status. I am also able to control Shairport via MQTT.
Not sure if you found a solution already, but I made a custom component for this since I’m also using a MQTT enabled media player and I couldn’t really find any alternative.
If you’d like to try it out (and hopefully tell me if it works for you) that would be great!
It’s not so much the media player itself. The media player’s called Musicbee and it supports plugins. So I made a MQTT Remote plugin. Basically just publishes current song info and listens for commands through MQTT.
Not sure if you tried it already, but I finally understood what you meant by the example in your original post and it made sense for me to implement the volume_up and volume_down independently of the volume_set.
Anyways with your example, I think the configuration.yaml would look something like this
I pushed the changes to the repo. Also, if vol_up and/or vol_down are used, the volume slider (aka. the volume_set service) becomes disabled. Just something to note
Volume slider doesn’t work because I don’t think shairport allows for volume setting via a command anyway. But the volume up/down is working! Thank you for this!
I’m a noob at HA and mqtt and have a following issue:
I have an ESP32 based Webradio which supports mqtt and I managed to configure the information of the station playing as well as the controls to play next/previous station using hass-mqtt-mediaplayer. The card on my dashboard shows up and everything is in order!
I’ve been using vol_up and vol_down commands and they seem to work correctly.
However, I would like to use the volume slider as my webradio accepts a command “volume=[value]”.
How do I define this value to be sent via mqtt? Could someone please help me with this one?
I have a sample mqtt command for volume change to be used: $ mosquitto_pub -h broker.hivemq.com -t espradio -m volume=80
As mentioned above, I would like to send an mqtt.publish command “volume=[value from the volume slider on the card]”.
All other commands which are described in the code work correctly.
Also, I noticed that if I change the volume using the buttons, the slider itself updates to a correct volume setting when received an mqtt message “volume=[current volume value]” from the radio.
Would it be possible to fetch the current slider value and send it to the radio?
Just started using MusicBee and love it.
Can this be done without running a mqtt server or is that required.
I use the MusicBee remote app on Android and it works without mqtt server.
Thanks…
I have since successfully created a media player entity from my MB instance that also has all basic capabilities (cover art, skipping, volume control).