Im new to openhab and still bit struggling with it’s environment.
I’m looking for the (a/best) way to retrieve BluOs preset list from a bluesound player.
It gives an array with preset id (number) and info like stream (name/url) or source (optical1).
I have a http binding to the device, with the url command “Presets” i could retrieve a xml list.
I was thinking about Xpath but i probably have to do some scripting to get an array with preset names (and the ids as array index)
But how should I approach and how to get this (with actions “Preset&id=2”) in the web interface?
Best regards,
Ps. I inserted a part of the xml within < code > but it’s not visible.
There are no ‘array’ Items in openHAB, so that is something you would have deal with in whatever structures your chosen rule language uses.
First step though is to fetch your XML into a single String type Item, ready for further processing.
You’d probably use the HTTP binding for that, as you’ve guessed.
An early decision for you to make … when to fetch it?
On demand, or periodically? Binding does either.
Thank you for your reply.
Yea i would prefer to use binding. But should I retrieve it as a channel “presets” on a HTTP binding?
Or should I use a “command” with the query as text in a (java-)script?
I’m a bit struggling with the (abstraction) layering of obenhab and all possibilities.
I have already a http binding to 192.168.2.20:11000
and have made a GUI item list to select a preset and send using channel url command “Preset?id=%2$s”
In the end I just would like to have a list of preset channels to select. I see a lot of possible ways but documentation seems to be a bit behind.
Or should I make the retrieve of items also indexable (id=)