Openhab2+Grafana HABdroid Webview

habdroid
grafana
openhabapp
Tags: #<Tag:0x00007fadfd7ea718> #<Tag:0x00007fadfd7ea5b0> #<Tag:0x00007fadfd7ea380>

(Josar) #1

I followed the instruction from here and here on how to install and configure InfluxDB and Grafana for my RPI3, consulting grafana-on-raspberry for up do date install instructions and had some further reading on influxDB or Grafana .

I run InfluxDB, Grafana and OpenHAB on the RPI3.

As the webview element in Android App did not log in and showed the loggin credentials i thought of setting up the webview url with user credentials.

Calling the url from the browser got me a warning that the page does not accept login credentials which leaded me to this post which states to disable the basic authentification.

sudo nano /etc/grafana/grafana.ini
#################################### Users ####################################
[users]
# disable user signup / registration
allow_sign_up = false

...
#################################### Anonymous Auth ##########################
[auth.anonymous]
# enable anonymous access
enabled = true

...
#################################### Basic Auth ##########################
[auth.basic]
enabled = false

Restart grafana and close the App!!!

systemctl restart grafana-server.service

So this made gafana work also in the AndroidApp

Frame{ Webview height=10
       url="http://<IP_HOST>:3000/dashboard-solo/db/<PANELNAME>?panelId=<PANELID>& <...>
}

This is the sitemap view in the browser.

This is the sitemap view in the App.

Thank you @ThomDietrich for the nice tutorial. Maybe this was allready known, but i could not find anything about it.


InfluxDB+Grafana persistence and graphing
Openhab2 RPI System Temperature and DS18B20 OneWire Chart with persistence
(Adi Vacaru) #2

Hello,

i followed your instructions and i get the graph displayed in the app but with the options menu from above that enables you to chose the time range and the dashboard (marked with a red frame in the picture) . this is how i declared my webwiew element :

Webview  height=10 url="http://user:password@192.168.0.45:3000/dashboard/db/first?refresh=5s&panelId=3&fullscreen&edit&orgId=1&tab=general&from=1508498834960&to=1508585234960"

This is displaying the following both in android and ios apps :

Do you have any idea how get rid of the section marked with red and keep only the plot (marked with purple)?

Thanks in advance.


(Adi Vacaru) #3

ps : that section i want away si being displayed also in the browser.


(Adi Vacaru) #4

the the picture from the android app.


(Josar) #5

@Adi_Vacaru have a closer look to my link, use dashboard-solo and not dashboard.


(Adi Vacaru) #6

that does it. thanks a lot.


(Josar) #7

@Adi_Vacaru feel free to mark the post as solution. And maybe spend a like for a post you got some good information from. :wink:


(Adi Vacaru) #8

sorry for the noob question but how do i mark it as a solution ?


(Josar) #9


The gray box at the bottom left with the check mark hover over it and see the text “this reply solves the problem”


(Adi Vacaru) #10

i don’t have that one :


(Philipp Marschall) #11

Not working for me :frowning_face:
Even I setup a separate user and changed basic auth to “false” I allways get the login screen when attempting the url directly within browser. (When I first login and then go to the URL I get the chart perfectly, even with http://“user”:“password”@ within URL)
When using the webview element within sitemap I get a blank frame.

My URL:
http://“user”:“password”@:2ipAdress23000/dashboard-solo/db/raumtemperaturen?orgId=1&panelId=1&from=now-1d&to=now&theme=dark

Sitemap:
Frame label=“Raumtemperaturen” {
Webview height=15 url=“http://:@:3000/dashboard-solo/db/raumtemperaturen?orgId=1&panelId=1&from=now-1d&to=now&theme=dark”
}


(Dries) #12

I don’t really get it. Why do you need to provide user credentials?

I use this link:

http://192.168.X.X:3000/dashboard-solo/db/alarm-logging?orgId=1&from=now-1M&to=now&panelId=2&theme=light

It doesn’t require user credentials and works fine.


(Josar) #13

@marschall_philipp didi you get it running?
What is was your setup? Android Client and RPI server?


(Philipp Marschall) #14

No, haven´t been successful. I then turned on the anonymous access (or how ever it is called…). So I don´t have to provide any credentials.
My setup was / is RPI3 as OpenHab+Grafana Server and the Android Client and Web Access to OpenHab.


(Dror) #15

I also did not get it successfully use the anonymous credentials and then I found out you have to match in the [auth.anonymous] section the [org_name] value to be exact value defined in Grafana dashboard org.


(Josar) #16

Which anonymous credentials, you just open the link without any credential.

As for me i set it up yesterday on an RPI3 ans di just the changes above and it worked.


(paglia) #17

Sorry @Josar can you explain better the “dashboard-solo” issue?
I can’t get it to work. If i use “dashboard” it works, with “dashboard-solo” the sitemap don’t show errors, but it shows me an empty image.


(paglia) #18

@Josar - my fault, don’t know why but the url shared from the “public” view mode (i mean, not logged in), was different.
The url comes with a “&fullscreen” at the end, that can create problem.
If i use dashboard-solo without &fullscreen in the end, works perfectly.

Thank you