Way to locally hit IFTTT webhook URL?

I have an integrations where I'm using IFTTT to trigger a device with a specific payload from IFTTT.

There are scenarios where I would like to also do this locally.

My question is if there is a way to hit this app webhook from a local URL perspective and not having to hit cloud.hubitat.com

e.g. here is the URL (snipped and xx'ed out for privacy)
https://cloud.hubitat.com/api/a4a9snip-8ab1-45snio-snip-67snip712snip/apps/641/ifttt?access_token=6f7xxxxx-snip-4f0c-8snip-88xxx3csnip

If it works like the Maker API, then I don't see why not. I have a lock device that I call through the api in the format:

http://hub_ip/apps/api/app_number/device....

1 Like

Thanks..
Yeah, but for whatever reason I'm getting rejected when I do that. So not entirely sure what is missing.

Perhaps I'll need to go the MakerAPI route and call and Action on it via an HTTP Momentary Switch.

OAuth2 Apps support both Cloud and Local endpoints, typically...

Here is the formatting difference.

Local
http://192.168.1.144/apps/api/3077/[yourEndpointHere]?access_token=12345678-1234-1234-1234-123456789012

Cloud
https://cloud.hubitat.com/api/12345678-1234-1234-abcd-123456789012/apps/3077/[yourEndpointHere]?access_token=12345678-1234-1234-1234-123456789012

So, in your case, have you tried...

http://192.168.1.123/apps/api/641/ifttt?access_token=6f7xxxxx-snip-4f0c-8snip-88xxx3csnip
2 Likes

Yeah, I tried that and used the exact Access token I have given IFTTT (which works), but when called locally (and formatted that way) I get a:
[warn](http://192.168.0.51/device/edit/1185)Connection refused (Connection refused)

from http://192.168.0.51/apps/api/641/ifttt?access_token=<snip access token>

The IFTTT URL is:
https://cloud.hubitat.com/api/<snipHubid>/apps/641/ifttt?access_token=<snip access token>

:frowning:

Edit: the device 1185 is a virtual device using your driver @ogiewon which is fantastic and I use for other scenarios as well.

What system locally is issuing the call? If it is the Hubitat hub trying to call itself, then you'd probably have problems.

Also, what OAuth App are you using on Hubitat? The app may be only accepting CLOUD connections for some reason. I know Maker API allows one to enable/disable both local and cloud endpoints.

Great questions.
So using PostMan hitting locally did work, so the good news is the app does accept local webhook pushes.

Yes, I'm using HE and your HTTP Momentary Switch to push this:

What I am trying to achieve is I want to replace IFTTT with an Alexa Routine. And instead of trying to modify the Ring app, I thought I'd use a virtual device I can make accessible to Alexa, and have that device trigger the App appropriately. Not super efficient, but seemed like an easy route.

Yep, that'll cause an issue...just like when RM tries to call the hub's reboot URL.

Try adding :8080 to the end of the IP address. That's how it's fixed in RM when a rule is trying to call the hub's own web server.

Not sure if my HTTP Momentary Switch allows that or not, but you should be able to tweak that code easily enough if it doesn't.

3 Likes

Brilliant. That worked. Thank you very much!!

Specifically I change the port from 80 to 8080 in your Virtual Device Driver.
image

2 Likes