Best way to get Grafana chart into Lovelace card

For anyone using a pi with docker compose to install HA, grafana and influxdb.

I was trying to use the “embed” version of the grafana link, but it wasn’t displaying in HA, although it showed up in my browsers.

Found this link
And added the last two lines, already had anonymous enabled:
- GF_AUTH_ANONYMOUS_ENABLED=true #added
- GF_SECURITY_COOKIE_SAMESITE=none #added
- GF_SECURITY_ALLOW_EMBEDDING=true #added

Did a
docker-compose down
docker-compose up -d

And then the embed command works.

Process was to make a grafana dashboard with panel I wanted, click title of panel, then share, then embed. Uncheck current time range.
Copy the information in the square, but just the http part so it looks like this:
http://192.168.xxx.xxx:3000/d-solo/ijFfehCnk/temp_3d?orgId=1&panelId=4" width=“450” height=“200” frameborder=“0”
NOTE. Not a valid link, and used the entire thing, not just the blue part.

It also seems to work the same if you just use this part
http://192.168.xxx.xxx:3000/d-solo/ijFfehCnk/temp_3d?orgId=1&panelId=4

changing panelId at end to a different even number found my other panels

Then in lovelace editor, add a webpage and paste above into the URL section. A preview should show up after you paste the link.

That’s it, how I got grafana charts added to HA.

I have detailed instructions on how I installed and set stuff up here

Randy

3 Likes