Why are you trying to create an image item? Remove the item from the cards setup and just provide the URL. If the camera needs a user and pass or it does not
Handle refresh requests correctly the ipcamera binding can be used.
Did you ever solve this problem?
I have the same problem with OH3.1.4 milestone trying to display a weather meteogram. As you said, it was oh-so simple in OH2, 1 line of code. Tbh, I don’t think Matt Skinah really understood what you were asking judging by the questions he asked & his answers.
Isn’t is frustrating that now in November, one still can’t do a simple thing like this?!!
I have posted my problem a few days ago but no replies yet…
My post: OH3 url Image won't display
That’s not an Image Item, it’s an image widget. There’s no Item involved at all, which I think was where OP got into trouble by trying to drag one in. With this widget, openHAB never sees the image, it’s a transaction between viewer/browser and target.
There’s a fairly lengthy exploration here - using a String Item to hold the URL
I tried to decipher the discussions in that link you offered but it was like going down and down a rabbit hole… all seems ridiculously complicated… is there no simple way to do what I (with my Meteogram) or the other users that is elegant like the OH2 method? Your distinction between an Image Item and an Image Widget intrigues me too…what useful thing does this widget do if it doesn’t provide a link to the image that the user wants??? The whole thing has so geeky and opaque imho… common sense would say “I want to display an image so I’ll create an image item”… I despair!
Hello Ross, thanks for your reply. If you could please take a look at my post link about my Meteogram you’ll see I couldn’t even get the Meteogram url image to show at all in the card. It was visible when inspected by other avenues and WAS updating.
I do not know how to get a string item to “hold the url” in OH3. In OH2 sitemaps I would have ‘assigned’ the value to the string with an equals sign…?. But I didn’t have to go creating a string in OH2 and then creating rules to try get updates… it was a 1-liner code for the image item. Have we seriously gone backwards in OH3??? I’m totally lost tbh despite working with OH3 for months now.
Ross I’m not sure if you think I’m handicapped or stupid… I’m neither… If I could build everything AND get everything to work with the old sitemaps, I can’t be too dim.
In OH3 when you create a String item in the UI, I can only see the option to add Metadata… how do I actually assign/give the string a value?
I know one can use the old Sitemaps with OH3 but I was trying to migrate over to the colour card UI using the semantic model. I’ve managed to recreate EVERYTHING in the new UI BUT I’m stumped by how to simply get this bloody Meteogram displayed. I need a simple clear explanation.
This is like updating the state of any other Item in openHAB.
You can link it to something supplied by external service or device, doubt that’s what is wanted here.
You can post state updates to it from a rule. Say it’s never going to change, you might use a ‘system started’ rule.
You can send it commands from UI - that’s not often helpful for String types, because there is no free-text widget for typing in. But you can construct a multiple-choice widget for string values, typically used for OFF-MIN-MED-MAX type choices, but in your case you might have different URLs for different charts.
Or you can use API Explorer tojust update it manually.
It looks simple to you, but there is more to it than meets the eye. You’re asking to embed something alien and external into a private viewer. Most of the web includes security features specifically to stop you doing that. Behind the “Image” widget in a sitemap is a hidden proxy image servlet. I do not think MainUI uses the same technique, perhaps because of its architecture, perhaps because OH3 has higher security levels.
Apologies for snapping at you the other day… I was a bit frazzled with frustration.
Thank you for your detailed reply which has given me further insights and I’ve learned a few new details about the underbelly of OH too…
As it turns out Oliver2 helped me out in my original posting article and the solution is there now. He actually ‘re-enacted’ the exact thing I was trying to do and diagnosed the problem. We did try your suggestion about API assigning a url to a string and using the string item as the target item of the image item but it didn’t work. The overriding problem was that the image item seemed to remain empty (even though we could see the meteogram) and thus UI Card saw an empty item and went looking for an image in the Photos directory (folder in Mac speak). That was why i was getting this bizarre url ending of ‘Photos’ in the address bar.
Anyway, you’ll see (if you’re curious) what exactly we did because I put screen shots in the solution discussion. The solution process and exchanges are all there.
Let me know if it makes sense to you and if you found it interesting too.
Thanks again and sorry for being a bit sharp the other day.
Original post: OH3 url Image won't display
Embedding a foreign image in MainUI seems to be a fraught business.
The workaround you’ve ended up with is to use openHAB machinery to fetch a copy of the foreign image, where the OH server has all the control and no security risks. “Build your own proxy.”
Then show that local copy in UI.