Home Assistant Community Add-on: Grafana

Phantomjs is not available on arm devices, Grafana does simple ship without it on those architecture.

PhantomJS is dead, project closed, no development anymore.

:tada: Release v2.2.5

Full Changelog

This is a general maintenance release.

:hammer: Changes

  • :arrow_up: Upgrades Grafana to v6.3.5

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work: https://patreon.com/frenck

1 Like

Anyone can explain me how to setup Grafana with https? I can’t find any working guide.

I have HA installed on Hass.IO. HA version is 0.98.5 (latest)
It is configured https with duckdns.

I’ve installed Grafana add-on and left the default configuration:

{
  "ssl": true,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "plugins": [],
  "env_vars": []
}

After start I try “Open Web UI” and it tries to open https://my.duckdns.org:3000 with no luck.
Do I have to configure a port forward on my router? Something else?

Any help is really appreciated.
Marco

EDIT: I finally got it working.

This works if you run HA with https (duckdns+let’encrypt)

  1. Install Grafana add-on;
  2. The default configuration should have "ssl" : true so leave it that way;
  3. Start Grafana; at this moment you should be able to login to grafana web ui only locally with https://ha_local_ip:3000
  4. This is the most important step: you have to add on your router a port forward rule from port 3000 (external) to port 3000 (internal) on your home assistant ip address.

Now you should be able to access Grafana on: https://my.duckdns.org:3000 locally and outside your LAN.
You can add an panel_iframe to HA in order to have Grafana directly from HA.

Hope this little guide can help somebody else. It would be nice to have it in the Grafana add-on doc.

check out this one… most comprehensive arcticle i found on this topic https://dummylabs.com/post/2019-01-13-influxdb-part1/ helped me a lot understanding influx.

Every time i log in, i get the message “failed to fetch dashboard” and then i am logged out?

t=2019-09-12T18:56:22+0000 lvl=info msg=“Request Completed” logger=context userId=1 orgId=1 uname=admin method=GET path=/logout status=302 remote_addr=172.30.32.1 time_ms=50 size=57 referer=http://hassio.local:3000/
t=2019-09-12T18:56:24+0000 lvl=info msg=“Successful Login” logger=http.server User=admin@localhost
t=2019-09-12T18:56:24+0000 lvl=info msg=“Request Completed” logger=context userId=0 orgId=0 uname= method=GET path=/api/dashboards/home status=401 remote_addr=172.30.32.1 time_ms=18 size=54 referer=http://hassio.local:3000/
t=2019-09-12T18:56:24+0000 lvl=info msg=“Request Completed” logger=context userId=0 orgId=0 uname= method=GET path=/api/login/ping status=401 remote_addr=172.30.32.1 time_ms=3 size=54 referer=http://hassio.local:3000/
t=2019-09-12T18:56:25+0000 lvl=info msg=“Successful Logout” logger=http.server User=admin@localhost
t=2019-09-12T18:56:25+0000 lvl=info msg=“Request Completed” logger=context userId=1 orgId=1 uname=admin method=GET path=/logout status=302 remote_addr=172.30.32.1 time_ms=54 size=57 referer=http://hassio.local:3000/

:tada: Release v2.3.0

Full Changelog

This is a general maintenance release.

:hammer: Changes

  • :arrow_up: Upgrades add-on base image to v4.0.0
  • :fire: Removes secrets handling, now handled by Hassio
  • :arrow_up: Upgrades memcached to 1.5.6-0ubuntu1.2
  • :arrow_up: Upgrades Grafana to 3.6.3

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work: https://patreon.com/frenck

:tada: Release v3.0.0

Full Changelog

:warning: This is a major release! Be sure to take a snapshot before upgrading! :warning:

Introducing full-blown Hass.io Ingress support for Grafana :tada:

This means that add-on now works when using Nabu Casa’s Remote UI to access your Home Assistant instance. :sunglasses:

Ingress also takes care of authentication (so no need to login anymore) and allows you to add Grafana into your Home Assistant sidebar with a single click. :metal:

:warning: Please note:

  • Create a snapshot/backup before upgrading!
  • If you have configured a panel_iframe for Grafana in your Home Assistant configuration, please remove it and use the “Show in sidebar” toggle in the add-on options.
  • Direct access to the add-on has been removed in favor of Ingress support.

:hammer: Changes

  • :arrow_up: Upgrades Grafana to v6.4.2
  • :books: Component > Integration (#50)
  • :sparkles: Adds Ingress support
  • :shirt: Fixes Markdownlint warnings

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work: https://patreon.com/frenck

1 Like

great work. thank you for that
With the new integration I miss the blue header of hass when I open grafana. Is it possible to get this header for this add on as well?

Hi, so far I could integrate graphics from Grafana as “iframe” with “url: http: //192.168.178.55: 3000 / …”. This works since the hass.io v101.1 and Grafana v3.0.0 no longer. Probably because of the Ingress support for Grafana.
What is the current call for the “iframe” integration?

It looks like its no longer exposing its default port to the system. So I can no longer reach it remotely by going to (systemip):3000 thats a problem.

Great, I like the new update including Ingress support!

@bussio; I had the same issue with some iframe presentations, but it still works well although the link must be updated. Go to Grafana -> your dashboard -> click share button -> Copy the new link and then use it for your iframe integration. The new address is on same port as hassio instead of 3000, like: https://yourip:8123/api/hassio_ingress/blahblahblah

A hard reload of the page may be necessary, but it works well on my side at least.

2 Likes

Anyone out there got the grafana-image-renderer plugin to work? I get an error saying it’s not supported although my hopes were really high with the v3.0.0 release of today. I was kindof hoping it would solve the issue of the deprecated PhantomJS that as far as I understand wasn’t supported by the ARM-processors…(?).

Hi,

in case you are going to run into the following error:

“Anonymous access organization error: ‘Main Org.’: Organization not found”

you might have changed the Organization name within Configuration / * Organization profile* in the Grafana UI during initial setup or later on. While this usually it not an issue, it is for the anonymous access being used by ingress.

If you reached that error, you might not remember what the name actually was. In case you do not have a recent backup or don’t want to go back, you can check on Grafanas sqllite database named grafana.db. In case of a hassio setup, you will find it under :/data/grafana.db to copy it out of the Docker Container to your local machine. Opening it with an approriate tool (e.g. https://sqlitebrowser.org/) will allow you to find the name of the organization on the org table in column name. As soon as you have it, update the Grafana addon configuration to overwrite the settings:

{
  "plugins": [],
  "env_vars": [
    {
      "name": "GF_AUTH_ANONYMOUS_ORG_NAME",
      "value": "<name of your organization>"
    }
  ]
}

Save and restart! If you did it correctly, ingress auth should now work without an issue.

4 Likes

Hi,

It’s possible open port 3000?

Thank you.

That’s it. Thanks!

No, as per release notes, that is not possible as of v3.0.0 anymore.

Hi,
after the update to v3.0.0 I get a strange behaviour with the iframe card.
Everything works fine when I connect with my laptop (using Chrome), but from any other device (another lapotop, desktop, mobile app, multiple browsers tried) I get the following in the card:
401: Unauthorised

I can access Grafana UI ok from all devices using the sidebar menu link, so it does not seem to be an authentication issue.
I see no nothing in the Grafana log.
Tried to delete cookies and browser cache, with no joy.

I’m out of ideas, don’t really know how to troubleshoot this…

This is my Grafana config:

{
  "plugins": [],
  "env_vars": [
    {
      "name": "GF_AUTH_ANONYMOUS_ORG_NAME",
      "value": "Home Assistant"
    },
    {
      "name": "GF_AUTH_ANONYMOUS_ENABLED",
      "value": "true"
    }
  ],
  "ssl": false,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

This is the normal iframe card on the “working” browser:

This is what I get on all other devices:

Any suggestion on what I could try?

EDIT: I tried other browsers in the same laptop where things work well with Chrome and it does not work either. Going back to Chrome and still good.
It looks like there is something special that makes it work with that computer/browser combination…

Exact same issue here after upgrade.

1 Like

@tormagj I’m able to iframe in / present via share->copy address and share->embedd into HA but the the image is frozen and doesn’t update when Grafana does. WHere you are to get this working?

Dear all, I have one problem. I have two houses with two hassio servers. Only in one server I have grafana for data visualization. In booth houses I use InfluxDB as a databases. Where the grafana is installed need two DB sources, one for each house. The first is in the same server so no problem (http://a0d7b954-influxdb:8086) the second I try to add a sousce http://secondserver.duckdns.org:8086 but doesn’t work. How can I add the second source for the external influxdb in grafana?