Check all sensors + alert + action

Hello All

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

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 !

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.

Or you can use Homeyscript and create a script to check all your windows.
Example: Homey Web App (Soon) - #28 by RonnyW
There are other modified version to find in the forum, all Homeyscript based.

1 Like

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 :wink:

i will check this solution ! maybe !! thx.

Something like that ?
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 :wink:

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.

/*
 * 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;

1 Like