Start a flow from HomeyScript

Hi everyone.

I’m dipping my toes into HomeyScript and I’m struggeling to start a flow from HomeyScript.

My goal is to check whether my internet connection is live, and if not start a series of actions, including rebooting the router.
I’ve managed to check whether or not the internet connection is live, but I can’t figure out how to start the flow.

Does anyone have an example of how it’s done?

by searching before posting

https://community.homey.app/tag/homeyscript

I did that, and read those topics, particularly Best way to trigger a flow from homeyscript, but I couldn’t figure out what the solution was.

I haven’t found an example I can use.
What I need is basicaly just the concrete syntax needed to start a flow with a given name.

In your script, You can set a variable and let a flow start when this variable has changed.

Do you have an example of how to set/change a variable in the script then?

Not really a variable but a tag:

const DAYS = [‘zondag’, ‘maandag’, ‘dinsdag’, ‘woensdag’, ‘donderdag’, ‘vrijdag’, ‘zaterdag’];
var WeekDay = DAYS[new Date().getDay()];
await setTagValue(“WeekDay”, {type: “string”, title: “WeekDay”}, DAYS[new Date().getDay()]);

on the old forum you also can find some information: