# Alarm \<alarm\> goes of in \<minutes\> minutes with tags

**URL:** https://community.homey.app/t/alarm-alarm-goes-of-in-minutes-minutes-with-tags/132326
**Category:** Questions & Help
**Created:** [March 8, 2025, 2:08pm UTC](https://community.homey.app/t/alarm-alarm-goes-of-in-minutes-minutes-with-tags/132326 "2025-03-08T14:08:29Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Litego](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/litego/32/121579_2.png) [@Litego](https://community.homey.app/u/Litego)
#### Post date: [March 8, 2025, 2:08pm UTC](https://community.homey.app/t/alarm-alarm-goes-of-in-minutes-minutes-with-tags/132326/1 "2025-03-08T14:08:29Z")

</div>

Hello, I can not get this alarm card to trigger when I am using tags. If I write 1 minute in the card it works, but if I make a tag called “Duration” with a “1” then it does not work. How come?

---

<div class="post-metadata">

### Author: ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)
#### Post date: [March 8, 2025, 2:54pm UTC](https://community.homey.app/t/alarm-alarm-goes-of-in-minutes-minutes-with-tags/132326/2 "2025-03-08T14:54:30Z")

</div>

That’s correct, it is a limitation or known issue  
But probably wil not be fixed.

You could ask Athom support for it.

---

<div class="post-metadata">

### Author: ![Litego](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/litego/32/121579_2.png) [@Litego](https://community.homey.app/u/Litego)
#### Post date: [April 3, 2025, 10:26pm UTC](https://community.homey.app/t/alarm-alarm-goes-of-in-minutes-minutes-with-tags/132326/3 "2025-04-03T22:26:06Z")

</div>

Well this is a major problem! How is a small bug like this not prioritized to be fixed? Where do I report a complaint?

I have an engine block heater that needs to run for a variable amount of time based on the outside temperature. So I want to set the pick up time as an alarm and have the start time be calculated based on the temperature. How do I do that if I can not set the alarm with tags, and I can not pull the DateTime value of the alarm to use in some other logic?

---

<div class="post-metadata">

### Author: ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)
#### Post date: [April 4, 2025, 4:32am UTC](https://community.homey.app/t/alarm-alarm-goes-of-in-minutes-minutes-with-tags/132326/4 "2025-04-04T04:32:57Z")

</div>

> [@Litego](#):
>
> Where do I report a complaint?

Not at the community… you could try [https://homey.app/support/](https://homey.app/support/)  
If that gives you a good feeling.

But I guess you better work to a flow that doesn’t need this tag in the trigger.

---

<div class="post-metadata">

### Author: ![Wim\_Post](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wim_post/32/56793_2.png) [@Wim\_Post](https://community.homey.app/u/Wim_Post)
#### Post date: [April 4, 2025, 5:09pm UTC](https://community.homey.app/t/alarm-alarm-goes-of-in-minutes-minutes-with-tags/132326/5 "2025-04-04T17:09:30Z")

</div>

Workaround:  
I assume you already have an algorithm that calculates the number of minutes needed to preheat your engine depending on outside temperature . Let’s say X minutes.  
Set an alarm ‘ time to leave home’ for the time you want to leave home.

WHEN  
Alarm ‘time to leave home’ goes off in 60 minutes.  
THEN  
Start timer ‘preheating engine’ with runtime {{60-X}} minutes.

WHEN  
Timer ‘preheating engine’ ends  
THEN  
Start preheating engine

---

<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: [April 4, 2025, 7:52pm UTC](https://community.homey.app/t/alarm-alarm-goes-of-in-minutes-minutes-with-tags/132326/6 "2025-04-04T19:52:33Z")

</div>

As workaround, the [Timey app](https://community.homey.app/t/app-pro-timey-make-your-time-flows-dynamic-with-variables/118139) can trigger flows with the time set by variables/tags:

 ![1000046007](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/3/6303c22406ef596b886aaec50a67fd2b216622e0.jpeg)

> [@Litego](#):
>
> Where do I report a complaint?

In our country we say “Where can I send an improvement proposition” instead 😉😉

---

<div class="post-metadata">

### Author: ![Litego](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/litego/32/121579_2.png) [@Litego](https://community.homey.app/u/Litego)
#### Post date: [January 1, 2026, 7:48pm UTC](https://community.homey.app/t/alarm-alarm-goes-of-in-minutes-minutes-with-tags/132326/7 "2026-01-01T19:48:29Z")

</div>

Okey, so here’s an update on this issue. I’ve had some time to look at this during the holiday and I’ve found a solution and I’d like to share it if anyone else finds themselves in the same situation in the future.

> [@Wim\_Post](#):
>
> Workaround:  
> I assume you already have an algorithm that calculates the number of minutes needed to preheat your engine depending on outside temperature . Let’s say X minutes.  
> Set an alarm ‘ time to leave home’ for the time you want to leave home.
> 
> WHEN  
> Alarm ‘time to leave home’ goes off in 60 minutes.  
> THEN  
> Start timer ‘preheating engine’ with runtime {{60-X}} minutes.
> 
> WHEN  
> Timer ‘preheating engine’ ends  
> THEN  
> Start preheating engine

I tried this, but it was limited to 120 minutes. Where I live it can reach -40 Celsius, with a recommended 60 minutes per -10C I needed it to go up to 240, so I couldn’t use that solution.

I looked into Timey and found it useful if I could pull the time and days of my alarms.

I don’t know how to code, so with the help of AI I made a script that pulls the time of my alarms(arg), the calculated preheat time(arg) and whether they are active today, and outputs it into tags. Then I use those tags to set the variables which I then can trigger with Timey.

I have two alarms that can trigger the same power outlet, but I chose to run both through a single script with arguments and use tags instead of setting the variables directly.

SOLUTION:

Here’s the script:

```auto
// Fix: Access the first element of the args array
const input = args[0]; 

if (!input) {
    log("Error: No arguments provided. Use format: 'Alarm Name,Offset'");
    return false;
}

// Split the string into the alarm name and the offset
const [alarmName, offsetMinutes] = input.split(',');

const alarms = await Homey.alarms.getAlarms();
const myAlarm = Object.values(alarms).find(a => a.name === alarmName);

let startTime = "00:00"; // Initialized as a String (Text)
let isScheduledToday = false; // Initialized as a Boolean (Yes/No)

if (myAlarm) {
    // 1. ALWAYS calculate the Start Time (regardless of day)
    let [h, m] = myAlarm.time.split(':').map(Number);
    let date = new Date();
    date.setHours(h, m, 0, 0);
    date.setMinutes(date.getMinutes() - parseInt(offsetMinutes));
    
    const startTime = date.getHours().toString().padStart(2, '0') + ':' + 
                      date.getMinutes().toString().padStart(2, '0');

    // 2. Check if active for TODAY
    const todayIndex = new Date().getDay();
    const days = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];
    const currentDay = days[todayIndex];

    // Fix: Access day via the 'repetition' object
    const isDayActive = myAlarm.repetition && myAlarm.repetition[currentDay];
    const isNoneRepetition = !myAlarm.repetition || Object.keys(myAlarm.repetition).length === 0;

    isScheduledToday = myAlarm.enabled && (isDayActive || isNoneRepetition);

    // 3. EXPORT the results as Flow Tags
    await tag('PreAlarmTime', String(startTime)); 
    await tag('IsActiveToday', Boolean(isScheduledToday));
    
    log(`Sync: Start Time is ${startTime}. Active Today: ${isScheduledToday}`);
    return true;
} else {
    log(`Alarm '${alarmName}' not found.`);
    return false;
}

```

And here’s the flow (partially in Norwegian and English):

 ![Motorvarmer](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/a/8a295ea13f96e08ff5e064255422135272a7cbd2.jpeg)

The Check | Motorvarmer is a variable I flip every 1 hour or 30 minutes to update the time since there is no trigger for “Alarm changed“. The reason I flip a variable is so that I can gather all my “every ## hour“ triggers in a single flow.
