# Controleren wat een script doet

**URL:** <https://community.homey.app/t/controleren-wat-een-script-doet/153672>\
**Category:** Flows\
**Created:** [April 12, 2026, 1:08pm UTC](https://community.homey.app/t/controleren-wat-een-script-doet/153672 "2026-04-12T13:08:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cor\_Brink](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/cor_brink/32/121519_2.png) [@Cor\_Brink](https://community.homey.app/u/Cor_Brink)\
**Post date:** [April 12, 2026, 1:08pm UTC](https://community.homey.app/t/controleren-wat-een-script-doet/153672/1 "2026-04-12T13:08:33Z")

</div>

Ik heb een simpel script, wat de tijdlijn leeg maakt als deze te vol wordt.  
Ik wil in een flow controleren of de output van dat script true of false is.  
Ik dacht dat het op deze manier zou werken, maar dat is helaas niet zo.  
Weet iemand hoe het wel moet?

Het script

```auto
// Maak tijdlijn leeg
// Alleen notificaties tellen en wissen
const notifications = await Homey.notifications.getNotifications();
const tmp = Object.keys(notifications).length;

if (tmp >= 500) {
    await Homey.notifications.deleteNotifications();
    log('Tijdlijn gewist, totaal was:', tmp);
    return true; // Dit geeft een 'Vinkje' aan de Flow
}
return false; // Dit geeft een 'Kruisje' aan de Flow (niet gewist)

```

De flow

 ![Schermafbeelding 2026-04-12 150710](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/2/424fb2298a6eac98fa3b3e5f15dcbbd87c46cfb4.png)

---

<div class="post-metadata">

**Author:** ![SunBeech](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sunbeech/32/111391_2.png) [@SunBeech](https://community.homey.app/u/SunBeech)\
**Post date:** [April 12, 2026, 1:21pm UTC](https://community.homey.app/t/controleren-wat-een-script-doet/153672/2 "2026-04-12T13:21:59Z")

</div>

> [@Cor\_Brink](#):
>
> de tijdlijn leeg maakt als deze te vol wordt.

In mijn geval bevat de tijdslijn alleen de recente meldingen. In de mobiele app zijn er dat ongeveer 120 en in de web app iets meer, ongeveer 250. Geen noodzaak om de tijdslijn op te schonen. Is dat in jouw geval anders?

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [April 12, 2026, 1:38pm UTC](https://community.homey.app/t/controleren-wat-een-script-doet/153672/3 "2026-04-12T13:38:16Z")

</div>

Ik denk dat met de kaart die je hebt gekozen, de foutmelding (rode output) alleen wordt geactiveerd bij daadwerkelijke scriptfouten. `return false;` is geen scriptfout.

Je zou in plaats daarvan de kaart “Code uitvoeren en ja/nee-tag retourneren” moeten gebruiken.  
Deze kaart heeft aan de rechterkant echte true- en false outputs.

 ![Screenshot_20260412_153749_Vivaldi](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/7/67fbb548cf8918cd6bc72f8c1fcdb622fe9672c9.jpeg)

.

Over tijdlijn manipulatie zelf, zul je dit topic wel interessant vinden:

> [@\[HomeyScript\] Timeline Wrangler](https://community.homey.app/t/homeyscript-timeline-wrangler/90714):
>
> Timeline Wrangler As the Community App Store has been offline for a while making the Timeline Manager² app unavailable, and seen several people that want to maintain their notification timeline on a occasional basis I’ve tried to make a HomeyScript that can do exactly that. How to use: The only thing you need is an Homey Pro (any version, besides Homey (Cloud)) and the app [HomeyScript](https://homey.app/a/com.athom.homeyscript). When you have that app installed you can go to the [Web GUI =\> Scripts](https://my.homey.app/scripts) and click on “New HomeyScript” on the b…

---

<div class="post-metadata">

**Author:** ![smarthomesven](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/smarthomesven/32/79712_2.png) [@smarthomesven](https://community.homey.app/u/smarthomesven)\
**Post date:** [April 12, 2026, 2:41pm UTC](https://community.homey.app/t/controleren-wat-een-script-doet/153672/4 "2026-04-12T14:41:16Z")

</div>

Je moet `throw new Error();` gebruiken in plaats van `return false;`

---

<div class="post-metadata">

**Author:** ![Cor\_Brink](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/cor_brink/32/121519_2.png) [@Cor\_Brink](https://community.homey.app/u/Cor_Brink)\
**Post date:** [April 12, 2026, 4:39pm UTC](https://community.homey.app/t/controleren-wat-een-script-doet/153672/5 "2026-04-12T16:39:45Z")

</div>

Tijdens testen laat ik vaak een melding geven. Dat waren er een heleboel. Die wilde ik opruimen en kwam toen een topic tegen over opschonen. Dat ben ik gaan testen en toen kwam ik tegen dit probleem aan. Vandaar de vraag.

Misschien meteen een andere vraag: kan ik vanuit een script ook een variabele doorgeven aan een flow ( in dit geval het aantal items).

---

<div class="post-metadata">

**Author:** ![SunBeech](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sunbeech/32/111391_2.png) [@SunBeech](https://community.homey.app/u/SunBeech)\
**Post date:** [April 13, 2026, 7:24am UTC](https://community.homey.app/t/controleren-wat-een-script-doet/153672/6 "2026-04-13T07:24:18Z")

</div>

> [@Cor\_Brink](#):
>
> Misschien meteen een andere vraag: kan ik vanuit een script ook een variabele doorgeven aan een flow ( in dit geval het aantal items).

Ik heb zelf geen ervaring met HomeyScript, maar heb deze vraag vaker langs zien komen. Ik raad je aan om even te zoeken op het forum. In ieder geval kwam ik de volgende gerelateerde topics tegen:

> [@Trying to set a variable from a script, help needed](https://community.homey.app/t/trying-to-set-a-variable-from-a-script-help-needed/103582):
>
> Hi, I’m trying to set a boolean variable from a script, that should be then used in flows. I understood that I am supposed to set a tag and not a global variable. So looking at examples i put: await tag(‘aria\_inquinata’, aria\_inquinata); return("aria inquinata: "+aria\_inquinata); The script returns the value, but the variable is not appearing under “variables” in the app and I can’t use it to trigger a flow. It does appear under the tags that can be selected in the “and” part. If I create…

> [@Get value from homeyscript in a variable that can be used in advanced flow](https://community.homey.app/t/get-value-from-homeyscript-in-a-variable-that-can-be-used-in-advanced-flow/107990):
>
> Hello, I would like to use the value returned by the function as variable so I can use this one further in the Flows. I don’t know how to register this value in a variable (not in homeyscript nor in Flow). [image] function solarangle(azimuth,altitude){ var teta=90-altitude; var beta = 90 - Math.atan(Math.tan(teta\*Math.PI/180)\*Math.sin((azimuth-167)\*Math.PI/180))\*180/Math.PI; return beta; } So I would like to get the value of “beta” in an existing variable to use in Flow. I hope that so…

---

<div class="post-metadata">

**Author:** ![Cor\_Brink](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/cor_brink/32/121519_2.png) [@Cor\_Brink](https://community.homey.app/u/Cor_Brink)\
**Post date:** [April 13, 2026, 1:16pm UTC](https://community.homey.app/t/controleren-wat-een-script-doet/153672/7 "2026-04-13T13:16:10Z")

</div>

Bedankt voor het meedenken. Ik vond de oplossing hier:  
[Setting Logic Variable by HomeyScript - Questions & Help - Homey Community Forum](https://community.homey.app/t/setting-logic-variable-by-homeyscript/14819/43)
