MPC/D alternative

@1117 I would try the following:

Make sure that you have installed (via console): feature:install openhab-runtime-compat1x
Drop the latest *.jar in your ..\addons\ folder

change ..\conf\services\mpd.cfg to:

server.host=192.168.1.131
server.port=6600

set log level to DEBUG for the MPD Binding: log:set DEBUG org.openhab.binding.mpd

check logs and reply :slight_smile:

Done as you told. Openhab startup log with the problem in bold is listed below. I cheсked mpd.cfg many times.

18:02:39.918 [DEBUG] [org.openhab.binding.mpd ] - BundleEvent STARTING - org.openhab.binding.mpd
18:02:39.924 [DEBUG] [ab.binding.mpd.internal.MpdActivator] - MPD binding has been started.
18:02:40.075 [DEBUG] [nhab.binding.mpd.internal.MpdBinding] - MPD binding connecting to players
18:02:40.085 [DEBUG] [org.openhab.binding.mpd ] - ServiceEvent REGISTERED - {org.osgi.service.event.EventHandler, org.osgi.service.cm.ManagedService}={event.topics=openhab/command/*, service.pid=org.openhab.mpd, component.name=org.openhab.binding.mpd, component.id=184, service.id=318, service.bundleid=215, service.scope=bundle} - org.openhab.binding.mpd
18:02:40.113 [DEBUG] [org.openhab.binding.mpd ] - ServiceEvent REGISTERED - {org.openhab.model.item.binding.BindingConfigReader, org.openhab.binding.mpd.MpdBindingProvider}={component.name=org.openhab.binding.mpd.genericbindingprovider, component.id=185, service.id=317, service.bundleid=215, service.scope=bundle} - org.openhab.binding.mpd
18:02:40.127 [DEBUG] [org.openhab.binding.mpd ] - BundleEvent STARTED - org.openhab.binding.mpd
18:02:40.128 [ERROR] [org.apache.felix.configadmin ] - [org.osgi.service.event.EventHandler, org.osgi.service.cm.ManagedService, id=318, bundle=215/file:/usr/share/openhab2/addons/org.openhab.binding.mpd-1.10.0-SNAPSHOT.jar]: Unexpected problem updating configuration org.openhab.mpd
java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)[:1.8.0_121]
at java.lang.Integer.parseInt(Integer.java:592)[:1.8.0_121]
at java.lang.Integer.valueOf(Integer.java:766)[:1.8.0_121]
at org.openhab.binding.mpd.internal.MpdBinding.updated(MpdBinding.java:613)[215:org.openhab.binding.mpd:1.10.0.201702080211]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1461)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1417)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109)[3:org.apache.felix.configadmin:1.8.12]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]

Maybe: delete the mpd.cfg
recreate it without using notepad (use another text editor), Type the text, don’t copy-paste.
There may be some kind of character (or new line feed) that stops the binding from parsing properly the config data.

Nothing. I am using nano editor. It looks like very simple mistake. Ok, thank you. I will try to find.

Finally It works! Openhab was reinstalled from the scratch.
feature:install openhab-runtime-compat1x is very important!

1 Like

Hello,
I have the almost same problem … now work only volume slider. I receive correct value from volume and i can increase / decrease volume but no working play stop next prev or current info about Title song. I use mpd binding to make am online radio on raspberry pi. I make all possible combination and until now nothing work to play/stop commands. Any idea ???
Thanks.

ok … i fix the problem … not from binding … it’s from mappings (used in oh1.8) and there are different concept about mappings on oh2 … so i can confirm MPD Binding work on oh2
Thanks!

Hey guys,

I’m really new to Linux/Raspberry and also Openhab. I’ve a Raspberry 3 B Model running with the newest version Raspbian Jessie. I played with it for a while and now I need your help. I tried some basic stuff like TV remote control, remote powersupply control over 433Mhz which worked fine. Now i want to add a music player. I found this program called mopidy, which plays music from local file and also spotify. You can access it via webbrowser or mpd client. I installed mopidy and got it to work. I could control the music with the program mpc. So I guess the mpd from mopidy worked properly. After that I searched how to include mpd into openhab2 and found this thread. After trying and failing I reinstalled my Raspberry and OH2 because I think I messed up. My problem is, that I cant get the binding into OH2. Can someone help me please with a little tutorial.
As I said, I’m really new to this so please explain it for noobs :smiley:
Thanks

Hi @Udo_Hartmann,

Would the Logitech media Server / Squeezebox binding combo render MDP obsolete?

There seem to be a few ready-made stacks such as Max2Play or Pi Musicbox (which uses Mopidy as the music server). In your opinion are these worthy contenders to work with OH2?

And then there’s Kodi which is referenced in the video openHAB 2 UI-driven Setup which can be used along with the Kodi binding, perhaps running on a Plex Media Server. That looks like a nice clean approach.

For newcomers this is a bewidering array of options.

My aim is to set up a music system based on Google Play Music and to avoid local music altogether, and at the same time to use Kodi / Netflix to avoid locally stored movies, and to control them in OpenhHAB.

I’ve touched on this in this thread but I’m yet to put the pieces together. I’ll post up the information when I’ve got something useful working.

At the moment, for my music setup, the LMS and Squeezebox binding works fine, and controlled well using BubbleUPnP on Android, but it is reliant on plugins to be able to talk to Chromecast Audio, but I can’t get the Squeezebox-googlemusic working so I’m looking for an easier option :wink:

I can confirm that using the following setup the MPD binding works under OH2:

  • MPD Binding 1.11 (downloaded jar from cloudbees and placed it in addons\)
  • OpenHAB 2.1 (running in docker from ‘official’ image)
  • installed (via console): feature:install openhab-runtime-compat1x (there is no feedback after executing the command from the command line)
  • created a config file in conf\services\mpd.cfg specifying the host ip and port
  • created the necessary items/updated my sitemap using the information from the wiki

i am also comming from oh1.8 to oh2 (now i start to regret it)
I copied the mpd 1.11.0 jar from the link posted above.

my mpd.cfg:
living.host=runeaudio.local
living.port=6600

my log:

2017-10-05 20:39:40.277 [INFO ] [nhab.binding.mpd.internal.MpdBinding] - Reconnect player 'living’
2017-10-05 20:39:40.297 [ERROR] [nhab.binding.mpd.internal.MpdBinding] - Error connecting to player ‘living’ with config MPD [host=runeaudio.local, port=6600, password=]
org.bff.javampd.exception.MPDConnectionException: [2@0] {password} wrong number of arguments for "password"
at org.bff.javampd.MPD.(MPD.java:378)[239:org.openhab.binding.mpd:1.11.0.201710050110]
at org.openhab.binding.mpd.internal.MpdBinding.connect(MpdBinding.java:683)[239:org.openhab.binding.mpd:1.11.0.201710050110]
at org.openhab.binding.mpd.internal.MpdBinding.reconnect(MpdBinding.java:775)[239:org.openhab.binding.mpd:1.11.0.201710050110]
at org.openhab.binding.mpd.internal.MpdBinding.executePlayerCommand(MpdBinding.java:200)[239:org.openhab.binding.mpd:1.11.0.201710050110]
at org.openhab.binding.mpd.internal.MpdBinding.internalReceiveCommand(MpdBinding.java:156)[239:org.openhab.binding.mpd:1.11.0.201710050110]
at org.openhab.core.binding.AbstractBinding.receiveCommand(AbstractBinding.java:97)[176:org.openhab.core.compat1x:2.1.0]
at org.openhab.core.events.AbstractEventSubscriber.handleEvent(AbstractEventSubscriber.java:45)[176:org.openhab.core.compat1x:2.1.0]
at org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:415)[6:org.apache.karaf.services.eventadmin:4.0.8]
at org.apache.felix.eventadmin.impl.tasks.HandlerTask.run(HandlerTask.java:90)[6:org.apache.karaf.services.eventadmin:4.0.8]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_144]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_144]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_144]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_144]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_144]
2017-10-05 20:39:40.312 [WARN ] [nhab.binding.mpd.internal.MpdBinding] - Player ‘living’ was not found or is not connected

i tried to add the parameter password as “”, null, didn"t helped.

Can someone give me a hint?
Thanks

Put an actual value in the password field would appear to be the thing to do…

thanks for fast feedback, if i place a “dummy” text as password, then I get the error that the password is incorrect, which is true, because mpd has no password set.

Well, then you already know the solution. :wink:

I really hope that you are not suggesting to set a password for mpd.

You don’t have to setup a password for sure, but if you ever did setup a password, you have to delete it two times:

  1. delete the password in mpd.cfg, by using the # in front of the password line
  2. delete the configuration with karaf console:
ssh openhab@localhost -p8101
(password is habopen)

config:edit org.openhab.mpd
config:property-delete password

2nd step is necessary because openHAB will leave unset parameters as they are, when rereading a *.cfg file.

Thanks for the tips, i followed them and still no success
{password} wrong number of arguments for “password”

I also rebooted everything

what do you get when entering

config:property-list

in karaf console? (change context to org.openhab.mpd as mentioned in my last posting)

here is the content:

openhab> config:edit org.openhab.mpd
openhab> config:property-list
amplifier.host = runeaudio.local
amplifier.password =
amplifier.port = 6600
living.host = 192.168.250.7
living.password =
living.port = 6600
service.pid = org.openhab.mpd

i finally solved, thank you very much for help.
i had to delete the property like : config:property-delete living.password
and then config:update and config:cancel

i restarted Openhab2 service and now it works as expected.

again, thank you.