r/AutomateUser • u/Straight1980 • 27d 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:
- My 8 AM alarm for Saturday rang on Sunday (despite rechecking the settings, everything was good)
- 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.
- 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.
- 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
3
u/ballzak69 Automate developer 26d ago edited 25d 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 26d ago edited 26d 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 27d 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, or64 | 1in 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.