OH3 url Image won't display

Version: OH3.1.4 Milestone

Problem: Can’t get a Meteogram weather image to display when the item is clicked from inside a UI card.
The image DOES display if I click item by drilling down via the model tree. Also it DOES display if I click the item from the items list on side bar.
Have attached screenshots which should be self explanatory. They show correct item definition & type & web frame card image widget used and location card
and url from Norway site filled in etc. Weird issue seems to be that when I click on the ‘meteogram’ item INSIDE THE CARD, I get a blank screen with a little box in the centre because the address bar seems to be getting filled in with a bizarre url ending of “/#!/photos/”.
It doesn’t matter whether I do this locally on the actual computer hosting OH or whether I login from another computer on same LAN. This strange ending in the target url is happening. I thought it should just go to the item which has the url and pulls the weather image? Perhaps I totally misunderstand something? All this was easy-peasy in OH2 sitemaps with an ‘image’ item and with 1 line of code.
It’s driving me nuts! Can anyone advise please? Thanks in advance.






Outside location card

Bizarre url gets filled in

Your item is an IMAGE item which holds the binary data of an image.
Sure, oh-webframe-card can show images but gets the image from a URL.
Try oh-image-card which gets the image from an item.

Hi Oliver, thank for your reply.
I have tried what you suggested, using an oh-image-card and inserted the url rather than specifying an item, as in the screen shot below. It still doesn’t work. I still get exactly the same weird url appendage about photos and a blank screen when I click the entry inside the card on the main UI. I notice the Image card also has an option for specifying an item, but what item would I be specifying?? All I want is to point the card towards the url and grab the image. How can a simple operation from Sitemaps/OH2 become so obtuse in OH3… :roll_eyes:

Have a look what I wrote on the other thread where you asked for help
Basically you have to pursue one of the following options:

  1. “URL-item”: the item just stores a URL to an image. then the item is of type string and you should use a corresponding widget (e.g. oh-webframe-card)
  2. “Image-item”: the item stores an image. then the item is of type image and the corresponding widget is oh-image-card)

then you have to go for alternative 1

Sorry Oliver2, we seem to be going in circles here… :crazy_face:
You can see from my original post and also from my attempt at your suggestion what I’m trying to do.
I would have thought EITHER of your approaches should work? I created an image item (since I want to display the image of the meteogram) and told it where (the url) to get the image from. Surely this is the sane logical approach?? This approach worked in OH2 with sitemaps. Is it me totally missing something and being dumb or has OH3 becoming so geeky and opaque? Can you see from all my screenshots what I’m trying and what is happening? I do appreciate your time and assistance on this. Re your url string item (if I was to try that) I can’t figure how to ‘assign’ the url to the string using the UI system.

no. that is your misunderstanding.
if you create an IMAGE item, the content is an IMAGE. You cannot “tell” the item to get the image from a URL. Either your binding of a weather service is doing this or you have to create a rule which gets the image and writes physical image data into the item.
What I can see from your screenshots, you have an IMAGE item, which does not contain a URL!. That’s why you cannot use a webframe widget. You have to use an image widget.

Unfortunately in your last post you try to replace one problem by pursuing another strategie (URL link) instead of configuring your image-card with your image item.

Oliver2, thanks for your replies and patience… unfortunately I’m now totally bamboozled and confused and frustrated. I’m obviously missing the nuances of what an Image item should contain. I thought an image item would ‘contain’ and ‘store’ and display it’s contents. How does the image item ever get hold of its contents so? When I put the url into the url field of the image item (as per my screenshot) what exactly was happening then?? I’m totally confused tbh.
There’s nothing wrong with the weather binding service since it works perfectly in sitemaps in both OH2 and OH3.
Can you recreate yourself what I’m attempting to do and perhaps step me through it?

this is an image item:

this is a string item which holds a URL:

In your settings


delete the URL and pick the item Meteogram.
Please also post the config of item Meteogram. I wonder why it is NULL

EDIT: and change the default widget to an image-card

tested it on my side. Works without any problems.

You better delete the Default widget metadata from the item and recreate it.
There is nothing you have to do. It works with default settings.

Hi, I have done what you suggested, deleted the url and referenced the item itself in the item field. Still doesn’t work.
Silly question probably: How did you create that url string with the url inside it? I can’t get my head around this in OH3. If I could do that, we could try the string-url approach?
BTW, it works ok in regular old sitemaps AND it also works perfectly in my HabPanel interface that I designed for my iPad. Notice the elegance and simple logic of doing it there.





That is because the item Meteogram is empty.

Go to API Explorer and perform a post request to that item

set the refreshIntervall to 10 (I assume that unit here is seconds - but not sure)

Oliver2, follows your advice. The Card Widgets DO display and update things fine (see screenshots called card widget 1&2) BUT when you want to see the Meteogram by going the normal route of clicking within the UI Card (screenshots UI Cards 1&2) I still get the blank screen because somehow the address is bringing me to a non existing place (photos). This is the crux we can’t seem to solve. Have you tried it with my actual meteogram url and see if you can get the meteogram to display when you click from inside the user interface card rather than just looking at the item itself?



UI Card-1

ok. Let’s start from scratch. Your item seems to be empty:


is this item linked to a channel?
does this channel send a URL or an image?
what is the output if you launch this URL in your browser:

http://openhab:8080/rest/items/Meteogram/state

and yes, sure it works partially. that is because your metadata of your item (which is empty) is instructed not to get the image from the item but from a seperate link.

The item isn’t linked to any channel. I just created it on the fly as an attempt to get and display the weather meteogram.
When I launch http://localhost:8080/rest/items/Meteogram/state it returns a value NULL. So it is empty as you say.
(I used localhost cos I’m on same Mac that is running OH).
I really appreciate your patience, I’ve got into a right knot over this.

ok. I did a complete test. When using a URL string within item’s metadata “Default Standalone Widget” it works within the item but it does not get correctly shown in the GUI (e.g. location tab). Reason for this is that UI tries to access a file in a photo directory but there isn’t one (because the item is NULL).

It does work if you have an image item which contains an IMAGE, not a link to an image. This means that you have to take care about getting the data.

Either you create a rule, or better, install http binding and try to get image through its channel

Oliver2, you’re a GENIUS!!! :grin: :clap: :+1: you could see exactly what was happening on me and you understood the reason for it. thanks so much for your patience and generosity today…good karma for you in the future…
Your suggestion to install and use the http binding worked.
I created a http url ‘thing’ then added a channel (because it didn’t have any), made up a channel ID called ‘Meteo2day’ (because it didn’t have any), then created an image item which DIDN’T seem to need any Metadata or Widgets this time, and linked the channel to this item and hey presto!
I’m unsure about refresh intervals. What’s the refresh time in the thing and what units are they? The Norway meteogram site updates itself every hour apparently. I’d like the http call to only happen every 30 mins. What number should go into that refresh box (if that’s the correct place)?
ps. also than you for clearly explaining how to ‘post’ a value to a string.

Overall, I have to say that many forum members give terse/obscure/incomplete answers to requests for help. Either they assume the member asking knows lots or should do and they don’t bother (or are unable) explaining things clearly at all. I know it’s all voluntary but unclear answers only further complicate things.You’re defo the exception and I have appreciated that.
I attach screenshots to be sure it looks sensible to you.




glad, that we could bring it to a happy end :slight_smile:


You have to set “refresh” to 1800

In MainUI click the following:

Developer Tools
API Explorer
items
post
Try it out
enter item name and string
execute