[Solved] Panel iframe grafana docker doesn't work

Hello,

I use HA without Hassio (docker management) and I want to showing my grafana in the iframe panel and it’s doesn’t work :
My grafana web access work great (http://x.x.x.x:3000), but when I used the iframe panel, it’s doesn’t work…
This is my simple config :slight_smile:

panel_iframe:
  grafana:
    title: Grafana
    icon: mdi:chart-timeline
    url: 'http://x.x.x.x:3000'

Could you help me ?

2 Likes

Anybody to help me ? :sleepy:

I may be able to help, can you post a screenshot of what error message appears in the iframe?

Yes, but it’s not really verbose…

Well it helps a little, have a look at the debug settings in your browser and it may show some more info.

It looks like grafana may be blocking access here, you may need to change some of the grafana settings to allow iframe embedding.

Thank you @Codec303 . I didn’t know it’s possible to disabled display website you use the iframe enbedding.

The solution :
In the grafana.ini (config file), change
;allow_embedding = false
by
allow_embedding = true

3 Likes

Nice, I didn’t know it was as simple as that, I’ve only used Grafana to generate PNG files and put them in a dashboard.

I think I’ll give iframe a try and see if it works, thanks for sharing the solution. :slight_smile:

Having issues how to insert that in the config settings in home assistant!
Running Hassio in docker. Any tips?

Current grafana config:

{
  "plugins": [],
  "env_vars": []
}

I don’t understand : Do you use home assistant in docker or Hassio (integrated a docker system) ?
If you use the Hassio, you can find the information on the youtube to help you. So if you use the HA, like me, in docker and grafana in an other container, you have add the “iframe_panel” in the configuration.yaml.

I use hassio and it installs Grafana on the add on page. Will check youtube. Its not a place I usually search for answers!

Do you know where the Grafana config file is in hassio?

I don’t know. I use the docker system for my HA. Normally the config is in the Add-on panel if I remember.


Like this?

What script do I need to add?

(If I go to the grafana link on the navigation then back to the ipanel card on lovelace, it show up fine for a limited time)

Note if using grafana in docker, you can pass in the allow_embedding as an environment variable GF_SECURITY_ALLOW_EMBEDDING=true

3 Likes
plugins:
  - grafana-worldmap-panel
env_vars:
  - name: GF_AUTH_ANONYMOUS_ENABLED
    value: 'true'
  - name: GF_SECURITY_ALLOW_EMBEDDING
    value: 'true'
  - name: GF_SECURITY_COOKIE_SAMESITE
    value: none
  - name: GF_SECURITY_COOKIE_SECURE
    value: 'true'
  - name: GF_SECURITY_LOGIN_REMEMBER_DAYS
    value: '365'
  - name: GF_AUTH_BASIC_ENABLED
    value: 'true'
ssl: true
certfile: fullchain.pem
keyfile: privkey.pem
log_level: info

Never worked… as above (Current grafana confg in hassio).
formatting issue?