I want to create a + and - button in Habpanel beside the volume slider for my sonos playbar.
The playbar is added by automatic discovery, I have a dimmer linked to an item for the volume:
For the Habpanel I made a item to use as a trigger switch for the buttons, so for the + button I made:
I found a rule in another topic who tried to get the same result: Sonos volume increase/decrease rule? [SOLVED]
So I copied > paste that rule and filled out my items, but the only thing that is happening is that the volume get set to 1, this is the log:
2019-11-15 22:33:10.287 [ome.event.ItemCommandEvent] - Item ‘SonosPlaybarLivingRoom_Volume’ received command 1
2019-11-15 22:33:10.292 [nt.ItemStatePredictedEvent] - SonosPlaybarLivingRoom_Volume predicted to become 1
And this is the rule I use:
rule "Sonos volume plus en min" when Item SonosPlaybarLivingRoom_Volume_up received command ON then var Number V = SonosPlaybarLivingRoom_Volume.state as DecimalType var Number H = V + 1 if (H>65) H = 65 postUpdate(SonosPlaybarLivingRoom_Volume, H) sendCommand(SonosPlaybarLivingRoom_Volume, H) end
For some reason the var Number .state from the volume item don’t seem to get stored, any ideas?