Grafana not showing up in iframe

Hi everyone!

I installed InfluxDB and Grafana on my Raspberry Pi3 running HA.

I set up influx to get data from HA and set up a graph in Grafana. No I want to integrate it into my HA dashboard.

I tried 2 different methods:

Create a lovelace iframe card by adding following in lovelace config file:

type: iframe
url: >-
     http://192.168.0.20:3000/d-solo/4Bq-LtmRk/home-assistant?orgId=1&theme=dark&panelId=2

The result is that I just get a blank card in lovelace UI.

I than tried a different approach. I added the following to my config.yaml file:

panel_iframe:
  grafana:
    title: 'Charts'
    icon: mdi:elevation-rise
    url: 'http://192.168.0.20:3000/d-solo/4Bq-LtmRk/home-assistant?orgId=1&panelId=2&theme=dark'

This resulted in a new tab to appear in the sidebar. When I open it I get a blank screen same as on the lovelace card.

I tried substituting the exact ip address with localhost. In that case I get a page not found error iniside the iframe.

Looks like it connects to something but not getting the picture of the graph. Anyone has any ideas how to fix this?

I am running Home Assistant - 0.97.2 on Raspberry 3B, along with Influx and Grafana.

If you are accessing Home Assistant over HTTPS using SSL, you cannot access HTTP sites through an iframe panel.

Hello, No I am using HTTP.

Hi, I had this problem, and solved it by setting

allow_embedding = true

in the [security] section of grafana.ini and restarting grafana

2 Likes

Signed up just to reply to this thread, the above response resolved my issue, you can also set it in as the enviroment here is an example docker-compose.yml

grafana:
container_name: grafana
image: grafana/grafana:latest
ports:
- 3000:3000
restart: unless-stopped
volumes:
- /share/Container/grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
- /share/Container/grafana:/var/lib/grafana
- /share/Container/grafana/csv:/home/grafana/csv/
environment:
- GF_PLUGIN_ALLOW_LOCAL_MODE=true
- GF_SECURITY_ALLOW_EMBEDDING=true

what im using for the card:

Hi,

where is the file grafana.ini located in Home Assistant?