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

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 ?

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

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

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

No actually i got a fibaro button image

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

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

then in a different flow I check if the “T_BrandAlarm_Text” changes and write that text (string) to to push notification

Hope this may bring you on an idea

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

On my side i am using

it s great because it tells me if a sensor is armed or unarmed.
But it does not tell me which one !!

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)

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

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


Action card with HomeyScript tag:




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

1 Like

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

Thank you so much it works awsomely !

Thank you also for contributing your vision

1 Like

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

1 Like

YES… thankyou