Grafana Dashboard as Lovelace iframe results in ingress issue #11273
Replies: 23 comments 1 reply
-
|
The issue is that de frontend doesn't have a valid authenticated session via ingress for the add-on, until the normal ingress route has been visited. After that, the iframes work. This is not just a Grafana add-on issue. It applies to any add-on providing ingress. |
Beta Was this translation helpful? Give feedback.
-
|
@frenck Exactly that is the issue. But it would be useful to have a solution for this usecases. |
Beta Was this translation helpful? Give feedback.
-
|
Maybe 🤷 |
Beta Was this translation helpful? Give feedback.
-
|
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
Beta Was this translation helpful? Give feedback.
-
|
This is still relevant. Tested on 0.115. |
Beta Was this translation helpful? Give feedback.
-
|
This is not a bug, this is how iframes work. |
Beta Was this translation helpful? Give feedback.
-
|
Are there any known workarounds (beside opening Grafana WebUI to create ingress session)?
Any other ideas? |
Beta Was this translation helpful? Give feedback.
-
|
I've worked around it by having nginx in front of it redirect requests from |
Beta Was this translation helpful? Give feedback.
-
|
@mkarnebeek This is something I'm trying to accomplish. |
Beta Was this translation helpful? Give feedback.
-
|
@ludeeus I will just quote a part of hass documentation It doesn't work. It's not a feature request. |
Beta Was this translation helpful? Give feedback.
-
|
It does work, from the sidebar where that feature is intended to be used. |
Beta Was this translation helpful? Give feedback.
-
|
@ludeeus Why would anyone want to generate dashboard elements that you can't use and share? That is the reason graphana exists. |
Beta Was this translation helpful? Give feedback.
-
|
For OPs first possible solution: Other possibility (but I think a feature of |
Beta Was this translation helpful? Give feedback.
-
|
I am also interested in a solution |
Beta Was this translation helpful? Give feedback.
-
|
As an interim bandaid solution I have done the following: I made a new “web card” on my main home assistant landing page with the link copied from the grafana link in the side panel... "https://xxxxxxxx.duckdns.org:8123/a0d7b954_grafana". Set the Aspect Ratio to 0% and leave the title blank and the card will effectively be hidden (may be better ways to do this?) It's not perfect but now when I open home assistant in a new browser or on a new device the hidden web card authorises to grafana and then my grafana cards display fine. (So I don't have to first click on the grafana link in the side panel) Note all my grafana chart cards are on a different view/tab in home assistant to my main landing page so the hidden authorisation webcard connects before I change to the views with grafana charts. Haven't tried if it works when they are on the same view/tab in home assistant. |
Beta Was this translation helpful? Give feedback.
-
|
For me this workaround is not working on iOS :( Anyone else tested the suggested workaround? |
Beta Was this translation helpful? Give feedback.
-
|
Im having this very problem. I just updated Grafana and I think that made it worse, not sure what to do here. Tried adding the configuration bits that others have suggested on other forumns, tried resetting the cache, tried port 300 and port 8123, nothing works. How do we solve this? I just want to view my graphs inside Home Assistant on my phone. |
Beta Was this translation helpful? Give feedback.
-
|
@dermotduffy once suggested me that it should be proxied by a Home Assistant integration before the Lovelace card can access it. dermotduffy/advanced-camera-card#331 (comment) This is how Frigate card ends up communicating with the Frigate addon (through the Integration which proxies the necessary endpoints). |
Beta Was this translation helpful? Give feedback.
-
|
I get 401: Unauthorized on grafana in iFrame card. |
Beta Was this translation helpful? Give feedback.
-
|
For the record i encountered the same problem by trying to use an hassio Zigbee2Mqtt ingress URL (like (See home-assistant/core#96100 ad home-assistant/core#96107) NB: in the above, the Possible solutions to cover the two usecases (being iframes and "Visit" button): I think B is simpler Is there a more general discussion for this ingress session problem ? Any other ideas ? |
Beta Was this translation helpful? Give feedback.
-
|
Still relevant in 2026 and affecting real users. I just hit this again in a live Home Assistant deployment while embedding the Music Assistant add-on UI inside a Lovelace dashboard for non-admin users. The symptoms are the same as described earlier in this thread:
In our case we confirmed that the add-on itself was fine and accessible, but the dashboard embed path failed until ingress session handling was worked around on the frontend side. The workaround that solved it for us was a custom Lovelace card that explicitly creates/validates the ingress session before loading the iframe ( So from a user perspective this is not just an old Grafana quirk. It still affects modern add-ons like Music Assistant and it still pushes people toward custom cards, hidden pre-auth pages, or bypassing ingress entirely. A native fix still seems worthwhile. The most obvious options still look like:
If a new proposal/issue is the preferred place now, please point to it and I can add a more exact reproduction from this Music Assistant case. |
Beta Was this translation helpful? Give feedback.
-
Proposal: First-class ingress-aware embedding for Lovelace iframe/webpage cardsProblem statementHome Assistant add-ons that rely on Supervisor ingress do not embed reliably inside Lovelace when rendered through the built-in In practice, the add-on itself is healthy and reachable, but the embedded UI may fail to load, show This is still affecting real users in current versions of Home Assistant and is not limited to Grafana:
The current situation forces users into workarounds:
That is a bad UX and pushes users away from the built-in dashboard primitives. Current behaviorToday, the standard Lovelace
For ingress-backed add-ons, this creates a mismatch:
Related navigation behavior also remains awkward:
Desired behaviorHome Assistant frontend should provide a first-class way to embed ingress-backed add-on UIs inside Lovelace without custom cards. Expected behavior:
Minimal frontend/core designOption A: Upgrade the existing webpage/iframe cardTeach the built-in card to recognize ingress-backed targets, for example:
When such a target is detected:
This is the smallest UX change because it preserves the existing Lovelace card concept. Option B: Introduce a dedicated ingress-aware Lovelace cardAdd a new first-party card, for example:
This avoids overloading the generic iframe card and makes the special behavior explicit. Possible config: type: ingress-webpage
addon: d5369777_music_assistant
path: /
aspect_ratio: 150%Advantages:
Shared implementation noteThe backend building blocks already exist conceptually: the missing piece is mainly frontend orchestration of ingress session lifecycle around embedded usage. Compatibility / risk notesSecurityThis proposal should not bypass ingress or weaken auth. It should only automate the same authenticated ingress session flow that already works when users open the add-on through the intended panel route. Scope boundariesThis proposal is about ingress-backed add-ons embedded in Lovelace. Backward compatibilityIf implemented as detection inside the existing webpage card, care is needed to avoid changing behavior for normal external URLs. That is why a dedicated first-party ingress-aware card may actually be safer. UX edge casesEven with ingress session handling fixed, dashboard-only flows still need good navigation patterns.
Why this mattersThis is no longer just an old Grafana issue. The existence of successful community workarounds such as The question is not whether ingress-backed embedding is useful. The question is whether Home Assistant wants this solved natively in frontend/core, or to keep pushing users toward custom cards and brittle workarounds. Suggested ask to maintainersWould the frontend team accept either:
If yes, I can turn this into a narrower implementation proposal with:
|
Beta Was this translation helpful? Give feedback.
-
|
I opened a new broader discussion for this as a general Lovelace/add-on ingress embedding problem, not just a Grafana-specific one: That new thread is framed around current use cases including Music Assistant and Zigbee2MQTT, plus a concrete proposal for first-class ingress-aware embedding in frontend/core. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
The problem
Use of Grafana Dashboards in Lovelace iframe isn't possible if Grafana is access is using ingress as sometimes there is no valid session on the ingress controller.
Environment
https://www.home-assistant.io/lovelace/iframe/
https://github.com/hassio-addons/addon-grafana
Problem-relevant from
lovelacecardTraceback/Error logs
Additional information
There were multiple people wishing a real solution for this issue. I think it is complex and needs to be discussed generally how to solve this issue.
As already stated here (https://community.home-assistant.io/t/401-unauthorized-iframe-card-of-grafana-not-working-on-the-www-local-network-ok/148017/21), the issue can't be resolved by grafana addon, as if the error occours there is no traffic that reaches the grafana docker container.
So the problem has to be resolved before (ingress/lovelace webpage card?)
There are a workaround out there but with real downsides.
The workaround is to enable a port for ingress in the grafana addon and allow anonymous login.
The downside in this solution is:
a) remote access to grafana dashboard needs additional port (e.g. additional port-forwarding on router)
b) anonymous login needs a role in grafana. If role is
viewerI'm also just a viewer if I access the grafana over the link in the left. So I can't edit anything. If role iseditororadmineveryone with access to configured port can edit everything.So for my usecase this is really not desired. I want to shared just some dashboards but no one exept the HA admin should edit any of the dashboards. For this case there is no solution.
May be possible solutions:
May there will be other possibilities I don't know at the moment.
Beta Was this translation helpful? Give feedback.
All reactions