[SOLVED] OpenHab2 and MPD

OK, so can I assume it is installed? or should I use the console ui to install it?

After adding the jar file you should see it in PaperUI > Configuration > Bindings list with all the other binding you have installed. You may need to restart OH after adding the jar file.

sudo systemctl stop openhab2

sudo systemctl start openhab2

So I did stop/start the service (systemd setup here). And I go to Configuration -> Bindings but I do not see the MPD in the list.

I’ve checked under /var/log/openhab2/ and I cannot find any mention of any error/warning related to the jar or mpd… how can I increase the verbosity to find out what it did with the new addon?

First check the permissions with ls -al usr/share/openhab2/addons and make everything is correct. You can post the output if your not sure what the permissions should be.

Well these are the contents:
-rw-r–r-- 1 openhab openhab 106226 Jan 30 08:53 org.openhab.binding.mpd-1.14.0-SNAPSHOT.jar

For my jar files I have -rw-rw-r-- openhab openhabian. Use sudo openhabian-config then select Apply Improvements, Fix permissions that should handle any permission issues. If not you may have to do it manually.

OK, let met try (fix, restarting, rechecking).

Unfortunately the binding still missing. I have to point out (if it makes any difference) this is not a raspberry setup. I’m using a Linux PC (archlinux) and I’m using OpenHab2 version 2.4.0.

It make a difference how you installed OH. Was it manually or via apt-get?

I did install it using the package manager. For this particular package it is using a ‘recipe’ of sorts:
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=openhab2
this is the metadata for the recipe:
https://aur.archlinux.org/packages/openhab2/

Check the console and see if the binding is listed. sudo openhab-cli console then at the prompt, openhab> bundle:list

OK, some good news:

openhab> bundle:list | grep -i mpd
234 x Active x 80 x 1.14.0.201901300742 x openHAB MPD Binding

Yes, that is good news.:+1:

Now check if you have an mpd.cfg file in /etc/openhab2/services

Nope, not yet. Should I will look for a sample and drop it there (restart, et. al)… do I need also to edit addons.cfg?

The mpd.cfg file should be auto created by the binding. A restart of OH may be what you need if you haven’t done so already.

If your adding all your binding via files then yes add this binding to the addons.cfg and a restart may be needed. If all your other binding are installed via PaperUI then do not edit the addon.cfg file. I think you have to choose either PaperUI or files, for adding bindings, but not both.

@robml Edit: Something else you may need to check from the console is openhab runtime compat1x is installed. If not then install using this command:
feature:install openhab-runtime-compat1x

Sorry, I forgot to answer this part earlier. From the console you can increase the log level to DEBUG or TRACE for more log info needed to troubleshoot. See the doc’s for how to

@robml I found no open issues for MPD on github so hopefully you have it installed and working. If so please mark the topic solved by clicking the square box on the post that provided the solution and editing the title to start with [Solved].

If your still having problems installing the binding I have only two other suggestions. First is try an older jar file and see if it will install then use the console to update the binding (bundle update). Here’s a list with several MPD jar files.
https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/binding/org.openhab.binding.mpd/

Second is a work around using mqtt found here.

Awesome, thanks a lot! Great help! :slight_smile:

I can see some traces regarding the addon listing services and getting registered. Now I would like to add “things” but the binding still missing in paper ui, should I try just using the basic UI?

openhab.log:2019-02-03 20:20:29.082 [DEBUG] [org.apache.felix.configadmin ] - Registering service [org.osgi.service.event.EventHandler, org.osgi.service.cm.ManagedService, id=348, bundle=234/file:/usr/share/openhab2/addons/org.openhab.binding.mpd-1.14.0-SNAPSHOT.jar]
openhab.log:2019-02-03 20:20:29.083 [DEBUG] [org.apache.felix.configadmin ] - Scheduling task ManagedService Update: pid=[org.openhab.mpd]
openhab.log:2019-02-03 20:20:29.084 [DEBUG] [org.apache.felix.configadmin ] - Running task ManagedService Update: pid=[org.openhab.mpd]
openhab.log:2019-02-03 20:20:29.084 [DEBUG] [org.apache.felix.configadmin ] - [ManagedService Update: pid=[org.openhab.mpd]] scheduled
openhab.log:2019-02-03 20:20:29.084 [DEBUG] [org.apache.felix.configadmin ] - Updating service org.openhab.mpd with configuration org.openhab.mpd@-1
openhab.log:2019-02-03 20:20:29.108 [DEBUG] [mpl.info.InfoBundleTrackerCustomizer] - Ignore incorrect info null provided by bundle org.openhab.binding.mpd

1.x bindings do not use things so you will only need to configure an items file for the binding. See the documentation for further detail on how to setup the binding to work with OH.

Just a side question:
Is it possible to use the items defined for BasicUI (mpd controls for instance) into the PaperUI? or for that matter within a dasboard?

Thanks again!

Hi there,
maybe it would help someone as the mpd installation is not really that straightforwrd, especially for beginners, so sharing my experience

Downloaded https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/binding/org.openhab.binding.mpd/1.14.0-SNAPSHOT/org.openhab.binding.mpd-1.14.0-SNAPSHOT.jar
and placed it into
/usr/share/openhab2/addons/

restarted the openhab2

now I can see that it is installed
openhab> bundle:list | grep -i MPD
191 │ Installed │ 80 │ 1.14.0.201905200013 │ openHAB MPD Binding

but when I try to activate it I get the following error
openhab> bundle:start 191
Error executing command: Error executing command on bundles:
Error starting bundle 191: Could not resolve module: org.openhab.binding.mpd [191]
Unresolved requirement: Import-Package: org.openhab.core.binding

Checked that
The “Configuration>System>Add-on Management>Include Legacy 1x bindings” is enabled.

but the diagnostics specifies some unsatisfied requirements.

openhab> bundle:diag 191
openHAB MPD Binding (191)

Status: Installed
Unsatisfied Requirements:
osgi.wiring.package; filter:="(osgi.wiring.package=org.openhab.core.binding)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.openhab.core.events)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.openhab.core.items)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.openhab.core.library.items)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.openhab.core.library.types)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.openhab.core.types)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.openhab.model.item.binding)"
Declarative Services

So it seems that openhab-runtime-compat1x it wasnt installed.

openhab> feature:list | grep comp
openhab-runtime-compat1x │ 2.5.0.M1 │ │ Uninstalled │ distro-2.5.0.M1 │ Compatibility layer for openHAB 1 add-ons

Once I installed it everything worked.

1 Like