I have an automation that is triggered by a Webhook. I can trigger it no problem using curl in my terminal, but for some reason I cannot get it to work in Google Apps Script. Here is how I would call it using curl:
curl -X POST -H "Content-Type: application/json" -d '{}' http://homeassistant.local:8123/api/webhook/test
And here is what my code looks like in Apps Script:
I get a “Bad request: http://homeassistant.local:8123” error thrown at me. I’m super confused because everything works fine with a normal HTTP request (like curl).
Hm I see. Thanks for your answer! How do you know it’s not accessible to the cloud? Sorry I’m really not computer savvy, maybe this is obvious.
And I’m curious about how you would go about this? I wanted to create an automation every time a google sheets update. Maybe use Google’s API and run a local script instead?
Ok I think I get it – HA runs locally. It’s not on the “internet” per se, or the cloud. So you cannot fetch a URL using Google’s AppsScript. Is there a way to make my server accessible to the cloud? Or is that a big privacy issue?
You can, but the external_url has to work and it cannot use a self-signed certificate.
So if you have signed up for nabu-casa it will work, or if you have set-up external access properly another way it will work. TTS will have the same issues.
Ok I see. I am not signed up for nabu-casa and I already have their one-month free cloud trial a while ago… Do you know of any other service to make my webhook url public?