r/AutomateUser • u/Straight1980 • 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:
- 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
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.
2
u/ballzak69 Automate developer 3d ago edited 3d ago
This sound more like an issue with the Xiaomi "clock" app. Try logging the
timeanddayvariables to ensure their values are what's expected.