Report any open doors/windows

I do understand and respect your standpoint on apps that require full access to Homey to do what they do. To add to that, the code of Heimdall is open source and I invite everybody with second thoughts to review the code at GitHub - daneedk/com.uc.heimdall: Heimdall for Homey

2 Likes

Hello everyone, I wrote a script for get zonename by device.zone.

Script:

//get zone name
async function getZoneName(zoneId) {
var result = “unknown”;
let allZones = await Homey.zones.getZones();

    for (let zone in allZones) {
        if ( allZones[zone].id == zoneId ) {
            result = allZones[zone].name;
        }
    };
    return result;
}

And you can call it:

return getZoneName(device.zone);

or part of string

… + await getZoneName(device.zone) + …

Now where have I seen that before… :thinking::wink:

3 Likes

Thank you for the nice script. Could you also write it without ‘(undefined)’ behind each sensor? This way, I can have a notification triggered through a speaker

1 Like

Hi peter
thanks for the script, i just found it here, but im kinda new to homey and the script are working very well, just want to know how i can ge the output from it into a push message to a user i pick, hope you can help thanks

Thank @RonnyW :wink:

You can use the used Homeyscript tag/variable for those cases;
It’s created/updated in this line of the script:

// Create / update HomeyScript variabele
await tag("door_windowText", windowText);

Just select it to add it to any messaging card:



For advanced flow
You can use the adv. flowcard THEN "Run code and return Text-tag¨, when you change
this

return (true);

into this

return (windowText);

Like:

Screenshot from 2024-08-25 01-24-23

The available output tag “Result”, can be used in a messaging card

Thank you so much! appreciate you help very much!

1 Like