Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse SmartHome » Image from Item state (rather from URL)
Image from Item state (rather from URL) [message #1743011] Fri, 09 September 2016 13:02 Go to next message
Tim Roberts is currently offline Tim RobertsFriend
Messages: 29
Registered: September 2016
Junior Member
I posted this over in openhab but realized it's probably better for this forum since it's a smarthome api (see my post in openhab's community - "items and sitemaps" forum)

Basically - I needed an image that would get it's url from the item state and the ProxyServlet didn't support that (only supported URLs from the url attribute). I've made the change locally and was wondering if I should create a pull request for it?

Use case: I have a music streamer binding (Russound) that I'm about to create a pull request (over on openhab). The Russound binding will provide a item whose state is the cover art url for the currently streamed song and I wanted to display that via the image tag.
Re: Image from Item state (rather from URL) [message #1743025 is a reply to message #1743011] Fri, 09 September 2016 15:27 Go to previous messageGo to next message
John Cocula is currently offline John CoculaFriend
Messages: 21
Registered: June 2015
Junior Member
Tim, I agree that sitemaps ought to be able to get their Image and Video URLs from dynamic sources, possible the most convenient source being the String state of an item. This would allow a number of bindings that deal in image and video URLs (like the Russound binding you mentioned, the Nest Cam support in the Nest binding, but I'm sure I've seen others) to actually present those images and videos via sitemaps. You might want more feedback here as to how to accomplish this. Augmenting the sitemap DSL seems like a good idea, but there might be better ideas.
Re: Image from Item state (rather from URL) [message #1743034 is a reply to message #1743025] Fri, 09 September 2016 17:49 Go to previous messageGo to next message
Tim Roberts is currently offline Tim RobertsFriend
Messages: 29
Registered: September 2016
Junior Member
Actually - I just implemented it without having to modify the sitemaps. If the URL attribute is missing, simply look at the item state:

Image item=Russound_CoverArtUrl

That will create the image from the item state. To me, seems like it's not only straight forward but is consistent with all the other tags (Text item=xxxx, etc).

[Updated on: Fri, 09 September 2016 17:49]

Report message to a moderator

Re: Image from Item state (rather from URL) [message #1743199 is a reply to message #1743034] Tue, 13 September 2016 09:30 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
Tim,

you might be interested in https://github.com/eclipse/smarthome/issues/1800, I think this is the best way to move forward. Using string items with urls is imho only a workaround, with the new Image item type, we can natively support this use case and do not have to use any additional proxy servlets, etc. Unfortunately, the Paper UI is currently the only UI supporting this new item type, but if there are more bindings using it, the pressure will rise to enhance the UIs Smile

Regards,
Kai

[Updated on: Tue, 13 September 2016 09:31]

Report message to a moderator

Re: Image from Item state (rather from URL) [message #1743330 is a reply to message #1743199] Wed, 14 September 2016 12:14 Go to previous message
Tim Roberts is currently offline Tim RobertsFriend
Messages: 29
Registered: September 2016
Junior Member
That's exactly what I needed. Thank you!
Previous Topic:Combination of Eclipse Kura & Smarthome
Next Topic:0.9.0 release plan
Goto Forum:
  


Current Time: Fri Dec 06 20:29:04 GMT 2024

Powered by FUDForum. Page generated in 0.04300 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top