Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Problem: How to play webradio stream from Openhab
#1
Hi all,

I switched from Volumio to moode audio yesterday and it's running fine! 

I have one problem. I connected moode audio via MPD to Openhab. I can control Moode audio with no problems, for example: Play/Stop, Volume, and i can see the song info. It's done this way in Openhab:

{ mpd="ON:keuken:play, OFF:keuken: stop"} < [ON] = the command in openhab : [keuken] = the name of my Moode audio player : [play] is the mpd command.

I only use Webradio streams and no mp3's but i think there no big difference. My question is, how can i send an URL from a radio stream to Moode Audio? I also fiddled around with playlists but it's a pain in the ass in my opinion. I'm not sure how to call an item from the playlist to play. Or how to load a playlist I created. Not sure how to manage playlists with moode audio Gui, but I used good-old-fashion Winamp for this Smile.

Hope someone can help me setting this up!
Reply
#2
@djpsycho82

I don't know much about openHAB but I presume it has bindings to the mpc commands. You can see what they are from the command line of a moOde player. Example, on my player named moode3a:

Code:
pi@moode3a:~ $ mpc help
Usage: mpc [options] <command> [<arguments>]
mpc version: 0.31

Options:
 -v, --verbose                   Give verbose output
 -q, --quiet                     Suppress status message
 -q, --no-status                 synonym for --quiet
 -h, --host=<host>               Connect to server on <host>
 -P, --password=<password>       Connect to server using password <password>
 -p, --port=<port>               Connect to server port <port>
 -f, --format=<format>           Print status with format <format>
 -w, --wait                      Wait for operation to finish (e.g. database update)
 -r, --range=[<start>]:[<end>]   Operate on a range (e.g. when loading a playlist)

Commands:
 mpc                                                   Display status
 mpc add <uri>                                         Add a song to the queue
 mpc crop                                              Remove all but the currently playing song
 mpc current                                           Show the currently playing song
 mpc del <position>                                    Remove a song from the queue
 mpc play [<position>]                                 Start playing at <position>
...and so on for a total of 59 commands...


You can see how playlists are dealt with by reading these commands and mapping what you want into openHAB if it hasn't been already.

Note especially "mpc add <uri>". 

[added after posting]

My second thought is that openHAB may instead have bindings which use the "MPD protocol".

Regards,
Kent
Reply
#3
Thnx for the help!

I figured out the mpc commands from moode, but they are not the same as I can use in Openhab. For instance, I can use MPC Play 1 through the console, and the first item in the playlist is starting to play / the player is switching to the first stream, Great! But when I use it in openhab >  mpd="NUMBER:keuken:play" it just doesn't play or switch song.

As I don't have a lot of webradio streams, the only thing I want to build is to play song 1,2,3,4 etc. through a command like [playsongid 1,2,3]

Hope someone has an idea how to solve this.
Reply
#4
Not sure why, but I solved the problem without knowing how though. I didn't change the code in openhab and didn't change anything in Moode audio, I think. But the last must be the problem. I think something went wrong with the playlist.

I'm glad it's working now!
Reply


Forum Jump: