Homey Community Forum

How to read the documentation

I am trying to learn homeyscript. For a absolute NOOB and a non-programming type it is quite a steap learning process.

I came across this information.


How do I interpretate this? And how do i make use off it in Homeyscript.
It would be great if I could start a flow with a script.

I also stumbled upon this rule but cannot get it working. I did add the id off the flow.

  • You can ignore the OAuth scopes, Homeyscript has a fixed set of scopes (which, I don’t know) so it’s not something you have control over.
  • that the method is async means it returns a promise
  • the (single) argument opts is optional (although it being optional doesn’t make sense because what would triggerFlow() do without any information on what to trigger exactly?)
  • when you pass it, it should be an object with one mandatory property id and an optional property state.
  • id is the id of the flow you want to trigger (this is something you have to infer from the documentation, it’s not explicitly stated)
  • nobody knows what state means

In your example code, instead of triggerProgrammaticFlow use triggerFlow.

1 Like

I get this as return, does it mean you can’t access flows from a script?

Yes, sounds like Homeyscript isn’t allowed to do that. There’s nothing you can do about that (apart from asking Athom why they have decided to cripple Homeyscript like this).