Hi,
I am new to this forum and to Home Assistant.
I have Home assistant up and running on a Mac server and it is working as it should. I have also added support for Verisure in order to get control over my smart plugs. Works fine.
I have external access with the help of port forwarding and that also works fine.
Now I am trying to trigger a script from my android phone with the help of google assistant and IFTTT.
I am able to get IFTTT to run with my voice command but I cannot manage to get it to trigger the script on my Home Assistant instance.
I have external access with the help of port forwarding and that works fine.
I have created a script in Home Asssitant that i called âlampsoffâ. When I trigger this from within Home assistant it is working as supposed and turns the light off.
But to get this to work with IFTTT⌠please help me before I loose all my hair
I have read several threads without luck.
So what, exactly do I need to type in the configuration of the IFTTT script?
So i have made som changes in IFTTT and the IFTTT (see picture) recipe runs without any errors now. However the script in Home Assistant still does not run. Any idea?
Yes, that will work if youâre not passing any data. But if you need to pass data, you should set Content Type to application/json, and then enter the data (formatted as JSON) in the Body.
The URL depends on how youâve exposed HA to the web. What do you use when you want to open the front end in a browser from outside your LAN? The first part (e.g., https://X.duckdns.org:8123/) is the same for both opening the frontend in a browser, and using the REST API from IFTTT webhooks.
Other than that, when youâre calling a service, you need to make sure the IFTTT webhook uses the POST command (not GET. See here.) Otherwise, the rest of the URL looks correct.
BTW, if youâre not passing any variables to the script, Content Type shouldnât matter (although it doesnât hurt to set it to application/json), and the Body can be left empty.
So what works when youâre opening the UI in a browser from outside your LAN? Whatever you use for that should be the same as the first part of the URL you use in IFTTT (with api/âŚ&api_password=X appended on the end.) Thatâs what I use in IFTTT and it works for me.
Have you tried using curl? Even if youâre on your LAN, that URL should get routed outside and then back in through the router. Might be worth a try, especially if you use curlâs -v option.
From what youâve said https://x.duckdns.org/api/services/script/test?api_password=MYPSW should work. Of course, thatâs what you originally said you tried. Hmm. I would try using curl with -v. That should give you more details about why it doesnât work. I.e.:
curl -v -X POST https://x.duckdns.org/api/services/script/test?api_password=MYPSW
OK Iâm retarded, I work all day long the last months so Iâm tired , I thought that by clicking check in ifttt applwr it triggers it, I tried now with the voice command and it worked.
Thanks for your time. Now itâs time to learn how to write scripts and even better how to. Use appdeamon