OH3 sitemap image extra bits above it, and dynamic on|off view

  • openHABian oh3.4.4, rPi 4 4GB
  • This is a working system (up 504 days) :slight_smile:

The first question (OH3 sitemap image extra bits above it)

I have added an image to my sitemap, and it looks like this:

Why does it have this extra header?

sitemap entry:

    Frame
    {
        Webview url="/static/radar_animation.html" height=15
    }

html file:

<!DOCTYPE html>
<html>
<meta http-equiv="refresh" content="300"></meta>
<body><img src="radar_animation.gif" height=512 width=512 alt="Marburg weather radar" /></body>
</html>

The second question (image dynamic on|off view)

Is it possible to dynamically switch this image off?

The trigger is an empty watch zone (I count the pixels of the rain colours and calculate the severity), which is available via MQTT –> to then ‘switch’ the visibility.

For example, a sitemap item can be made visible like so:

Switch item=Shed_HWS_Allowed
    labelcolor=["ON"="teal"]
    valuecolor=["ON"="teal"]
    visibility=[Shed_HWS_Allowed=="ON"]

Can this be done with a webview too?

I tried to list only the image:

Image url="https://192.168.1.5:8080/static/radar_animation.png" refresh=60000

… but the image did not show.

Any hints appreciated. Thanks.

Because the webview element has an icon and label element and there has to be somewhere for that to go. Sitemaps | openHAB

Based on updates to the docs, in OH 5 (maybe before) the header only appears when the label is set. For OH 3.4 :person_shrugging: You may as well set a label and icon since you won’t be able to not show it.

There should be no limitation on which elements visibility applies to. Image, Webview, Switch, what ever. It should work for them all.

1 Like