# Array of door sensors -\> filter -\> notif i any open by name

**URL:** <https://community.homey.app/t/array-of-door-sensors-filter-notif-i-any-open-by-name/53754>\
**Category:** Questions & Help\
**Tags:** app, tools, flow\
**Created:** [October 26, 2021, 12:07pm UTC](https://community.homey.app/t/array-of-door-sensors-filter-notif-i-any-open-by-name/53754 "2021-10-26T12:07:11Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattrix](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mattrix/32/17475_2.png) [@mattrix](https://community.homey.app/u/mattrix)\
**Post date:** [October 26, 2021, 12:07pm UTC](https://community.homey.app/t/array-of-door-sensors-filter-notif-i-any-open-by-name/53754/1 "2021-10-26T12:07:12Z")

</div>

Hello, this is “guru” question probably.

I am trying to get a notification like “the front door is not closed” once a script has checked all my door sensors.

To be more clear :

- I have several fibaro door sensors
- I want to have a notification if one or more of them are in “alarm contact true” and then get a notification saying “front door is not closed” and/or “backdoor is closed”

I have managed to create an array thanks to javascript logic app but i cannot retrieve the array and use it to say the notification correctly.

Any ideas how to perform that ?

---

<div class="post-metadata">

**Author:** ![Chris\_nl](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chris_nl/32/27194_2.png) [@Chris\_nl](https://community.homey.app/u/Chris_nl)\
**Post date:** [October 26, 2021, 12:20pm UTC](https://community.homey.app/t/array-of-door-sensors-filter-notif-i-any-open-by-name/53754/2 "2021-10-26T12:20:38Z")

</div>

Are you trying to setup your own app or looking for a way to get this working?  
Heimdall has this functionality, so you might want to have a look at that app, or you can just create flows, not sure why you want to use a script for it, but maybe i don’t understand exactly what you are trying to accomplish

---

<div class="post-metadata">

**Author:** ![mattrix](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mattrix/32/17475_2.png) [@mattrix](https://community.homey.app/u/mattrix)\
**Post date:** [October 26, 2021, 12:51pm UTC](https://community.homey.app/t/array-of-door-sensors-filter-notif-i-any-open-by-name/53754/3 "2021-10-26T12:51:13Z")

</div>

@Chris_nl  
Thanks for your answer i am going to check heimdal.

What i want to acomplish is start a flow that notifies me if a door or a windo is opened. if it is opened then i am notified which one is opened

---

<div class="post-metadata">

**Author:** ![Chris\_nl](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chris_nl/32/27194_2.png) [@Chris\_nl](https://community.homey.app/u/Chris_nl)\
**Post date:** [October 26, 2021, 12:54pm UTC](https://community.homey.app/t/array-of-door-sensors-filter-notif-i-any-open-by-name/53754/4 "2021-10-26T12:54:44Z")

</div>

Do you want to get a message every time you open it, or for example when you leave the house, or at certain times during the day?

All of these can be done with regular flows (sometimes you need to create multiple flows, depending on what you want to accomplish), but I personally use heimdall, [Link to the forum post with a lot of interesting information](https://community.homey.app/t/heimdall-let-homey-watch-over-your-home/134)

---

<div class="post-metadata">

**Author:** ![mattrix](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mattrix/32/17475_2.png) [@mattrix](https://community.homey.app/u/mattrix)\
**Post date:** [October 26, 2021, 1:01pm UTC](https://community.homey.app/t/array-of-door-sensors-filter-notif-i-any-open-by-name/53754/5 "2021-10-26T13:01:53Z")

</div>

@Chris_nl  
No actually i got a fibaro button ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/f/7fc76e3c50588792bb7fda76814f71307ecc3617.png)

if i click on it, i want to get notification that tells me which door is left opened (or which door sensor is in alarm) and if none, then notifies me All is fine

---

<div class="post-metadata">

**Author:** ![Sebas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sebas/32/33892_2.png) [@Sebas](https://community.homey.app/u/Sebas)\
**Post date:** [October 26, 2021, 1:04pm UTC](https://community.homey.app/t/array-of-door-sensors-filter-notif-i-any-open-by-name/53754/6 "2021-10-26T13:04:34Z")

</div>

You could also do something like this…  
Im using my thermostat to check if there is an fire (if temperature \>40\*C then write a text to “T\_BrandAlarm\_Text” also including the actual temperature  
[https://homey.app/f/OG1IYO/](https://homey.app/f/OG1IYO/)

then in a different flow I check if the “T\_BrandAlarm\_Text” changes and write that text (string) to to push notification  
[https://homey.app/f/qIzIYO/](https://homey.app/f/qIzIYO/)

Hope this may bring you on an idea

---

<div class="post-metadata">

**Author:** ![Chris\_nl](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chris_nl/32/27194_2.png) [@Chris\_nl](https://community.homey.app/u/Chris_nl)\
**Post date:** [October 26, 2021, 1:07pm UTC](https://community.homey.app/t/array-of-door-sensors-filter-notif-i-any-open-by-name/53754/7 "2021-10-26T13:07:33Z")

</div>

Not sure if/how to accomplish it with heimdall, but can probably be done, I use heimdall as my alarm when i leave the house, have a look at the Pre Arming check in the link i just sent you.

If that doesn’t solve the issue you can just create 1 or more regular flows

---

<div class="post-metadata">

**Author:** ![mattrix](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mattrix/32/17475_2.png) [@mattrix](https://community.homey.app/u/mattrix)\
**Post date:** [October 26, 2021, 1:11pm UTC](https://community.homey.app/t/array-of-door-sensors-filter-notif-i-any-open-by-name/53754/8 "2021-10-26T13:11:04Z")

</div>

On my side i am using

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/a/5a42f722ed39096693d7fd7b64a639a91d63990a.png)  
it s great because it tells me if a sensor is armed or unarmed.  
But it does not tell me which one !!

---

<div class="post-metadata">

**Author:** ![Chris\_nl](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chris_nl/32/27194_2.png) [@Chris\_nl](https://community.homey.app/u/Chris_nl)\
**Post date:** [October 26, 2021, 1:26pm UTC](https://community.homey.app/t/array-of-door-sensors-filter-notif-i-any-open-by-name/53754/9 "2021-10-26T13:26:29Z")

</div>

If this is working for you and you just want to know the status of all sensors, you can add them using tags in your message field, if you just want to get a list of sensors that are triggered you need some other logic in the AND field probably (not sure, cause i can’t see the code ou are using to check)

---

<div class="post-metadata">

**Author:** ![Chris\_nl](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chris_nl/32/27194_2.png) [@Chris\_nl](https://community.homey.app/u/Chris_nl)\
**Post date:** [October 26, 2021, 4:11pm UTC](https://community.homey.app/t/array-of-door-sensors-filter-notif-i-any-open-by-name/53754/10 "2021-10-26T16:11:06Z")

</div>

Have a look in the Heimdall topic, just posted a setup that will accomplish what you seem to want there, even with Heimdall

---

<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:** [October 26, 2021, 5:00pm UTC](https://community.homey.app/t/array-of-door-sensors-filter-notif-i-any-open-by-name/53754/11 "2021-10-26T17:00:15Z")

</div>

I think this can be of use (in Dutch though):

Flow:

Action card with HomeyScript tag:

> ![Screenshot_20211026-190150_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/6/7626252f4fed8d392beef600395be42154795d9f.jpeg)

Result:

> ![Screenshot_20211026-185245_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/5/a5c8beeb59d64fccbefefab2bad6816b93f8dc18.jpeg)

Script:

> [@"flow" is uitgeschakeld omdat deze Flow te vaak werd uitgevoerd](https://community.homey.app/t/flow-is-uitgeschakeld-omdat-deze-flow-te-vaak-werd-uitgevoerd/48884/10):
>
> ```auto
> // script deur_raam-nog_open.js
> //
> let devices = await Homey.devices.getDevices();
> let windowText = "";
> let currentText = "";
> let logText = "";
> let windowOpen = false;
> _.some(devices, device => 
> {
> if(device.class == 'sensor')
> {
> if( device.capabilitiesObj &&
> device.capabilitiesObj.alarm_contact &&
> device.capabilitiesObj.alarm_contact.value )
> {
> currentText = "";
> // Vul hier al je contact sensors in, device.name == "Exacte sensornaam"
> // currenText = "Sensornaam"
> if( device.name == "Deur Trap")
> currentText = "Deur trap";
> if( device.name == "Deur Badkamer")
> currentText = "Deur badkamer";
> if( device.name == "Raam Slaapkamer")
> currentText = "Raam slaapkamer";
> if( device.name == "Deur Koelkast")
> currentText = "Deur koelkast";
> if(currentText != ""){
> windowOpen = true;
> if(windowText=="")
> windowText = currentText;
> else
> windowText = windowText + ", " + currentText;
> }
> }
> }
> });
> if(windowOpen == true)
> windowText = "De volgende deuren of ramen staan nog open: " + windowText;
> else
> windowText = "Alle deuren en ramen zijn dicht";
> // console.log(windowText);
> await tag("door_windowText", windowText );
> return windowOpen;
> 
> ```

---

<div class="post-metadata">

**Author:** ![DirkG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkg/32/118897_2.png) [@DirkG](https://community.homey.app/u/DirkG)\
**Post date:** [October 26, 2021, 5:06pm UTC](https://community.homey.app/t/array-of-door-sensors-filter-notif-i-any-open-by-name/53754/12 "2021-10-26T17:06:50Z")

</div>

This is the script I wanted to post, only in German language… 😉

---

<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:** [October 26, 2021, 5:09pm UTC](https://community.homey.app/t/array-of-door-sensors-filter-notif-i-any-open-by-name/53754/13 "2021-10-26T17:09:42Z")

</div>

Yes, Dirk, the question reminded me of the “When Rain / Thunderstorm is expected, notify which doors/windows are still open” question.

---

<div class="post-metadata">

**Author:** ![mattrix](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mattrix/32/17475_2.png) [@mattrix](https://community.homey.app/u/mattrix)\
**Post date:** [October 27, 2021, 9:45am UTC](https://community.homey.app/t/array-of-door-sensors-filter-notif-i-any-open-by-name/53754/14 "2021-10-27T09:45:15Z")

</div>

@Peter_Kawa  
Thank you so much it works awsomely !

@Chris_nl  
Thank you also for contributing your vision

---

<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:** [October 27, 2021, 7:02pm UTC](https://community.homey.app/t/array-of-door-sensors-filter-notif-i-any-open-by-name/53754/15 "2021-10-27T19:02:38Z")

</div>

YW! And I got the script from @RonnyW I have to say.

---

<div class="post-metadata">

**Author:** ![Rune\_Trangbaek](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rune_trangbaek/32/49554_2.png) [@Rune\_Trangbaek](https://community.homey.app/u/Rune_Trangbaek)\
**Post date:** [June 3, 2022, 6:55pm UTC](https://community.homey.app/t/array-of-door-sensors-filter-notif-i-any-open-by-name/53754/16 "2022-06-03T18:55:32Z")

</div>

YES… thankyou

---

<div class="post-metadata">

**Author:** ![widameista](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/widameista/32/23333_2.png) [@widameista](https://community.homey.app/u/widameista)\
**Post date:** [June 12, 2026, 5:38am UTC](https://community.homey.app/t/array-of-door-sensors-filter-notif-i-any-open-by-name/53754/17 "2026-06-12T05:38:09Z")

</div>

@DirkG : can this script be used for symplifying a similar problem but with bool variables:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/b/3badd2aab68b60c94f0c09bd2bcbb2c3eb485793.png)

---

<div class="post-metadata">

**Author:** ![DirkG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkg/32/118897_2.png) [@DirkG](https://community.homey.app/u/DirkG)\
**Post date:** [June 12, 2026, 9:33am UTC](https://community.homey.app/t/array-of-door-sensors-filter-notif-i-any-open-by-name/53754/18 "2026-06-12T09:33:14Z")

</div>

Yes, it should.  
However, I haven’t used the script in quite some time.

---

<div class="post-metadata">

**Author:** ![widameista](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/widameista/32/23333_2.png) [@widameista](https://community.homey.app/u/widameista)\
**Post date:** [June 14, 2026, 8:14pm UTC](https://community.homey.app/t/array-of-door-sensors-filter-notif-i-any-open-by-name/53754/19 "2026-06-14T20:14:50Z")

</div>

with the Help of ChatGPT i managed to use a script instead of this stupid flow:

> Script:  
> const variables = await Homey.logic.getVariables();  
> const activeVariables = Object.values(variables)  
> .filter(v =\>  
> v.type === ‘boolean’ &&  
> v.value === true &&  
> v.name.startsWith(‘Sensor’)  
> )  
> .map(v =\> {  
> const name = v.name.replace(/^Sensor/i, ‘’);  
> // Variablennamen nach Sensor verwenden und bei Großbuchstaben im Namen ein Blank einfügen  
> return name.replace(/([a-zäöüß])([A-ZÄÖÜ])/g, ‘$1 $2’);  
> });  
> const result = activeVariables.join(', ');  
> log(activeVariables);  
> // Flow-Tag setzen  
> await tag(‘WindowOpen’, result);  
> // true zurückgeben, wenn mindestens eine Variable aktiv ist  
> return activeVariables.length \> 0;
