Announcement: HADashboard v1.72

I’ll dig out the details tomorrow (on my iPad now) - ping me if I forget!

Thanks: I tried looking in the dashing wiki but haven’t found anything yet.

I never noticed the iframe widget until you mentioned it, as it doesn’t appear to be documented, but I am also unable to get anything but a blank widget.

@aimc is this not an officially supported widget yet? :slight_smile:

I’m also interested in how to change the aspect ratio

The iframe widget is one you get for free when you create a dashboard - I haven’t ever used it and it has no spcific significance for HA but it should work.

I posted info about the aspect ratio here

1 Like

Ok, gotcha… that’s too bad, since it appears to be broken. The only thing my dashboard is missing is the ability to integrate external data, static text data, or even custom data that does not conform to one of the HA widgets, I was so excited when I saw iframe but if it ever worked before it has since broken.

Thanks for the link to the aspect ratio steps, much appreciated! Between HADashboard and AppDaemon, I am in heaven!!!

2 Likes

@jbags81 had this working with the iframe widget in his dashboard and I posted to the thread asking him to share how he got it to work but he never replied back. Maybe he’ll see his mention in this thread and check in.

From what I can see, there’s a CURL involved to actually get the data source, which Dashing then processes. I never got around to it but I started reading the repo here:

Let us know how you make out.

That was exactly what I needed to get it working!!!

You don’t need the CURL part if you are doing it inline, so all you need to do is replace the contents of iframe.coffee you posted into the iframe.coffee in HADashboard so that it includes both of those $(@node) lines

Then I just added scrolling=“no” to the existing iframe.html and it just works :smiley:

Of course in the example where data-id=“iframeId1”, that can be anything, and has to be different if you have more than 1 iframe in your dashboard, but yeah, works perfectly!

Of course this will break the next time @aimc does an update, so I have made a backup of my iframe widget folder so I can replace it after each upgrade.

@aimc, you think it would be possible to add these changes to the iframe widget so it will work even after an update?

The iframe.coffee has to be:

class Dashing.Iframe extends Dashing.Widget

  ready: ->
    $(@node).find(".iframe").attr('src', @get('src'))

  onData: (data) ->
    $(@node).find(".iframe").attr('src', data.src)

and the iframe.html:

<iframe class="iframe" data-bind-src="src" scrolling="no" frameboarder=0></iframe>

1 Like

I had the answer staring me in the face the whole time. I never thought to check iframe.coffee. I guess if I run into any of the other widgets having issues, I should check against latest source.

I made the suggested changes and it’s working great now! My only problem is my radar map is too big for the widget. I’m using a gif radar map and I guess there’s no way to resize it, i’d have to make the widget too big. :frowning:

Glad this helped! (Both of us!)

Yeah, I just noticed that as well… I’m only seeing the top left corner of my content… hmmm… gonna mess with it… gotta be a way to have the source display based upon the dimensions of the widget.

Good work guys - I’ll make sure this is added to the next release so nothing breaks for you.

2 Likes

Maybe in the .SCSS?

Awesome, thank!!!

Could be… gonna do some research… I’ve had this kind of issue in the past using iframes in other web development projects, so there’s gotta be something out there

I’m looking right now too.

This looks like a possibility:

Yeah, I tried implementing it but saw no discernible difference in the outcome. Other than that page sounding like what we needed, most of what I am finding is of the mindset that it is not possible to resize the content from another source, as the browser simply sees the iframe as a separate browser window, therefore it renders the source material as if the iframe were a full screen. The source material would have to be changed to render specifically for the size of your iframe.

If your radar map is a gif, you should try the BigImage widget, it auto resizes images to fit the size of the widget. I just tried it with a snapshot url feeding directly off one of my cameras in the house and it resized it correctly, showing the entire field of view of the camera, but resized to the size of my widget. It works with still images and video feeds :smiley:

I looked at that but the only problem is there is no provision for updating. You’d have to set up a cron job with curl and grab the radar map in a timed interval and copy it to a directory for local display.

It’s too bad we can import the camera class from HA; that would sole all our problems.

Well, couldn’t you use either an HA automation or an AppDaemon automation to do a command line for wget or some other means of downloading the image every X minutes to overwrite the old image that the BigImage widget is pointing to?

What URL radar map are you using? Maybe I can look at it and two heads can come up with a means of getting the updated image.