Announcement: HADashboard v1.72

Actually it worked out well being at the end because I have them all static now in one row.

Tell me more! :astonished: Did not know this. I knew about changing sizes but not aspect ratiosā€¦

I would love to get the camera feeds into the dash (maybe the camera widget can be modified?) so this may come in handy to know. If you have a link or pointer, or just want to spell it out for me, Iā€™m sure others would also benefit from it being here.

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.