Iframe card and embed javascript

How do I embed a Darksky widget into a card? I tried iframe and put the following in the URL, but it doesnt’ like the javascript:

<script type='text/javascript' src='https://darksky.net/widget/small/32.7763,-96.7969/us12/en.js?width=100%&height=200&title=dallas, tx&textColor=333333&bgColor=FFFFFF&transparency=false&skyColor=undefined&fontFamily=Default&customFont=&units=us'></script>

Were you able to solve this? I’m also looking at a solution for this. I needed to incorporate camera/s to HA. But these are traffic cameras from the CALTRANS website.

No, I haven’t. Have you?

Unfortunately no.

I’m trying the same.
No success.

Hi there, I had the same need just today.
It seems that things have changed since this topic was opened, but this discussion is still one of the top result of (my) google search… So I hope it is OK if I necropost this discussion with a solution for posterity…

Not sure when, but the Webpage (iframe) Card added the support for local files placed in the <config-directory>/www folder; so here’s how you can solve this:

  • create an html file in the www folder with this structure:

    <html>
      <body>
        <!--your script and html code here-->
     </body>
    </html>
    
  • set the url of the Webpage Card to /local/<name-of-the-file>.html

2 Likes