Possibility to show grafana graph in sitemap via remote access?

That’s the second time today
I put my hands up. It works for me…

I think I got a problem with my grafana setup. Myopenhab.org still tries to solve the grafana server with openhabianpi:3000 and not with a http(s).
I think I have to check my grafana setup.

did you try the IP address instead of the host name?

@vzorglub

did you try the IP address instead of the host name?

Same result :frowning:

What I noticed:
If I log in to normal myopenhab on a normal PC, BasicUI, PaperUI or whatever is resolving to https://home.myopenhab.org/xxx.
Grafana wants to resolve to openhabianpi:3000. Is it normal or is this my potential problem?

Try this:
BUT replace openhabianpi by 127.0.0.1 if you are running grafana on the same machine or by the lan IP
grafana.html

<html>
    <body>
        <iframe src="http://openhabianpi:3000/d-solo/000000001/home?panelId=1&orgId=1&tab=time%20range&theme=light"></iframe> 
    </body>
</html>

sitemap:

Image refresh=60000 Webview url="http://127.0.0.1:8080/static/grafana.html" label="Temperaturverlauf" height=10

Thats normal if you run Grafana server on your local network…
But…
If you have Grafana hosted outside your local network, then this IS your problem.

However, it should be the same, when you see a sitemap from local or external.

@vzorglub
This also did not solve the problem.
It only give me a “Connection refused error”. See picture.

And yes, grafana is running on the same machine

This is strange. It works for me.
Hands up. I don’t know

Of couse the above gives an error. You´re using port 8080. Thats not default for Grafana. Grafana uses port 3000.

Read the post above, this a redirected html page

But why redirect it? You can reach the panel from port 3000…

It could be permission issues as well, which makes sense for “Connection Refused” error.

To be able to access it from myopenhab.org

Here are two ways of showing charts in sitemaps.

First is rendering:

Image refresh=30000 url="http://10.4.28.237:3000/render/d-solo/ZkZGWpgRk/nilan-ind-ud-temperatur?refresh=30s&orgId=1&panelId=6&from=now-18h&to=now&width=1000&height=500"

Second using webview:

Webview url="http://10.4.28.237:3000/d/ZkZGWpgRk/nilan-ind-ud-temperatur?refresh=30s&orgId=1&tab=display&from=now-12h&to=now&panelId=6&fullscreen&kiosk=1" height=15

Both options works fine remote through the openhab android app, as well as myopenhab.org, on my system though, (beside rendering sucks and takes a huge amount of resources).

Btw… Grafana server us running on the same computer as openhab.

Don’t get this running with remote URL. Will change to chart item and give grafana a try when I get my nerves back.

Anyway: thank you both for your effort

I have to come back on this, as last night I changed all my sitemaps to use webview insted of rendering.
Now I can not see the charts when connected to basicUI from outside via myopenhab.org either
Using the opehab app on android gives exactly the same error you got.
It works fine locally…

If I change to rendering insted, it works fine, beside rendering takes a huge amount of resources on my Rpi, which can give other problems I have been struggling with…

So I believe there is a problem somewhere using webview in sitemaps with local URL/IP´s from “outside” via myopenhab.org. Using image in sitemaps works fine.
This is a weird problem, cause in both situations it makes use of the internal (local) IP for Grafana.

That makes me sick.

Nothing works for me using the android app via myopenhab.org

In the meantime i tried (for me) absolutely each possible option and nothing gave me a solution.
Any possible solutions?

Don’t believe that you (@Kim_Andersen) and me are the only two having this trouble

You´ll not be able to use Webview and myopnehab.org for a local Grafana server. Webview doesnt proxy the Ip adresse. Which means, when you use Webview and a local server, the client tries to locate the local IP when beeing remote.

You have to add remote access to your Grafana server (not a good idea) using portforward.
Or you have to use rendering (Image type) in your sitemap. Image (rendering) works fine by remote access. But Image type (rendering) uses a huge amount of resources on the platform you run Grafana. I had to stop Grafana on my Rpi and move it to my windows server (more powerfull PC), to be able to use rendering.

This is how it works remote (android openhab app) when using image type in a sitemap:

1 Like

@Boogieman, for me it’s working with your first urls, since my grafana has same user and password like htaccess for sitemap on nginx proxy. The openhab is asking the grafana during delivery for image and with same credentials it’s working fine.

Took a hard day of research…
Regards, Dirk

I’d be glad for any advice in this matter… Thank you.

May I reactivate this topic please?

I´m using webview in my sitemap and they are working fine while on the same network as my openhab.
Grafana and openhab 3.3 are running both on my Raspi 4.

As soon as I´m using remote access through myopenhab.org all my webview charts aren´t displayed.

A webview is defined with local IP address…I guess this might be the problem? But how to solve this?

Webview url="http://192.168.1.199:3000/d-solo/kOfcFYgRk/buerotisch_verbrauch?orgId=1&panelId=2&from=now-1d&to=now&refresh=1m" height=6