# Start a flow from HomeyScript

**URL:** <https://community.homey.app/t/start-a-flow-from-homeyscript/25225>\
**Category:** Developers\
**Tags:** homeyscript, flow\
**Created:** [January 30, 2020, 3:34pm UTC](https://community.homey.app/t/start-a-flow-from-homeyscript/25225 "2020-01-30T15:34:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonas\_Hermansen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jonas_hermansen/32/9665_2.png) [@Jonas\_Hermansen](https://community.homey.app/u/Jonas_Hermansen)\
**Post date:** [January 30, 2020, 3:34pm UTC](https://community.homey.app/t/start-a-flow-from-homeyscript/25225/1 "2020-01-30T15:34:22Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![KonradWalsh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/konradwalsh/32/147_2.png) [@KonradWalsh](https://community.homey.app/u/KonradWalsh)\
**Post date:** [January 30, 2020, 3:36pm UTC](https://community.homey.app/t/start-a-flow-from-homeyscript/25225/2 "2020-01-30T15:36:48Z")

</div>

by searching before posting

[https://community.homey.app/tag/homeyscript](https://community.homey.app/tag/homeyscript)

---

<div class="post-metadata">

**Author:** ![Jonas\_Hermansen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jonas_hermansen/32/9665_2.png) [@Jonas\_Hermansen](https://community.homey.app/u/Jonas_Hermansen)\
**Post date:** [January 30, 2020, 3:47pm UTC](https://community.homey.app/t/start-a-flow-from-homeyscript/25225/3 "2020-01-30T15:47:34Z")

</div>

I did that, and read those topics, particularly [Best way to trigger a flow from homeyscript](https://community.homey.app/t/best-way-to-trigger-a-flow-from-homeyscript/19790/9), 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.

---

<div class="post-metadata">

**Author:** ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)\
**Post date:** [January 30, 2020, 5:21pm UTC](https://community.homey.app/t/start-a-flow-from-homeyscript/25225/4 "2020-01-30T17:21:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jonas\_Hermansen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jonas_hermansen/32/9665_2.png) [@Jonas\_Hermansen](https://community.homey.app/u/Jonas_Hermansen)\
**Post date:** [January 30, 2020, 5:31pm UTC](https://community.homey.app/t/start-a-flow-from-homeyscript/25225/5 "2020-01-30T17:31:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)\
**Post date:** [January 30, 2020, 5:44pm UTC](https://community.homey.app/t/start-a-flow-from-homeyscript/25225/6 "2020-01-30T17:44:39Z")

</div>

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()]);

---

<div class="post-metadata">

**Author:** ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)\
**Post date:** [January 30, 2020, 6:10pm UTC](https://community.homey.app/t/start-a-flow-from-homeyscript/25225/7 "2020-01-30T18:10:24Z")

</div>

on the old forum you also can find some information:

> **[HomeyScript - share your scripts - main discussion topic - Page 2](https://forum.athom.com/discussion/comment/61291/#Comment_61291)**
>
> HomeyScript can possibly change the need to have Apps installed for all kinds of functionality. Getting the scripts to work is not the hardest part.
