Hello, im new to openhab and looking for a good solution to start and stop musicplayback on a remote computer.
The remote computer is running ubuntu and currently i am using an exec binding in my items file.
With this i can start a radiostream with no problem, but i cant exit the stream so if i have several of those bindings tied to different radiostreams they will run ontop of eachother.
I have tried to add “OFF:ssh user@192.168.0.105 killall mpg123” but i does not stop the stream.
How do i solve this the best way? Could it be solved with using the “screen” command in linux so that each exec command goes to the same session? Maybe run a script that always sends a kill command just in case something is already playing on the computer?
Thank you for fast reply! I did try to install and get mpd up and running a few days ago but encountered so many problems (a quick google search tells me that im not the only one). I will give it another go and see if i can get it started, I had a look at the bindings in openhab and its exactly what i am looking for.
Another possibilty would be to install Kodi (the binding for it is called XBMC), but just for listening to music I’d prefer MPD, as it is much smaller in terms of memory and CPU usage.
I have mpc installed, when i try to play a song located in the directory i specified in mpd.conf i get an error:
When i start mpd it all seems fine
BUT, when running the “mpc play yve.mp3” i can see that mpc is starting the mpd as root so i get two instances of mpd running (one under my user and one under root)
I can also see log entries from mpc in the “root mpd logfile”.
How can i make mpc to not use the root account to connect to mpd?
To play a song, it must be part of the mpd database. It can be created by issuing “mpc update” on command line. mpd will then search for new songs in the directory specified in mpd.conf.
After creating the database you probably should use a browser based mpd client to do further testing, as it will be easier to navigate the database. If you have another ubuntu machine I can also recommend Ario as a graphical client. It will also allow testing of radio streams.
Thank you for your answers. I have now managed to controll the remote machine with mpc localy on the machine (through ssh) and i can also controll it with mpd client on my phone. But not with openhab.
I have added mpd : ALL in hosts.allow
Netstat shows “192.168.0.105:6600 : LISTEN” so that looks correct.
I cant see any errors in the openhab logfile only this: