Javascript Widget Help

I’m totally new to Hass.io and AppDaemon so please bare with me. I’ve spent a lot of time googling this too.

I’m looking to use a Javascript Widget and am trying to find an example. Up to how my home automation has been powered via Domoticz and a custom built dashboard. I am looking to move to HADashboard and so far so good, however I have two buttons on my Domoticz dashboard that use JS to call Ifttt functions.

I’m looking to make these work in HADashboard. The code is.

function whiskyon() {
var xhttp = new XMLHttpRequest();
xhttp.open(“GET”, “https://maker.ifttt.com/trigger/whiskyon/with/key/MYKEYHERE”, true);
xhttp.setRequestHeader(“Content-type”, “application/json”);
xhttp.send();
var response = JSON.parse(xhttp.responseText);

}

Could someone show me an example of the Javascript Widget and how this would be implemented? Alternatively a way to call Ifttt triggers from HADasboard.

Thanks

i think you can find what you are looking for here:

1 Like

Perfect thanks!, I had read that but don’t think I read it properly.

Appreciate it!

Regards

Andrew