Sonos GET volume

Hi,

how can i get the volume of my sonos speakers?
I have serveral speakers and want to synchronize the volumes via a rule. That works already if i control the volume with a slider, but doesn’t, if somebody changes the volume “externally” for example via IR remote, because i don’t get the status update from the sonos binding.
Is there a possibility to “refresh” the volume periodly?

my items look like:

Dimmer dim_playbar_wohnzimmer “Lautstärke” { sonos="[playbar_wohnzimmer:volume]" }

Thanks!
Stef

okay i thought i got it with setting a sonos polling time in the openhab.cfg, but i didn’t. I received some updates:

2016-07-01 19:02:45 - dim_playbar_wohnzimmer state updated to 12
2016-07-01 19:02:47 - dim_playone_schlafzimmer received command 12
2016-07-01 19:02:47 - dim_playone_schlafzimmer state updated to 12
2016-07-01 19:02:47 - dim_playfive_kueche received command 12
2016-07-01 19:02:47 - dim_playfive_kueche state updated to 12
2016-07-01 19:02:49 - dim_playone_buero received command 12
2016-07-01 19:02:49 - dim_playone_buero state updated to 12
2016-07-01 19:02:49 - dim_playone_schlafzimmer received command 12
2016-07-01 19:02:51 - dim_playone_bad received command 12
2016-07-01 19:02:51 - dim_playone_bad state updated to 12
2016-07-01 19:02:51 - dim_playone_buero received command 12
2016-07-01 19:02:53 - dim_playone_bad received command 12

there is a rule, that any player follows the playbar in the living room if it is not too late at the day.

but that’s all, i don’t get any updates now again… any ideas?

Okay, i helped myself with a little indirection. In case someone else has the same problem, i will post it here:

Item:

Number sonos_get_mastervolume “Volume[%s %%]” { exec="<[/path to script/sonos_volume.sh:60000:REGEX((.*?))]" }

with the little bash script sonos_volume.sh:

#!/bin/bash
vol=$(curl -s http://sonos_master_ip:1400/status/jffs/localsettings.txt |grep EQ |grep -o “AMV[0-9]\+” |grep -o “[0-9]\+”)
echo “$vol”

and then my rule to synchronize the different players when the mastervolume changed:

rule "Sonos Lautstärken Synchronisation"
when
Item sonos_get_mastervolume changed
then
Thread::sleep(2000)
sendCommand(dim_playfive_kueche, sonos_get_mastervolume.state as DecimalType)
// Kein Verstellen innerhalb Badezimmer & Schlafräume zwischen 21:00 und 09:00 Uhr
if (now.getHourOfDay() >= 9 && now.getHourOfDay() < 21) {
Thread::sleep(2000)
sendCommand(dim_playone_schlafzimmer, sonos_get_mastervolume.state as DecimalType)
Thread::sleep(2000)
sendCommand(dim_playone_buero, sonos_get_mastervolume.state as DecimalType)
Thread::sleep(2000)
sendCommand(dim_playone_bad, sonos_get_mastervolume.state as DecimalType)
}
end

thanks anyway.