OH2 Squeezeplayer with Radio/Playlist Select Button and dynamic visibility

I started playing around with HABPanel, and as it’s the Future™ here is my take on a Squeeze Player Control, based on @Murpher’s MusicControl (Kudos for creating this one) together with a simple Radio select widget.
If on Pause, it displays a configurable temperatur item(or anything else you fancy), if on Play it displays Title and artist.
On Play:

On Pause:

The widgets will work with the example items and rules listed here. The Config labels should speak for themselves. NEXT and PREVIOUS are fixed; no need to set. Here you go:
SqueezeMusicControl.widget.json (4.4 KB)
RadioSelect.widget.json (1.8 KB)

Hope some will find this usefull,
P.S.: uploaded newer version of Radioselect: Now chosen station name gets highlighted, also there is a 2px space between the station rows. More shiny:


Glad it was of use

Great one! I’ve moved your thread to the new HABPanel Examples category.

Thanks! :blush:
Maybe the original Alarm clock thingy would fit here as well?

Sure, just move it :wink: @ysc might be happy to some action in this new category :wink:


It’s true it’s not gotten much love until now. In fact, there are other threads in the “Add-ons > HABPanel” category which could easily be moved into “Examples”, like this one:

and eventually this big old thread (even though there’s a lack of explanations on how to achieve the results in the screenshots):

Btw: Great work @Oli!

Thank you sir :slight_smile:

LOL…didn’t even know i could do that :pensive:

1 Like

I have moved (and renamed) both. It would be amazing if you could try to write a few more (the same goes for @Oli) . Also it might be a good idea to ask everyone who has posted a solution in the “big old thread” to open independent threads with their solution today.

P.S. let me know if more moderator’y actions are needed :wink:

nice widget :slight_smile:
is it possible to bind an internet strem to it?
for example: I want to hear http://hr-hr3-live.cast.addradio.de/hr/hr3/live/mp3/128/stream.mp3 on my tablet if i push the HR3 button.
Thanks, Kersten Tams

Gude Kersten :slight_smile:
Indeed you can Stream HR 3 without problems.
Look at the example code further up; HR3 is allready there(and YOU FM, FFH, planet radio…). It should work with cut&paste.

ok, it doesn’t. So I asked, because I am shure, I do some thing wrong.
I copied the “items” section of your example to a file radio.items in the folder items. I copied the “rules” section of your example to rules/radio.rules.
I added the two widges and don’t know, what I had to write in the RadioSelect widged. “Name” I think doesn’t matter but what to write at “RadioName”?
I want to comprehend the example so I changed nothing.
In SqueezeMusicControl I bind the items as I understand it:

You see, I am very new to OH2 and Habpanel. May be there are stupid questions, but I hope you can be patient and show me the way :wink:

The “Name” in the select widget is the unique player name, in the example given it is “1”.
So if you have, for example one player in kitchen and one in bath, you would name them e.g. squeezeBathVolume and squeezeKitchenVolume and the widgets would be named “Bath” and"Kitchen"
In the SqueezeMusicControl widget you did everything right :+1:
I assume you edited this part: :xx:yy: of the items to reflect your setup?

If not, this is most likely your problem. You need to go to paperUI, configuration, things and replace :xx:yy: with values from your player thing. It will look something like this in paperui:

If you did this and it still doesn’t work, please provide more info. Is it just the select widget which is not working, or is the radio control also unresponsive? What is happening in openhab and events log when you press the button?

Thanks for your help!
ok, I see the problem. I installed the sqeezebox binding, but I don’t have a squeezebox player. And so I can’t see a player in habpanel things. After I read many about squeezebox player, server bridge and so on, I am totally confused.
If I understand it right, I must have a player installed (squeeze lite for example). I installed OH2 on a RPi3. I control it with a tablet in an other room.
I want to hear radio in this room through the loud speakers of the tablet (its the kitchen, so quality is good enough).
If I understand it right, that is with squeezebox not possible, right?
Its not as easy as copy a link in a browser, right?

No, that is definitly possible. On the rpi, you Can Install squeezelite and
on the Tablet (Android?!) Squeezeplayer. Both will be detected by the
binding and then you Can Control them. I Use Old phones and the Most cheap
40€ Tablet in my rooms with squeezeplayer ( on Play Store 5€) and ist is
working great.

Am 06.06.2017 10:14 nachm. schrieb “Kersten Tams” <bot@community.openhab.org

:grinning: at least I got it to run. But only the SqeezeMusicControl. But that is not so sad, because I want to hear FFN and NDR2 not HR3 or FFH :wink:
Now I use four normal Button widges to choose my favorite Radio stations. As the action I send the stream url to the player.
Thanks alot for your help.

No sweat. If everything else works exept the select widget, it’s most likely because the items aren’t persisted - that is a prerequesit for the logic to work. But since you found another solution…

Hi there!
i made some modifications to this great widget and now i wanted to remove the table borders (above title and artist).
But i don’t even get where they come from?
Could you help me out, @Oli ?


Hi & sorry for late reply. in case you havn’t found it yet, its this table;

  <table class="table">
    <td class="text-left" ng-if="itemValue(config.status_item) =='PLAY'">Title: <strong>{{itemValue(config.title_item)}}</strong></td>
    <td class="text-center" ng-if="itemValue(config.status_item) !='PLAY'"><strong>{{config.temp_name}}</strong></td>
    <td class="text-left" ng-if="itemValue(config.status_item) =='PLAY'">Artist: <strong>{{itemValue(config.artist_item)}}</strong></td>
    <td class="text-center" ng-if="itemValue(config.status_item) !='PLAY'"><strong>{{itemValue(config.temp_item)}} °C</strong></td>
  <div class="btn-group">
    <label class="btn-pad btn-lf" ng-click="sendCmd(config.action_item,('PREVIOUS'))"><i class="glyphicon glyphicon-step-backward"></i></label>
  	<label class="btn-radius btn-danger" ng-if="itemValue(config.status_item) !='PLAY'" ng-click="sendCmd(config.action_item,'PLAY')"><i class="glyphicon glyphicon-play glyphicon-text"></i></label>
    <label class="btn-radius btn-warning" ng-if="itemValue(config.status_item) =='PLAY'" ng-click="sendCmd(config.action_item,'PAUSE')"><i class="glyphicon glyphicon-pause glyphicon-text"></i></label>
    <label class="btn-pad btn-rt" ng-click="sendCmd(config.action_item,('NEXT'))"><i class="glyphicon glyphicon-step-forward"></i></label>
 <div class="div-slider" ng-init='model={"item": (config.volume), "floor": 0, "ceil": 100, "step":(config.step)}'>
  <widget-slider ng-model="model" />

i guess you could either set the border to be invisible, or remove the table alltogether. I’s personally try setting invisible first…

somehow i was able to set them invisible! =)
but now i’m stuck on RadioSelect.
i deleted all my old items and linked the channels to new ones, copied your rules etc. but when i use the widget absolutely nothing happens (on openhab.log or events.log)?


groups and rule are exactly like in your opening post here.
RadioName in Widget is “Kuchl”

what am i missing?