MPD binding 2.5.8 not detecting things and items

  • Platform information:
    • Hardware: Raspi 3
    • OS: openhabian stable (updated 5 Sept 2020)
    • Java Runtime Environment: openhabian default
    • openHAB version: 2.5.8
  • Issue of the topic: after following this openhab 2.5.8 MPD binding docs, I do not see any MPD things in paper UI, and MPD items (now playing, etc) is not shown on basic UI either

mpd.things

Thing mpd:mpd:music "Volumio" @ "Livingroom" [ ipAddress="192.168.1.77", port=6600 ]

mpd.items

Switch morning_music "Morning music"	Switch	morning_music					
							
Player mpd_volumioliving_player "Player"	Player	mpd_volumioliving_player	"Player"		(Group_VolumioLiving)		{ channel = "mpd:mpd:music:control" }
Dimmer mpd_volumioliving_volume "Volume [%d %%]" 	Dimmer	mpd_volumioliving_volume	"Volume [%d %%]"		(Group_VolumioLiving)		{ channel = "mpd:mpd:music:volume" }
Switch mpd_volumioliving_stop	Switch	mpd_volumioliving_stop	"Stop"		(Group_VolumioLiving)		{ channel = "mpd:mpd:music:stop" }
String mpd_volumioliving_album "Album [%s]" 	String	mpd_volumioliving_album	"Album [%s]"		(Group_VolumioLiving)		{ channel = "mpd:mpd:music:currentalbum" }
String mpd_volumioliving_artist "Artist [%s]" 	String	mpd_volumioliving_artist	"Artist [%s]"		(Group_VolumioLiving)		{ channel = "mpd:mpd:music:currentartist" }
String mpd_volumioliving_name "Name [%s]" 	String	mpd_volumioliving_name	"Name [%s]"		(Group_VolumioLiving)		{ channel = "mpd:mpd:music:currentname" }
Number mpd_volumioliving_song "Song [%d]" 	Number	mpd_volumioliving_song	"Song [%d]"		(Group_VolumioLiving)		{ channel = "mpd:mpd:music:currentsong" }
Number mpd_volumioliving_song_id "Song Id [%d]" 	Number	mpd_volumioliving_song_id	"Song Id [%d]"		(Group_VolumioLiving)		{ channel = "mpd:mpd:music:currentsongid" }
String mpd_volumioliving_title "Title [%s]"	String	mpd_volumioliving_title	"Title [%s]"		(Group_VolumioLiving)		{ channel = "mpd:mpd:music:currenttitle" }
Number mpd_volumioliving_track "Track [%d]"	Number	mpd_volumioliving_track	"Track [%d]"		(Group_VolumioLiving)		{ channel = "mpd:mpd:music:currenttrack" }

on sitemap, I only use
Group item=Group_VolumioLiving

Do your xxx.thngs and xxx.items files load? Look in your openhab.log to find out.
Does the binding do anything? Look in your openhab.log to find out.

Looks to me like your Item definitions are all broken, with repeated parts.

Thank you for your pointer. However, the mpd.items is actually loaded normally as I can see in sitemap that showing Group members of Group_VolumioLiving.
Even after I fixed it, the item state is not loaded. No error message on error log after saving the mpd.items (currently set to INFO)

Switch	morning_music					
						
Player	mpd_volumioliving_player	"Player"		(Group_VolumioLiving)		{ channel = "mpd:volumio:music:control" }
Dimmer	mpd_volumioliving_volume	"Volume [%d %%]"		(Group_VolumioLiving)		{ channel = "mpd:volumio:music:volume" }
Switch	mpd_volumioliving_stop	"Stop"		(Group_VolumioLiving)		{ channel = "mpd:volumio:music:stop" }
String	mpd_volumioliving_album	"Album [%s]"		(Group_VolumioLiving)		{ channel = "mpd:volumio:music:currentalbum" }
String	mpd_volumioliving_artist	"Artist [%s]"		(Group_VolumioLiving)		{ channel = "mpd:volumio:music:currentartist" }
String	mpd_volumioliving_name	"Name [%s]"		(Group_VolumioLiving)		{ channel = "mpd:volumio:music:currentname" }
Number	mpd_volumioliving_song	"Song [%d]"		(Group_VolumioLiving)		{ channel = "mpd:volumio:music:currentsong" }
Number	mpd_volumioliving_song_id	"Song Id [%d]"		(Group_VolumioLiving)		{ channel = "mpd:volumio:music:currentsongid" }
String	mpd_volumioliving_title	"Title [%s]"		(Group_VolumioLiving)		{ channel = "mpd:volumio:music:currenttitle" }
Number	mpd_volumioliving_track	"Track [%d]"		(Group_VolumioLiving)		{ channel = "mpd:volumio:music:currenttrack" }

This is my sitemap that loaded screenshot below while my volumio is actually playing something:

sitemap souliss1 label="Main Menu old"
{
    Group item=Group_VolumioLiving
}

Please check the thing state. You can check it either using Paper UI by clicking on the thing or using the console, e.g. with

openhab> smarthome:things list | grep mpd

This should give a better understanding what the problem might be.

Furthermore, if your thing is

Thing mpd:mpd:music  [ ipAddress="192.168.1.77", port=6600 ]

then your item channel should be:

Player	mpd_volumioliving_player "Player" (Group_VolumioLiving) { channel = "mpd:mpd:music:control" }

and not “…mpd:volumio:music…”.

1 Like

Thank you for this pointer, It must be missed when I change from
Thing mpd:volumio:music back to
Thing mpd:mpd:music

The thing is not even shown on paperUI nor openhab-cli.

Assuming the binding is installed, that would suggest your xxx.things file is not loaded. Perhaps you introduced an error when editing. What does your openhab.log say about it?

Can you check whether the mpd addon is installed correctly, by using the console:

openhab> bundle:list | grep -i mpd
285 │ Active │  80 │ 2.5.8   │ openHAB Add-ons :: Bundles :: MPD Binding

If the addon is active, I would try to temporarily add an mpd thing using the Paper UI just to exclude problems with the things file. If the thing is visible, online and the channels work, you can go back to the textual configuration.

I do have this result on console:

openhab> bundle:list | grep -i mpd                                                                                                                                                                                                     
271 │ Active  │  80 │ 2.5.8                   │ openHAB Add-ons :: Bundles :: MPD Binding

and this is the paperUI result on thing and item using channel “Media Title” generated from paperUI where I have triple checked IP address and music is actually playing:

Music Player Daemon 
MPD Song Title  -

But you said you had no Things in PaperUI? Where are you looking now?

It was a cache and tmp folder problem. Openhabian shows 2.5.8 on ssh login, but welcome page (openhabian.local:8080) shows 2.5.7. After I cleared it, paper UI shows the item. Sorry for not informing it on previous post.

What is the status of the thing? Is it online? If it is not, you can find a more detailed status message, if you navigate to configuration -> thing -> mpd thing. This should give you a hint what the problem might be.

If the thing is online, I need log files with the log level set to DEBUG or TRACE to further investigate your problem. Use the console to set the log level:

openhab> log:set TRACE org.openhab.binding.mpd

According to https://volumio.org/technical-overview, volumio uses an MPD Emulation Interface, which may not be fully compatibe with the MPD protocol. I haven’t checked that in detail and I also didn’t try volumio myself. This might be the reason, why the channels are not updated.

mpd.things

Thing mpd:mpd:music “Volumio” @ “Livingroom” [ ipAddress=“192.168.1.77”, port=6600 ]
Apparently this is wrong syntax, it should not have “Thing” in things file. Now the thing is available in paperUI. It wasn’t there back then. After reinstalling openhab and updating things file, it shows up.

I don’t think log below will help, but here it is:

2020-10-29 00:21:07.443 [INFO ] [server.session.ServerUserAuthService] - Session openhab@/127.0.0.1:55200 authenticated

2020-10-29 00:21:17.306 [INFO ] [port.EventAdminConfigurationNotifier] - Sending Event Admin nofification (configuration successful) to org/ops4j/pax/logging/Configuration

2020-10-29 00:22:07.497 [DEBUG] [nternal.protocol.MPDConnectionThread] - insert command 'stop' at position -1

2020-10-29 00:22:09.313 [DEBUG] [nternal.protocol.MPDConnectionThread] - insert command 'play' at position -1

2020-10-29 00:22:10.716 [DEBUG] [nternal.protocol.MPDConnectionThread] - insert command 'play' at position -1

==> /var/log/openhab2/events.log <==

2020-10-29 00:22:10.927 [me.event.InboxUpdatedEvent] - Discovery Result with UID 'miio:generic:036E06C8' has been updated.

==> /var/log/openhab2/openhab.log <==

2020-10-29 00:22:11.348 [DEBUG] [nternal.protocol.MPDConnectionThread] - insert command 'play' at position -1

==> /var/log/openhab2/events.log <==

2020-10-29 00:32:10.890 [me.event.InboxUpdatedEvent] - Discovery Result with UID 'miio:generic:036E06C8' has been updated.

2020-10-29 00:33:02.925 [me.event.InboxUpdatedEvent] - Discovery Result with UID 'mihome:sensor_plug:7811dc64e075:158d000282b27c' has been updated.

==> /var/log/openhab2/openhab.log <==

2020-10-29 00:40:28.635 [DEBUG] [nternal.protocol.MPDConnectionThread] - insert command 'next' at position -1

2020-10-29 00:40:29.955 [DEBUG] [nternal.protocol.MPDConnectionThread] - insert command 'play' at position -1

2020-10-29 00:40:30.529 [DEBUG] [nternal.protocol.MPDConnectionThread] - insert command 'previous' at position -1

2020-10-29 00:40:31.136 [DEBUG] [nternal.protocol.MPDConnectionThread] - insert command 'pause' at position -1

2020-10-29 00:40:34.442 [DEBUG] [nternal.protocol.MPDConnectionThread] - insert command 'stop' at position -1

2020-10-29 00:40:35.111 [DEBUG] [nternal.protocol.MPDConnectionThread] - insert command 'play' at position -1

==> /var/log/openhab2/events.log <==

2020-10-29 00:40:39.960 [me.event.InboxUpdatedEvent] - Discovery Result with UID 'mihome:sensor_plug:7811dc64e075:158d000282b27c' has been updated.

It can be controlled with Android mpd clients, Kodi mpd client, etc. I don’t see why it can’t be read nor controlled by OH.

You are right, the log doesn’t help. Unfortunately it is missing relevant information. The log from the start of the binding/thing is required. At startup the connection to the mpd server is established and a line with “…opening connection to…” appears. Can you create an mpd thing in PaperUI and send the full log?

Furthermore, I still don’t know whether the thing is online or not. If the thing appears in PaperUI this does not yet mean the thing is online.