OH2.2 Sonos binding text items (currenttitle , currenttrack ...) BasicUI not refreshing text items

Hi everybody,

I got a problemwith my OH2.2 and the sonos binding. The basic stuff is working e.g. I can play/pause/next and previous track.

However on my BasicUI visu I do have as well for convenience added the currenttitle , currenttrack and state item. These items are not updating upon change like “next track” however.

I have searched the form quite a bit and found only one really related to OH2 which is around a known issue to add a [%s] to the items file…

I have as well checked the update on HabDroid and it does not update the text items either.

The log shows that it received a request for to play the next item… however I dont see any update for the Sonos_Kueche_CurrentTitle or the Sonos_Kueche_CurrentTrack item…

Anybody any idea. Perhaps this can be enforced useing a rule ? Below some extracts from my setup.

Cheers
bkumio

//sonos.things file
Thing sonos:PLAY1:kueche [udn="RINCON_5CAAFD43D91401400", refresh=60]
//extract from my sitemap file
Frame label="Sonos" {
					Default item=Sonos_Kueche_Controller
					Slider  item=Sonos_Kueche_Volume
					Switch  item=Sonos_Kueche_Mute
					Switch  item=Sonos_Kueche_LED
					Text    item=Sonos_Kueche_CurrentTrack
					Text	item=Sonos_Kueche_CurrentTitle
					Text    item=Sonos_Kueche_State
				}
// extract from the sonos.items file
Group Sonos <player>
Player Sonos_Kueche_Controller   "Controller"                          (Sonos) {channel="sonos:PLAY1:kueche:control"}
Dimmer Sonos_Kueche_Volume       "Volume [%.1f %%]" <soundvolume>      (Sonos) {channel="sonos:PLAY1:kueche:volume"}
Switch Sonos_Kueche_Mute         "Mute"             <soundvolume_mute> (Sonos) {channel="sonos:PLAY1:kueche:mute"}
Switch Sonos_Kueche_LED          "LED"              <switch>           (Sonos) {channel="sonos:PLAY1:kueche:led"}
String Sonos_Kueche_CurrentTitle "Now playing [%s]" <text>             (Sonos) {channel="sonos:PLAY1:kueche:currenttitle"}
String Sonos_Kueche_CurrentTrack "Now playing [%s]" <text>             (Sonos) {channel="sonos:PLAY1:kueche:currenttrack"}
String Sonos_Kueche_State        "Status [%s]"      <text>             (Sonos) {channel="sonos:PLAY1:kueche:state"}
//extract from the Openhab web based log viewer (fronttail)   
2018-01-13 12:00:23.713 [ome.event.ItemCommandEvent] - Item 'Sonos_Kueche_Controller' received command PREVIOUS

2018-01-13 12:00:24.278 [ome.event.ItemCommandEvent] - Item 'Sonos_Kueche_Controller' received command PREVIOUS

2018-01-13 12:00:25.222 [ome.event.ItemCommandEvent] - Item 'Sonos_Kueche_Controller' received command NEXT

2018-01-13 12:00:25.771 [ome.event.ItemCommandEvent] - Item 'Sonos_Kueche_Controller' received command NEXT

2018-01-13 12:00:26.823 [ome.event.ItemCommandEvent] - Item 'Sonos_Kueche_Controller' received command PREVIOUS

2018-01-13 12:11:45.856 [ome.event.ItemCommandEvent] - Item 'Sonos_Kueche_Controller' received command PLAY

2018-01-13 12:11:45.860 [vent.ItemStateChangedEvent] - Sonos_Kueche_Controller changed from PAUSE to PLAY

2018-01-13 12:11:48.610 [ome.event.ItemCommandEvent] - Item 'Sonos_Kueche_Controller' received command NEXT

2018-01-13 12:11:52.036 [ome.event.ItemCommandEvent] - Item 'Sonos_Kueche_Volume' received command 38

2018-01-13 12:11:52.042 [vent.ItemStateChangedEvent] - Sonos_Kueche_Volume changed from 8 to 38

2018-01-13 12:11:53.067 [ome.event.ItemCommandEvent] - Item 'Sonos_Kueche_Volume' received command 22

2018-01-13 12:11:53.072 [vent.ItemStateChangedEvent] - Sonos_Kueche_Volume changed from 38 to 22

2018-01-13 12:11:54.043 [ome.event.ItemCommandEvent] - Item 'Sonos_Kueche_Volume' received command 3

2018-01-13 12:11:54.049 [vent.ItemStateChangedEvent] - Sonos_Kueche_Volume changed from 22 to 3

2018-01-13 12:11:58.136 [ome.event.ItemCommandEvent] - Item 'Sonos_Kueche_Controller' received command NEXT

2018-01-13 12:12:00.337 [ome.event.ItemCommandEvent] - Item 'Sonos_Kueche_Volume' received command 42

In the log I only can see commands for Sonos_Kueche_Controller and Sonos_Kueche_Volume. First has no instruction to show the state, second sould work.

Hi Harry,

This is I guess part of the problem I guess :slight_smile: . But I think the web based openhab viewer does as well not display all stuff anyway ? I is there a way to set this one to “debug mode” ?

In addition I have just looked into the openhab.log file and found something perhaps related to that issue? It´s two times a "media data update error. My guess would be that this is one time the “currenttitle” and onetime the “currenttrack”…

Just a thought…

2018-01-12 18:32:48.232 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'sonos.things'
2018-01-12 18:32:48.236 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'sonos.things' is either empty or cannot be parsed correctly!
2018-01-12 18:32:48.253 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'sonos.things'
2018-01-12 18:32:48.541 [WARN ] [s.internal.handler.ZonePlayerHandler] - Cannot update media data for group member (Could not find handler for RINCON_949F3E721B4001400)
2018-01-12 18:32:48.545 [WARN ] [s.internal.handler.ZonePlayerHandler] - Cannot update media data for group member (Could not find handler for RINCON_5CAAFD7087E401400)

Where are you getting the music streamed from, I just check while streaming from Spotify. BasicUI as well as Habdroid are updating the title.

tried both… streaming from Spotify and streaming from my my local network… same result…:frowning:

Ah and one other thing.I do see for example in the log when I press the play button two things happening.
First an ItemCommandEvent followed by a ItemStateChangedEvent…

But when I do a “next song” I only have a ItemCommandEvent for the controller… there is no StateChange for the Sonos_Kueche_CurrentTrack item…

apprechiate any ideas…

2018-01-13 19:29:13.100 [ome.event.ItemCommandEvent] - Item 'Sonos_Kueche_Controller' received command PAUSE
2018-01-13 19:29:13.106 [vent.ItemStateChangedEvent] - Sonos_Kueche_Controller changed from PLAY to PAUSE
2018-01-13 19:29:14.095 [ome.event.ItemCommandEvent] - Item 'Sonos_Kueche_Controller' received command PREVIOUS
2018-01-13 19:29:16.377 [ome.event.ItemCommandEvent] - Item 'Sonos_Kueche_Controller' received command PREVIOUS
2018-01-13 19:29:16.567 [ome.event.ItemCommandEvent] - Item 'Sonos_Kueche_Controller' received command PREVIOUS
2018-01-13 19:29:17.341 [ome.event.ItemCommandEvent] - Item 'Sonos_Kueche_Controller' received command PLAY
2018-01-13 19:29:17.345 [vent.ItemStateChangedEvent] - Sonos_Kueche_Controller changed from PAUSE to PLAY

Did you already restart openHAB?
Did you already wipe the browser cache?

Hi Udo,

First I laughed , then I rebooted and then it worked!

So this means that one of the last Linux advantages over windows is gone. In case it doesnt work do a reboot :slight_smile: .

Seriousy again. Is this a common problem? Each time I change the sitemap, item, rules I now have to reboot to ensure that it is working ? Would be interested to hear from other people experiences…

But thanks again.
Mario

Probably just a restart of openHAB would have been sufficient. I don’t think an hardware reboot is required at all.

I made my statement above after creating an item and linking it to a so far unused channel “currenttitle”, all that on a running system. So I’d say it is not a common problem, such changes are possible on a running system.

As far as I remember, there is an open issue, that changing something at the sitemap, may lead to a sitemap which does not update in a proper way, but a restart of openHAB is sufficient

sudo systemctl restart openhab2.service

I think the problem here is, that the browser gets out of sync with the server, (reloading a *.sitemap should result in a reload of the sitemap in the browser) but that is just a guess.

yes, when I copy a new sitemap it always results in a refresh/reload of the browser window.
will try to test your restart suggestion, however my OH runs on a virtual machine on my QNAP NAS where a reboot only takes 1-2min anyway and then I am on the save side

I have this problem aswell any fixes?