Embed HTML code for Wind Guru

Hello Community,

I am running Home Assitant on a RASP PI3:

Home Assistant 2023.4.5
Supervisor 2023.04.0
Operating System 10.0
Frontend 20230411.1 - latest

I would like to embed an HTML code to have my surfing prevision on a dashboard.
I know that the webpage card exists. However, this one only can print an URL link.

My final goal is to only print this:

And this only can work if I find a way to embed this code:

<script id="wg_fwdg_48572_100_1681993877683">
(function (window, document) {
  var loader = function () {
    var arg = ["s=48572" ,"m=100","mw=46","uid=wg_fwdg_48572_100_1681993877683" ,"wj=kmh" ,"tj=c" ,"waj=m" ,"odh=0" ,"doh=24" ,"fhours=240" ,"hrsm=2" ,"vt=forecasts" ,"lng=fr" ,"idbs=1" ,"p=WINDSPD,GUST,SMER,HTSGW,PERPW,DIRPW,TMP,CDC,APCP1s"];
    var script = document.createElement("script");
    var tag = document.getElementsByTagName("script")[0];
    script.src = "https://www.windguru.cz/js/widget.php?"+(arg.join("&"));
    tag.parentNode.insertBefore(script, tag);
  };
  window.addEventListener ? window.addEventListener("load", loader, false) : window.attachEvent("onload", loader);
})(window, document);
</script>

Thanks a lot for your help!

2 Likes

Hi,
have you managed to implement Windguru?, I would like to do it too
thx
Tiziano

1 Like

And me too

I did something similar for including Windfinder in my dashboard.
This consists out of 2 steps.

  1. Create a local webpage where you put the code. I’ve created a new file (windfinder.html) in the www directory of my home assistant installation and I was able to access it at the following url:
    https://homeassistant.example.com/local/windfinder.html

  2. Include this page as an iframe:

My ultimate goal is to get the data and only notify myself when the conditions are good enough, but getting that data in the system is the challenge.

1 Like

This is the easiest way to make the WG forecast available in HA: