Grafana logo

Anonymous Access in Grafana (Hass.io)

Grafana logo       Grafana is an excellent program to create very cool graphs and charts from your Home Assistant sensor data. If you are using Grafana and want to embed graphs into your Home Assistant dahboards, then you will have to enable anonymous access to Grafana.  This is because, right now, Home Assistant displays the Gafana graphs in an iframe and is not able to add any authentication.  This article shows how to enable anonymous access.

     I run the Hass.io installation of Home Assistant on a Linux virtual server.  The Hass.io runs under docker and loads all it’s plug-ins as separate docker instances.  I am running the standard hass.io Grafana and influxDB plug-ins.  If you are not running the hass.io Grafana plug-in then this information will not work for you abnd you will have to see hte standard Grafana documentation to set up anonymous access.

    To enable anonymous access…..

From the Home Assistant menu, click on Hass.io

On the Hass.io Dashboard tab, click on the Grafana Add-On

Scroll down to the Config box and enter the following information:

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

Click on “SAVE” and then restart the Grafanas plug-in.

Note: at the time I am writing this, thete is a bug in the Grafana docker instance.  It does not save the password for the database connection in Grafana between reports.  If you go into Grafana after your reboot and see an authentication popup, then your instance have the same bug.  To fix it, you will have to go into Grafana and update your database password again.  Once you save the password it will work fine until you have to reboot.  There is a ticket in for this issue and you can see the progress here.

 

Leave a Comment

Your email address will not be published. Required fields are marked *