[solved] Squeezebox control example

Hi everybody,

Very new to OpenHAB, trying to wrap my head around various bits and pieces…
Can anyone give a quick example how to user the control-thingy of the squeezeplug binding to pause/unpause using HABPanel?

Thank you in advance,
Mikael

Hi Mikael,

do you have already added the player as things in Paper UI ? If so than you can add a Switch Item with thing id pause / unpause and control this item over Habpanel.

Kay

This should do it:
"The widget will control anything that is linked your Dimmer and Player Items"

Oh yes, should have added that I have perfect control over the player in Paper UI. I’ve also gotten volume control working in habpanel, but can’t seem to sort out the control-item

In Paper UI you have to click on “Show More” on your things configuration. Then you get this:

Kay

Hmm… i never got the playPause chanell to work right.
I’m using the Player Item/control chanell which in addition it gives you a nice Player in HabDroid, and i think this is what you need for a HABPanel player widget with Play/Pause/Next/Prev support:

Player	squeeze1Control "Player" <play> { channel="squeezebox:squeezeboxplayer:xxx:yyy:control" }

1 Like

That’s it. Thank you! Never noticed that “Show more” before. There are just so many features… Now to find a way to convert the now playing seconds to minutes and seconds nicely…

To give something back to this great community. After quite literally banging my head against the wall for a few hours, I managed to do what I wanted, which is a play/pause icon. Here’s my code:

<div ng-if="itemValue('Makuuhuone_PlayPause')!='ON'">
  <button class="btn btn-xs" style="background: #424242; color: #0DB9F0" ng-click="sendCmd('Makuuhuone_PlayPause', 'ON')">
  	<span style="font-size: 48px" class="glyphicon glyphicon-pause"></span>
  </button>
</div>

<div ng-if="itemValue('Makuuhuone_PlayPause')=='ON'">
  <button class="btn btn-xs" style="background: #424242; color: #76899E" ng-click="sendCmd('Makuuhuone_PlayPause', 'OFF')">
  	<span style="font-size: 48px" class="glyphicon glyphicon-play"></span>
  </button>
</div>

Maybe there’s a way to reference the default colors in another way, but I couldn’t find it. Also (in Chrome at least) HABPanel draws an annoying area around the icon when clicking.

Mikael