wborn / openhab-grafana

JavaScript utilities and examples for using Grafana with openHAB
MIT License
46 stars 13 forks source link

Add support for Grafana 8 #27

Open BobSilent opened 3 years ago

BobSilent commented 3 years ago

Upgrading Grafana from v7 to v8 shows only 404 graphic instead of the expected diagrams

see also: https://community.openhab.org/t/influxdb-grafana-persistence-and-graphing/13761/950

also an initial fix exists: https://community.openhab.org/t/influxdb-grafana-persistence-and-graphing/13761/954

HSorgYves commented 1 year ago

For Grafana v9 it is enough to put OHG_DEFAULTS["panelPath"] = "/d-solo/"; in openhab-grafana-user-defaults.js

RolandRosenfeld commented 1 year ago

For Grafana v9 it is enough to put OHG_DEFAULTS["panelPath"] = "/d-solo/"; in openhab-grafana-user-defaults.js

I just tried to reproduce this: Upgraded from 7.5.16 to 9.2.3 and added the above line to openhab-grafana-user-defaults.js, but this still results in errors "Dashboard not found" and "Panel with id 18 not found". So I'll have to downgrade again :-(

wborn commented 1 year ago

I've been using d-solo in the URLs too for some time now. But I haven't found time to update the documentation/screenshots for that change. :wink:

You can use the changes of #32 in my branch. I just retested this after upgrading my Grafana to 9.2.6.

RolandRosenfeld commented 1 year ago

I just tried it out and it now works for me, but only after I changed the Webview URL from Webview icon=none url="/static/grafana-time.html?dashboard=heizung&fromItem=Chart_Period&... to Webview icon=none url="/static/grafana-time.html?dashboard=Fp_OvCHMz/heizung&fromItem=Chart_Period&... (The prefix before the dashboard name can be grabbed from Grafana and is different for every dashboard, no idea where it comes from, but it seems to be required for Grafana 9).

Thanks to your help, so I was able to upgrade Grafana from 7.5.16 to 9.2.6 now :-)

wborn commented 1 year ago

I think I read one day that nowadays unique IDs are generated. Perhaps it also depends on your upgrade path if they have been applied to existing dashboards.