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?
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