Grafana access over nabucasa

I’m using ha and grafana in docker compose. Simply put I can’t access grafana over nabucasa. I have local access to grafana and dashboards but nothing is working if I use remote access over nabu casa cloud.
I tried a lot of things and nothing seems to work.
Has anyone managed to configure grafana in docker compose and access it over nabu casa cloud?

Let me answer to my own question.
I didn’t found a way to access grafana over nabu casa but I did find a way to display grafana dashboards over nabu casa. It is not perfect but it is working. I done my setup mostly based on this post. Obviously using grafana image render plugin can display grafana dashboards as a picture. Not maybe perfect but it is working.

 ### grafana
    image: grafana/grafana-enterprise:latest
    container_name: grafana
      - 3000:3000
    - TZ=Europe/Zagreb
    - GF_LOG_FILTERS=rendering:debug
      test: curl --fail || exit 1 
      interval: 15s
      timeout: 1m
      retries: 2
      - /opt/grafana:/var/lib/grafana
    user: "root"
      - influxdb
    restart: always
### grafana render
    image: grafana/grafana-image-renderer:latest
    container_name: grafana-render
      - 8091:8081

After some tries I found that this setup is working for me.
In configuration.yaml add

### Grafana image
  download_grafana_image: '/bin/bash /config/scripts/'

Create dashboard in grafana, select share and use direct link rendering image. It will open new tab and display whatever you done in grafana. Copy that url.

Create directory scripts, if you don’t have it, and inside that directory create file with content:

curl -s "URL_you_copied_from_above_refresh=5s&from=24h&to=now&panelId=1&width=1600&height=400" -o /config/www/grafana/my:dashboard_picture.png

Go to the script directory and make file executable with chmod +s *.sh

Make sure that directory /config/www/grafana exist. If it doesnt create it.

Configure width and height to suit your needs.

Create automation that will call a script every minute or so and do picture update, something like this:

alias: Download grafana image
description: ""
  - platform: time_pattern
    seconds: "30"
condition: []
  - service: shell_command.download_grafana_image
    metadata: {}
    data: {}
mode: single

Check if this is working by running automation and checking if png file is created in grafana directory.

If everything is working you add

  - platform: local_file
    name: Grafana_elecricity_current
    file_path: /config/www/grafana/electricity.png

After restart home assistant you should have a new camera image.
This is how it looks on a first try

Have you forgotten the hass_ingress? You can get ingress access to grafana through it.

I never managed to make it work. I tried everything that I found useful, checked proposed online solutions but nothing is working in my case. This is only solution I was able to make it work.

Many services can implement ingress through some cumbersome configurations. Basically ha addons that support ingress access can implement ingress through hass_ingress, but this process is not universal.
A few days ago I integrated grafana, prometheus and cadvisor into HA sidebar, for grafana you can configure it as follows.


    work_mode: ingress
    title: Grafana
    icon: mdi:chart-timeline
    url: grafana:3000
      X-WEBAUTH-USER: admin


    image: grafana/grafana
    - xx/grafana.ini:/etc/grafana/grafana.ini


root_url = %(protocol)s://%(domain)s:%(http_port)s/api/ingress/grafana/
allow_embedding = true
enabled = true
header_name = X-WEBAUTH-USER
header_property = username
auto_sign_up = true
1 Like

Thank you for providing this solution. I can access grafana from nabucasa. I tested this on android app and this is working.
For some reason this doesn’t work in google chrome but it does in firefox.
I have one problem. I can’t see data in iframe card when I’m connected over cloud. Card is empty although I can open grafana using your config.
Do you have similar problem?

Hi. I’m just trying to get this working, but have a small snag.

I amusing HA and Ingress as docker containers, with external access to HA via nginx.

Using the config:
work_mode: ingress
title: Grafana
icon: mdi:chart-timeline
url: grafana:3000

I get this issue:
If you’re seeing this Grafana has failed to load its application files

  1. This could be caused by your reverse proxy settings.

  2. If you host grafana under subpath make sure your grafana.ini root_url setting includes subpath. If not using a reverse proxy make sure to set serve_from_sub_path to true.

  3. If you have a local dev build make sure you build frontend using: yarn start, or yarn build

  4. Sometimes restarting grafana-server can help

  5. Check if you are using a non-supported browser. For more information, refer to the list of supported browsers.

In the ini.
root_url =
Direct access to the URL works

I have that problem if I use google chrome. With firefox it works,

The root_url and allow_embedding options are required to be set like mine, and these will break direct access.

I just wanted to say thanks, this has fixed it for me. Can I use this to embed individual graphs on other pages now, or just via the sidebar?