# Check all sensors + alert + action

**URL:** <https://community.homey.app/t/check-all-sensors-alert-action/68159>\
**Category:** Flows\
**Tags:** advancedflow\
**Created:** [August 30, 2022, 11:41am UTC](https://community.homey.app/t/check-all-sensors-alert-action/68159 "2022-08-30T11:41:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sly666](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sly666/32/58841_2.png) [@Sly666](https://community.homey.app/u/Sly666)\
**Post date:** [August 30, 2022, 11:41am UTC](https://community.homey.app/t/check-all-sensors-alert-action/68159/1 "2022-08-30T11:41:34Z")

</div>

Hello All

I’m trying to create a flow without success… if anyone can guide me, i take 😉

i’ll try to explain my idea;

Context : i’m using heimdall for the alarm and i wanted to have an text message to prevent me if i let a open window.

on heimdall app, option is existing, but only for speaking and i’m activate the alarme when i’m outside. So not useful for my case.

my idea :  
Create flow who check the status of all door/window sensor and if one (or more) is activated, launch a command to prevent me with the name of contact.

But i don’t find a way to create that !! i haven’t Advanced flow right now.

any suggestion, tricks, tip are welcome

thx a lot !

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [August 30, 2022, 2:18pm UTC](https://community.homey.app/t/check-all-sensors-alert-action/68159/2 "2022-08-30T14:18:39Z")

</div>

If you activate the sensor check in Heimdall, it should write these alerts to the timeline. You can activate push messages for all timeline notifications from Heimdall in timeline settings. So you will get warnings and alerts via Pushmessage.

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [August 30, 2022, 2:22pm UTC](https://community.homey.app/t/check-all-sensors-alert-action/68159/3 "2022-08-30T14:22:05Z")

</div>

Or you can use Homeyscript and create a script to check all your windows.  
Example: [Homey Web App (Soon) - #28 by RonnyW](https://community.homey.app/t/homey-web-app-soon/39283/28)  
There are other modified version to find in the forum, all Homeyscript based.

---

<div class="post-metadata">

**Author:** ![Sly666](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sly666/32/58841_2.png) [@Sly666](https://community.homey.app/u/Sly666)\
**Post date:** [August 30, 2022, 2:23pm UTC](https://community.homey.app/t/check-all-sensors-alert-action/68159/4 "2022-08-30T14:23:11Z")

</div>

to be honest, i don’t want use heimdall function to do that, because, the night, i activate the alarm when i go sleeping, and i let some of windows open, so it speak too for me 😉

---

<div class="post-metadata">

**Author:** ![Sly666](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sly666/32/58841_2.png) [@Sly666](https://community.homey.app/u/Sly666)\
**Post date:** [August 30, 2022, 2:23pm UTC](https://community.homey.app/t/check-all-sensors-alert-action/68159/5 "2022-08-30T14:23:30Z")

</div>

i will check this solution ! maybe !! thx.

---

<div class="post-metadata">

**Author:** ![Cuprum](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/cuprum/32/41409_2.png) [@Cuprum](https://community.homey.app/u/Cuprum)\
**Post date:** [September 1, 2022, 5:34am UTC](https://community.homey.app/t/check-all-sensors-alert-action/68159/6 "2022-09-01T05:34:05Z")

</div>

> [@Sly666](#):
>
> any suggestion, tricks, tip are welcome

Something [like that](https://community.homey.app/t/the-flow-with-i-million-thenssss/65004/11) ?  
Yeah, of course You must find out the trigger; make regexp(or change with device list) and also the usage of tag, but actually, IMHO there is no other way, than a little scripting 😉

---

<div class="post-metadata">

**Author:** ![Sly666](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sly666/32/58841_2.png) [@Sly666](https://community.homey.app/u/Sly666)\
**Post date:** [September 1, 2022, 8:05am UTC](https://community.homey.app/t/check-all-sensors-alert-action/68159/7 "2022-09-01T08:05:39Z")

</div>

Thx a lot ! at the end i started my own script yesterday (i used somes examples here), almost same as yours (mine more crappy ;)) but it works.

```auto
/*
 * In this script we print all sensor values.
 */

let windowText = "";

let message = "";

// Get all devices
const devices = await Homey.devices.getDevices();

// Loop over all devices
for (const device of Object.values(devices)) {

  // If this device isn't available, skip it.
  if (!device.capabilitiesObj ) continue;

  // If this device is a sensor (class) + alarme contact
  if (device.class === 'sensor' && device.capabilitiesObj.alarm_contact &&
device.capabilitiesObj.alarm_contact.value ) {
    //log(`\n=== ${device.name} ===`);

    for (const capability of Object.values(device.capabilitiesObj)) {
      //log(`${capability.title}: ${capability.value}`);

      if (capability.title === "Alarme contact" && capability.value === true) 
          {
            //log(device.name + " -> " + 'Ouvert')
            windowText = device.name
            console.log(windowText);
            await tag("windowText", windowText );
            message += windowText + " -> " + 'Ouvert / '

          }

}

    }
  }
await tag("messageCheckSensor", message );
return message;

```
