MPD binding not able to use playsongid with moode audio

Hi all,

I switched from Volumio to moode audio because of some nice features with moode audio. I did use the volumio binding before but that doesn’t work with moode audio. So I have to use the MPD binding.

The good part is, the binding works. I can control moode audio, play/pause/next/previous/track&artist info. But I have one problem.

I want to control moode audio through Habpanel and want to choose radio stationstreams. According to the MPD binding information I have to control the playsonginfo through an Number item:

Number RadioStation “Radio station” { mpd=“NUMBER:kitchen:playsongid” }

I created an Selection item in my Sitemap to test, but it doens’t work. I get an error in the logfile:

Error while executing 'PLAYSONGID' command: [50@0] {playid} No such song

I can imagine the problem lies within moode audio. Not sure why it doesn’t work, i have a playlist with some items within Moode audio. I tried the moode audio forum, but not sure if someone is able to help me from there. Because i’m already a couple of days figuring this thing out, I was hoping someone had the same construction at home and have a sollution for this.

If someone has another idea it’s also great, as long as i can choose between the radio stations. For instance, send an URL via a selection Item, but I don’t know how to do that also. :frowning:

For now, I created a Next and Previous button in habpanel and it works, but I can’t see what’s next en previous before i choose the station, so i have to remember on what position the station was in the playlist, not a big problem but the sollution is not Openhab worthy :wink:

Hope someone can help me setting this up!

Well the problem is solved. I don’t really know why, it seems like nothing has been changed. The code in Openhab is exactly the same as mentioned above.

I’m not aware i changed something in Moode audio but the code doesn’t lie so i have to find the reason in Moode audio.

Hi, Wanting to switch to moode audio also and i only need a couple of radio stations available through openhab. Can you explain how you got this working? Do the radio stations have songid’s?

Stu

Yes no problem. I found the problem, forgot to mention it in this post. The problem with the MPD binding (version 1.15) is that when you configure and MPD client (Moode audio) and it’s not reachable, the working MPD client (another moode audio setup) isn’t working also, the MPD just doesn’t send the commands.

The best way i found to control moode audio is via HTTP:
(You have to have a playlist in moode audio, first song is 1, second is 2, etc.)

I send the Number Item to a variable numStation and enable the play switch to “press play” in moode audio.

My MPD.CFG file:

mpd:keuken.host=x.x.x.x
mpd:keuken.port=6600

My items (keuken, means kitchen in Dutch ;), it’s the MPD thing for moode audio)

Switch RadioPlay “Radio” [ “Switchable” ] { mpd=“ON:keuken:play, OFF:keuken:stop” }
Switch RadioNext “Next” [ “Switchable” ] { mpd=“ON:keuken:next” }
Switch RadioPrev “Prev” [ “Switchable” ] { mpd=“ON:keuken:prev” }

The rule to send the command (x.x.x.x is the ipadress from the moode audio setup):

sendHttpGetRequest(“http://x.x.x.x/command/?cmd=play%20”+numStation)

I’m not sure how control the playlist in moode audio via items. Would be nice to read the length of the playlist, so you can be sure when your at the end. For me it’s not a real problem. I filled the playlist with webradio stations and they never change, so I always know how much radio stations there are.