Homey Community Forum

How to use webhook?

Hi all, I have a camera. When I want to trigger a flow when there is a motion detection . I followed the webhook document to the third step… But I don’t know where this ‘device-api’ comes from. Do I need to implement it myself?

What they mean is that if your device has its own API that you can use to register a webhook with, this is how to use it. If not, you need to look at one of the other options.

Thank you, I think I understand. In the registerHook method, I need to register the url to my device, and then execute the ‘createWebhook’ method

Just out of curiosity: why are you creating a full app? From what it sounds like, all you need is for your camera to call a particular URL when motion is detected. If so, you can do that with just flows: there’s a Logic card “IF is received”, which will get triggered if you request a particular URL (https://<homey-cloud-id>.connect.athom.com/api/manager/logic/webhook/<event>?tag=<tag>).

Haha, because I want my app to have an event flow card instead of setting it up by the user…

Oh right, I thought you were just making an app for yourself :sweat_smile: