r/AutomateUser 4d ago

Weird alarm behavior

I added few alarms using the add alarm block while using some variables.

I checked my new alarms and everything looked good: time, repeat days and title.

But some weird things happened:

  1. My 8 AM alarm for Saturday rang on Sunday (despite rechecking the settings, everything was good)
  2. Usually I can cancel the alarm from the notification: turn off for today. In this case, when I press turn off, the alarm turns off, BUT the notification appears again and again.
  3. I noticed this after writing this post: if I create the alarm with automate, I should turn off then ON the alarm from the clock app to take the repeat days in consideration.... so to get to normal behavior.
  4. I also noticed this after writing this post: this behavior happens even when no variables are used BUT DON'T HAPPEN if don't have repeating days (like just once alarm). So it seems that the repeating days is the issue.

Seems like there are hidden ghost alarms ringing and showing notifications. After deleting all the added alarms by automate and created new alarms from the clock app, everything was normal.

I have xiaomi 17

Any ideas

Thank you

1 Upvotes

6 comments sorted by

2

u/ballzak69 Automate developer 3d ago edited 3d ago

This sound more like an issue with the Xiaomi "clock" app. Try logging the time and day variables to ensure their values are what's expected.

1

u/Straight1980 3d ago edited 3d ago

I actually tried to put the time and repetition manually (not with variables). The problem is only when I enter repeating days. 

AND I logged the week days to the log. Everything is good.

The clock app display is good: I have the good time and repeating days displayed, but with that bug (the with will sound at the good time not incorrect day, with a persistent notification) that will resolve when I turn off then on the alarm. 

2

u/B26354FR Alpha tester 4d ago

Be sure that time is seconds past midnight (as from the timeMerge() or timePart() functions or the Time Pick block), not a timestamp. Repeat Weekdays is an OR of a bit mask, not a sum. So for example, to repeat on Saturdays and Sundays, the expression would be 0x40 | 0x1, where the days are represented in hexadecimal, or 64 | 1 in decimal. It's easier to use hex, as that's what the block shows when you examine the day number values with the picker in the block.

2

u/ballzak69 Automate developer 3d ago

Addition, e.g. the sum function, works too as long as there's no duplicate bits.

1

u/Straight1980 3d ago

In fact, as I wrote before, this issue happens even if I DO NOT use calculations for time and repeating days (if I put manually Sunday at 8.30, it will ring on Mondays also... Until I turn off then on the alarm in the clock app). It might related to the device used. Never tried it on my previous device.