Is it someone who can make a simple Web-api that trigger a flow and show me the code?
And Yes, a have read the documentation but need some “hello word” code to start with and i want to trigger a flow from Wab-api.

Please Micke


Triggers are usually triggered from within Homey,
It uses the arguments like changed temperature, wind, state or even Who came home as tokens in the flow.

but the ‘This Flow is started’ card can be triggerd from the Web Api.
fe. Homeyscript uses the Web API and this script triggers the flow with the mentioned id.
let result = await Homey.flow.triggerProgrammaticFlow({ id: '3c80f61d-e511-4e10-a4d7-e9d7b6b601be' })
console.log (result)

if it returns true it worked.


Great. Thanks. Is it any way to trigger script website thru web-api.


Have you looked at https://apps.athom.com/app/com.internet ?
Does it provide what you want?


Yes. Exacly. I have try it and its great but i want to access my flows directly not thru a app.


I agree! I would love to trigger a flow without needing to set up an additional flow that uses a http request


I asked about the REST API, apparently its been completely forgotten and "why you would want to use REST’ when we have a JS api.

I was a little dumb founded.


So. is there a way to trigger a flow externally via web-api? Think that ex. As you Jamie write, Rest is possible the easiest way. Is there anyone out there who knows how to do with the Web-api?


I cobbled this up: https://github.com/robertklep/homey-web-api-example

Since it’s not possible to get custom OAuth2 client credentials (:soon:), I’ve borrowed the ones that belong to athom-cli. The token is being read from its configuration file, so you need to have a properly configured athom-cli before you can use the test code.

Even though the documentation states that there is a triggerFlow() method, there isn’t (perhaps it exists in the latest version of athom-api, 2.0.133, but that version doesn’t work properly). Instead, I used testFlow.