Get Graphana iframes to work via external nabu casa https: and internal http:

I have searched a lot, but I cannot find a solution. Perhaps somebody here can help or point me to existing resolutions…

So, I have graphana dashboards I want to integrate into HA as iframes. I also have the home assistant connect form nabu casa with my personal URL (lets call it my.url.com).

This is my graphana configuration:

plugins: []
custom_plugins: []
env_vars:
  - name: GF_SECURITY_ALLOW_EMBEDDING
    value: "true"
ssl: false
certfile: fullchain.pem
keyfile: privkey.pem

And this is my iframe (slightly masked):

type: iframe
url: >-
  https://my.url.com/api/hassio_ingress/yqAXXXXn2JubznXXXXynVimXXXXkcXXXXvs_F_MF4wc/d-solo/feXXXXXXXXXq8d/dashboard-name?orgId=1&timezone=browser&panelId=1&__feature.dashboardSceneSolo

It works well accessing it via my external URL, it does not work via my internal IP though. I kind of understand that I might need the NGINX addon to make it work. But as I have installed the sub domain (MY.url.com) via the nabu casa mechanism, I cannot find any howto to make this work. They all seem to rely on a duckdns installation.

Thanks a lot for any hints!

I ended up with a pretty clumsy workaround

I substituted the first half of the embedded URL generated by Grafana for my NC HTTPS address. This worked well when away from home and accessing HA via NC, but of course not when at home and using HTTP.

I ended up creating two cards, one with the substitution and one without, then using visibility conditions to hide one or other based on whether I am at home. This generally works fine, as long as I don’t use NC when at home. I needed to create a binary sensor as the condition options for visibility are limited.

  - type: iframe
    aspect_ratio: 30%
    url: >-
      https://********************.ui.nabu.casa/api/hassio_ingress/******************?from=now-30d&to=now&refresh=5s&viewPanel=panel-1&kiosk=1       
    visibility:
      - condition: state
        entity: binary_sensor.is_*******_home
        state: "off" 

  - type: iframe
    aspect_ratio: 30%
    url: >-
      http://192.168.0.xx:3000/api/hassio_ingress/******************/heat-pump-energy?from=now-30d&to=now&refresh=5s&viewPanel=panel-2&kiosk=1       
    visibility:
      - condition: state
        entity: binary_sensor.is_*******_home
        state: "on" 





  - binary_sensor:
      - name: "Is *** Home?"
        unique_id: is_***_home
        state: >
          {{ is_state('person.***', 'home') }} 

It’s pretty clunky and I’m sure there are more elegant solutions, but with my limited networking knowledge it’s the best I can do ATM! If anyone has a better solution I’d be glad to hear it…

1 Like