SqueezeControl custom widget

Yes because you accidentually added spaces after the Names while configuring the widget.
Better check things twice before saving the settings…

Nice that you got it to work now :wink:

You saved me the whole weekend

Thanks again :wink:

1 Like

Feel free to show some love and click on the :hearts: below the posts which helped you the most :wink:
Have a nice weekend!

Hi,

I’m unable to install the widget, openhab.log message:

2022-03-30 10:02:40.898 [ERROR] [munity.CommunityUIWidgetAddonHandler] - Unable to parse YAML: while scanning for the next token
found character '%' that cannot start any token. (Do not use % for indentation)
 in 'reader', line 179, column 30:
                        pattern: %1$tM:%1$tS
                                 ^

 at [Source: (StringReader); line: 179, column: 28] (through reference chain: org.openhab.core.ui.components.RootUIComponent["slots"]->java.util.LinkedHashMap["default"]->java.util.ArrayList[5]->org.openhab.core.ui.components.UIComponent["slots"]->java.util.LinkedHashMap["default"]->java.util.ArrayList[0]->org.openhab.core.ui.components.UIComponent["slots"]->java.util.LinkedHashMap["default"]->java.util.ArrayList[0]->org.openhab.core.ui.components.UIComponent["config"])
2022-03-30 10:02:40.900 [ERROR] [munity.CommunityUIWidgetAddonHandler] - Widget from marketplace is invalid: Unable to parse YAML

As this is my test system, I did a complete purge sudo apt remove -y openhab && sudo apt purge -y openhab and reinstalled openHAB from scratch sudo apt install -y openhab. I then did only install squeezebox binding and squeezebox widget with same results.

System: debian bullseye amd-64 (current version)
Java: OpenJDK 64-Bit Server VM (build 11.0.14+9-post-Debian-1deb11u1, mixed mode, sharing)
openHAB: openHAB 3.3.0~S2833-1

Any missing components to get the Widget installled?

Hi Udo,

without having a deeper look, it seems like you have to add transformation addons
you find them in the webUI…

Settings → Addons → Other Addons…

then scroll down to Transformation Addons

as you need them in many other cases my advice is to install them all, but at least JS, JSONPATH, REGEX, and you should be fine…

please leave a reply if this fixes your problems :wink:

cheers, Dan

Nope, did not help.

I’m not very familiar with YAML, but the message Unable to parse YAML: while scanning for the next token
seems to indicate, that openHAB does not know the word “pattern” (at least in this context).
Or is token the parameter?

Hmm,

seems like maybe something’s broken in openhab 3.3 ?!??
please try to replace this

pattern: %1$tM:%1$tS

with this:

pattern: JS(mmss.js):%s

and add a file named mmss.js to your transform folder here: /etc/openhab/transform
with the content described here make sure the owner/group is openhab:openhab

this should help for now… have to check this later…

edit:
or maybe quoting the pattern helps… I think it’s a syntax problem somehow

pattern: "%1$tM:%1$tS"

but as I mentioned earlier I have to take a deeper look later :wink:

I guess I have to import the YAML manually then? How to do?

EDIT: Found.
Inserted Code in Developer tools → Widgets → add Widget.

openHAB added double quotes automatically, so the line is now

                    pattern: "%1$tM:%1$tS"

Hi Udo,

Nice to hear you’ve found it :wink:

Is it working? If it is, you should see the Duration of the played track e.g. “4:24” or something like that. Would be nice if you can confirm this, otherwise I have to see why it’s not showing up anymore…

Screenshot 2022-03-30 at 18-18-49 Squeeze Control Custom Widget - Add-on Marketplace _ UI Widgets - openHAB Community(1)

as you can see here

                        pattern: %1$tM:%1$tS
                                 ^

it complains about the %, which is marked by ^ I don’t know why this happens, that’s why I asked if you can see the converted duration time. The LMServer sends only seconds e.g. “264” and openhab converts it to “4:24” with use of the pattern.

Had to add some items :slight_smile: and it’s working… kind of…


No duration at all. I Tried both patterns

pattern: JS(mmss.js):%s

and

pattern: "%1$tM:%1$tS"

Of course the Item state is a valid duration in seconds.

ok seems like there’s something broken… thanks for the update!

@Udo_Hartmann
please remove the manually installed widget and try to reinstall via UI.
this should work now!

Edit:
you don’t need the mmss.js anymore!
I updated the widget today - the newest version is online…

sorry for the confusion…

1 Like

Thanks, I will try later…

Success! Thanks for for the really nice solution!

1 Like

Hello Hello community, this question is created with a translation program.
How exactly do I get the Favorite List displayed, I don’t really understand. Could someone give me a “step by step” guide? That would be great… Everything else I have already managed. Thank you very much.

Hi Spuckiii,

I’ll try my best… :wink:

First of all it’s important that you have created some favorites on your squeezeserver - otherwise there’s nothing to display for the squeezebox binding

so if you managed to get everything else running I assume that you have a little bit of openhab knowledge.

are you using configuration files or UI based config?

for configuration files you have to create an item bound to the server-channel described here.

// Server
String  SqueezeServerListFavorite "Favorites List" {channel="squeezebox:squeezeboxserver:<your servername here>:favoritesList"}

if you’re using UI config:

  • simply go to Settings → Things → “your squeezeboxserver-thing”
  • click on: Channels → listFavorite → Add Link to Item…
  • add link (if you already created an item before choose link to existing item, otherwise let the UI create a new item)

…and in addition link the new serverlist item at the widget configuration page - after that you should be fine

hope that helps if not feel free to ask again :wink:

Hello Dan,
now it has worked. But I have another question. In the favorites list there are still subfolders. Do I have any chance to include them?

sorry but you can’t, only the first level is displayed by the squeezebox binding…
folder structures are not displayed.

Hi Dan, I was really reading everything several times but I can´t manage it - just to summarize, I have used the UI to create the structure and everything. Created the thing and item to switch the players and get the favorites from the Squeezeserver…but the rest I don´t understand.
The widget works the way that I can switch the Players (at least I see the different names I gave the widget) and I see the favorites from LMS but nothing else. I adapted the Prefix and Suffix to everything I thought it solves my problems - but I guess I have some other problems.

When I take one thing of one player:
“squeezebox:squeezeboxplayer:A7325C57-31B1-4D79-BAE9-4DD6FACD89CF:013fd56f0923”

What is important for me?


image