Alarm Clock Andorid sends UNDEF

I’ve just configured the transfer of the Alarm Clock Time from the Android App on my Galaxy S10 to OpenHab.

At first it seems, it works:

But then I got the State UNDEF and I don’t know why, because I didn’t change the Alarm Clock Time on my Phone.

I thinks the problem is on the Phone, because even the Apps shows the UNDEF status:

UNDEF is send when there’s no alarm set or when the next alarm is set by an app that used to set false alarms: https://github.com/openhab/openhab-android/blob/main/mobile/src/main/java/org/openhab/habdroid/background/BackgroundTasksManager.kt#L617-L621

Do you see any “Alarm sent by …” lines in the log of the Android app?

I think you are right, because now I’ve Alarm Time Stamps that are not set within the Android Alarm Clock App. But how can I figure out which App on the phone causes the wrong alarms?

Is this the Log that you mean? I searched for “Alarm” but didn’t find anything.

That’s the correct log, but it seems to be quite short. I have to see how the debugging can be improved in this case.

let me know, i’ve I can help.

And I’ve a suspect. When I told Alexa “remember me in 30min”, the time from the Alexa reminder was transfered from the Openhab App to my OpenHab System.

Is there the possibility to block Alexa reminders and alarms?

It’s only possible to block an app entirely. If Alexa can have valid alarms, I wouldn’t block it.

currently it seems that I got valid Alarms from the Alexa App but also invalid “UNDEF” Alarms that are overwriting the Alarms from the native Androird Alarm Clock App. Tell me if I can support in any way with tests or something like that.

@mueller-ma
is there any chance to deactivate the Alexe UNDEF Alarms?

I don’t think so. I’m going to add a sentence about these UNDEF alarm to the docs: Explain limitations of getting the alarm clock by mueller-ma · Pull Request #2882 · openhab/openhab-android · GitHub

I’ve been seeing the same issue on my phone (Google Pixel 6a running Android 13 beta, with Googles own clock app) and I’m wondering if it’s perhaps caused by the original-package values being passed back by PackageParser.java along with the package name as an array rather than a single value?

val sender = info?.showIntent?.creatorPackage

In any case, sender evaluates as ‘null’ and my openhab app refuses to send through the time.

It could just be the beta OS causing the issues, ofc. Any ideas?

Can you turn on debug mode? Then you’ll see notifications when new alarms are scheduled.

08-08 17:07:46.682 30877 30877 D BackgroundTasksManager: onReceive() with intent android.app.action.NEXT_ALARM_CLOCK_CHANGED
08-08 17:07:46.682 30877 30877 D BackgroundTasksManager: Alarm clock changed
08-08 17:07:46.684 30877 30877 D BackgroundTasksManager: Alarm sent by null
08-08 17:07:46.685 30877 30877 D BackgroundTasksManager: Got value 'ValueWithInfo(value=UNDEF, mappedValue=null, type=Timestamp, debugInfo=Ignored alarm time update to 07:30 2022-08-09 which was sent by null)' for alarmClock
08-08 17:07:46.689 30877 30877 I BackgroundTasksManager: Don't send update for item ColinAlarmClock with value ValueWithInfo(value=UNDEF, mappedValue=null, type=Timestamp, debugInfo=Ignored alarm time update to 07:30 2022-08-09 which was sent by null)
08-08 17:07:47.442 30877 30877 D BackgroundTasksManager: onReceive() with intent android.app.action.NEXT_ALARM_CLOCK_CHANGED
08-08 17:07:47.442 30877 30877 D BackgroundTasksManager: Alarm clock changed
08-08 17:07:47.442 30877 30877 D BackgroundTasksManager: Alarm sent by null
08-08 17:07:47.443 30877 30877 D BackgroundTasksManager: Got value 'ValueWithInfo(value=UNDEF, mappedValue=null, type=Timestamp, debugInfo=Ignored alarm time update to 07:30 2022-08-09 which was sent by null)' for alarmClock
08-08 17:07:47.447 30877 30877 I BackgroundTasksManager: Don't send update for item ColinAlarmClock with value ValueWithInfo(value=UNDEF, mappedValue=null, type=Timestamp, debugInfo=Ignored alarm time update to 07:30 2022-08-09 which was sent by null)
08-08 17:07:48.727 30877 30887 V MediaPlayer: resetDrmState:  mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
08-08 17:07:48.727 30877 30887 V MediaPlayer: cleanDrmObj: mDrmObj=null mDrmSessionId=null
08-08 17:07:50.845 30877 30877 D BackgroundTasksManager: onReceive() with intent android.app.action.NEXT_ALARM_CLOCK_CHANGED
08-08 17:07:50.845 30877 30877 D BackgroundTasksManager: Alarm clock changed
08-08 17:07:50.846 30877 30877 D BackgroundTasksManager: Alarm sent by null
08-08 17:07:50.846 30877 30877 D BackgroundTasksManager: Got value 'ValueWithInfo(value=UNDEF, mappedValue=null, type=Timestamp, debugInfo=Ignored alarm time update to 07:00 2022-08-10 which was sent by null)' for alarmClock
08-08 17:07:50.849 30877 30877 I BackgroundTasksManager: Don't send update for item ColinAlarmClock with value ValueWithInfo(value=UNDEF, mappedValue=null, type=Timestamp, debugInfo=Ignored alarm time update to 07:00 2022-08-10 which was sent by null)
08-08 17:07:51.683 30877 30877 D BackgroundTasksManager: onReceive() with intent android.app.action.NEXT_ALARM_CLOCK_CHANGED
08-08 17:07:51.684 30877 30877 D BackgroundTasksManager: Alarm clock changed
08-08 17:07:51.684 30877 30877 D BackgroundTasksManager: Alarm sent by null
08-08 17:07:51.685 30877 30877 D BackgroundTasksManager: Got value 'ValueWithInfo(value=UNDEF, mappedValue=null, type=Timestamp, debugInfo=Ignored alarm time update to 07:30 2022-08-09 which was sent by null)' for alarmClock
08-08 17:07:51.687 30877 30877 I BackgroundTasksManager: Don't send update for item ColinAlarmClock with value ValueWithInfo(value=UNDEF, mappedValue=null, type=Timestamp, debugInfo=Ignored alarm time update to 07:30 2022-08-09 which was sent by null)

Maybe trying to send this from my mobile wasn’t a great idea… The log excerpt is from earlier today, the screenshot (if it’s worked) shows the current notifications.

edit: attached “full” log
next_alarm.txt (18.1 KB)

Now that android 13 is in GA, I’m still seeing this and it’s now affecting my better half too.

Anyone else seeing the same thing?

Tracked in Sending Alarm Clock no longer working in Android 13 · Issue #3010 · openhab/openhab-android · GitHub

Could I add to this?
I’ve got a strange behaviour where the AlarmClock is being sent 9:00 from the app if no alarms are enabled.

I’m on an S10 as well with Android 12 and using the Samsung Clock app.
Is this expected behaviour?
I guess I don’t normally use 9:00 for an alarm, so I could detect that time and assume they are off?

Maybe there’s another app that sets alarms. Can you enable debug mode (in app settings) and share the notifications that will appear?

Had a good look through the phone, there’s only that one app setting alarms. No calendar entries etc.
I couldn’t find debug mode in app settings, there’s a “View log” option but that didn’t have anything related to the 9:00 and a “Show information for troubleshooting” option but no more clues

Please enable this and wait until the alarm item has been set to 9:00. There should be an Android notification then that tells you the app that sets this alarm.

I have Android 11 in use. Openhab 3.4.1. Openhab Android App 3.1.0.
My alarm will be set well, but i must start my alarm app better alarm after a start up. Alarm will be updated to the next alarm. Sounds good at first. Then i switch off the screen and my alarm will be set to screen off time plus 10 minutes. That confuse me. After wake up my phone the alarm will be set to my set alarm time. That confuses me. I don’t get any information about updates of item into the log file.

It seems that there is a fight i dont know:

grafik

I don’t know if this is an issue of openhab or android system with better alarm. Maybe someone has an idea.

Thanks.

Is 5:50 the valid alarm clock time?
Other apps, like miui securitycenter may use the same API to schedule internal tasks. I can ignore this app, like it’s done for others: openhab-android/BackgroundTasksManager.kt at main · openhab/openhab-android · GitHub