Room Widget Background not loading

release-preview23
openhab

#21

Hi,

I have tried this right now. Without the http:// at the beginning I get again this api stuff:

api://platformsdfasfsfasfasdfasdfafs//static/rotini/living-room.jpg


#22

Yes, that’s an app internal URL, so that’s good, but it still didn’t work?


#23

I just tried this feature with widget background together with openhab. At least with the local connection it’s working for me. What I have done:

Item:
String Background_Erdgeschoss “Background Erdgeschoss”

Rule:
// Systemstart
rule “Load Pictures”
when
System started
then
Background_Erdgeschoss.postUpdate ("/static/erdgeschoss.jpg")
end


#24

OK, it’s not working 100% also for me…
@igor maybe it helps: in my case i can see the image after widget configuration. but as soon as I restart rotini the background is not there anymore.


#25

Hi,

could you please also try it over myopenhab.


#26

Maybe related: there is currently a case when server returns no image (it happens with OH from time to time) UI doesn’t try to refresh it unless URL changed.
So, when it goes blank for you, can you check if it shown again on next app restart?


#27

Hi Igor,

local it is working now. But it would be much better to get it also working over myopenhab. Michael have you tried it with myopenhab?


#28

@igor it’s now the question what does restart mean :slight_smile: I can just switch the tab and go back to rotini…then it works. But as soon as i really close the app the pictures are visible about 1s and that’s it. I will try to record and upload a video.

@rene54321 Not yet. I will try this the next days…

Video:
https://photos.app.goo.gl/a159J78KOG0ZpuVA3


#29

The problem was indeed in myopenhab auth. The fix will be out with the next release.
You would still need to use relative URLs in items, so the app knows that it is relative the server host and use platform credentials.


#30

Cool thanks for investigating this issue.


#31

I can’t get it to show any images either.

Tried the following:

Webserver on LAN: http://saturn/pics/home/bathroom.jpg
Relative URL hosted via static openhab /static/rotini/livingroom.jpg
Myopenhab full URL: https://myopenhab.org/static/rotini/hallway.jpg

Any advise?

I am using Openhab1 and got it defined as String:

String Backdrop_Living "/static/rotini/hallway.jpg" (G_Backdrops)

In a sitemap like so:

{
  "dashboards": {

    "home": {
      "columns": 8,
      "rows": 6,
      "pages": [
        {
          "label": "Home",
          "icon": "home",
          "widgets": [
            {
              "type": "clock",
              "position": {
                "x": 0,
                "y": 0,
                "width": 1,
                "height": 1
            	}
            },
				{
				  "type": "room",
				  "position": "0-1,2-4",
				  "properties": {
				    "label": "Living Room!",
				    "photo": {
				      "binding": "Backdrop_Living"
				    },
				    "elements": {
				      "lights": {
				        "type": "switch",
				        "icon": "light",
				        "state": {
				          "binding": "G_Lights_Living"
				        }
				      },
				      "motion": {
				        "type": "motion",
				        "icon": "motion",
				        "state": {
				          "binding": "Living_Sensor_Motion"
				        }
				      },
				      "temperature": {
				        "type": "temperature",
				        "icon": "temperature",
				        "state": {
				          "binding": "Living_Sensor_Temperature"
				        }
				      },
				      "humidity": {
				        "type": "humidity",
				        "icon": "humidity",
				        "state": {
				          "binding": "Living_Sensor_Humidity"
				        },
				      "music": {
				        "type": "switch",
				        "icon": "volume",
				        "state": {
				          "binding": "Living_Music_Power"
				        }
				      }
				    }
				  }
				}
            }
          ]
        },
        {
          "label": "Living Room",
          "icon": "sofa",
          "widgets": []
        },
        {
          "label": "Bedroom",
          "icon": "bed",
          "widgets": []
        }
      ]
    }
  }
}

#32

Ok, so I cannot seem to get this working either. In legacy I just point directly to an imgur url. This worked great for these types of images. Now I have a string item created and I have placed the url from imgur in the string on openhab 2. No dice… I access my OH2 direct through an Nginx reverse proxy using basic auth enforced by the proxy.

What is the best practice here?