Mobile app for android can't pick up alarm clock time in sensor

I just got a new phone and everything is working except for the alarm sensor.

I can’t get any alarm clock alarms to show up. Always says ‘unavailable’.

it didn’t work with default settings so I found the package name for the clock package (com.sec.android.app.clockpackage) and entered it into the allowable packages list but still nothing.

Any advice?

You’ll need to avoid using Samsung apps like the calendar and clock. They do not respect the API being used and actually abuse it. Stick to Google clock out sleep as Android they are known to work well. You have to make sure they’re are no alarms and calendars set by the Samsung apps.

the clock app worked fine for a year before I upgraded my phone. It’s the same app and the same settings in the app since it was transferred over when I did the upgrade.

is there some reason for it to suddenly stop working just because it’s a new phone?

Ask Samsung, the API that the app is using has been around since the first version of Android. All the app does is read the value supplied, unfortunately a lot of Samsung apps makes use the alarm API and set alarms for other apps to do things not related to an end user alarm and that interferes and there is no way to get rid of that data. The best you can do is use apps that make the best use of the API, Samsung and other manufacturers are known to abuse this API which is why we recommend other apps.

For example setting a calendar appointment in the Samsung calendar app will set alarms 10 minutes before the calendar event. The google calendar app does not set alarms to achieve this.

OK, I took your suggestion and switched to the google clock for the alarms.

I added “com.google.android.deskclock” to the allow list.

i set an alarm and it showed up as the next alarm.

however, now i can’t get that alarm to go away.

I turned the alarm off and expected the “next_alarm” sensor to go to unavailable. It didn’t. it stayed showing the same value for the next alarm as I had previously set.

And even if I set another alarm it still shows that one as the next alarm.

However, if I set an alarm before the previous one it shows that one as the next alarm.

IOW, if i have an alarm set for 1920 today it shows the next alarm is at 1920 today. If I turn it off it still shows the next alarm as 1920 today. If I set a new alarm for 1900 today it then shows that alarm as the next alarm. If I turn that one off it still shows as that being the next alarm, even tho it is turned off.

1 Like

You most likely have another app that is setting an alarm. Check the app configuration logs to see which package has an alarm set. The next alarm API is very literal in the sense of next scheduled alarm and any app can set alarms.

Nope.

it’s the same app package as I whitelisted above:

as you can see from that screenshot the next_alarm state is at 0745 this morning. The alarm is turned off on my phone right now and the current time when that pic was taken was 1049.

Something is definitely not right. At least compared to the way things worked before.

EDIT to add:

As a test I also whitelisted the other clock package from Samsung and it behaves in exactly the same way now.

So both are now doing the same thing.

I really don’t care which one I use since they both “work” (kind of…) but I really need the mobile app to show when there is no alarm set on my phone.

If you would like to troubleshoot then I suggest you look at the logs I mentioned up above.

You will see a line like this to learn about the offending package

OK, here are the logs. I scrubbed them to only show the “NextAlarm” entries for the relevant times.

I’m in the US Eastern TZ.

At 1309 I set the samsung alarm for 1400.
At 1310 I turned off the samsung alarm
At 1311 I set the google alarm for 1355
At 1312 I turned off the google alarm.

I tried to disable the samsung calendar but I can’t and I can’t delete it either. However, it shouldn’t be affecting anything since it is being skipped due to not being in the allow list.

10-16 13:07:31.680  5952  6514 D NextAlarm: Next alarm is scheduled by com.samsung.android.calendar with trigger time 1634443200000
10-16 13:07:31.680  5952  6514 D NextAlarm: Skipping update from com.samsung.android.calendar as it is not in the allow list
10-16 13:07:59.653  5952  6514 D NextAlarm: Next alarm is scheduled by com.samsung.android.calendar with trigger time 1634443200000
10-16 13:07:59.653  5952  6514 D NextAlarm: Skipping update from com.samsung.android.calendar as it is not in the allow list
10-16 13:09:01.567  5952  6514 D NextAlarm: Next alarm is scheduled by com.sec.android.app.clockpackage with trigger time 1634407200000
10-16 13:10:02.148  5952  6514 D NextAlarm: Next alarm is scheduled by com.samsung.android.calendar with trigger time 1634443200000
10-16 13:10:02.148  5952  6514 D NextAlarm: Skipping update from com.samsung.android.calendar as it is not in the allow list
10-16 13:11:01.259  5952  6514 D NextAlarm: Next alarm is scheduled by com.google.android.deskclock with trigger time 1634406900000
10-16 13:11:01.861  5952  6774 D NextAlarm: Next alarm is scheduled by com.google.android.deskclock with trigger time 1634406900000
10-16 13:11:31.285  5952  6514 D NextAlarm: Next alarm is scheduled by com.google.android.deskclock with trigger time 1634406900000
10-16 13:11:32.823  5952  6197 D NextAlarm: Next alarm is scheduled by com.google.android.deskclock with trigger time 1634406900000
10-16 13:12:01.964  5952  6197 D NextAlarm: Next alarm is scheduled by com.samsung.android.calendar with trigger time 1634443200000
10-16 13:12:01.964  5952  6197 D NextAlarm: Skipping update from com.samsung.android.calendar as it is not in the allow list
10-16 13:12:02.069  5952  6200 D NextAlarm: Next alarm is scheduled by com.samsung.android.calendar with trigger time 1634443200000
10-16 13:12:02.069  5952  6200 D NextAlarm: Skipping update from com.samsung.android.calendar as it is not in the allow list
10-16 13:12:07.331  5952  6200 D NextAlarm: Next alarm is scheduled by com.samsung.android.calendar with trigger time 1634443200000
10-16 13:12:07.331  5952  6200 D NextAlarm: Skipping update from com.samsung.android.calendar as it is not in the allow list
10-16 13:12:15.511  5952  6514 D NextAlarm: Next alarm is scheduled by com.samsung.android.calendar with trigger time 1634443200000
10-16 13:12:15.511  5952  6514 D NextAlarm: Skipping update from com.samsung.android.calendar as it is not in the allow list

For some reason it never picks up the alarms being turned off.

Is that possibly an event that the app isn’t looking for in the newer android OS?

As long as you see “skipping update” you can be sure that the app is not sending a state update at all. Remove all items from your samsung calendar to avoid this behavior. The Next Alarm is very literal. It only tells us the next scheduled alarm (not the one before but the one that is next to fire). If you have an app that sets an alarm every 30 seconds and that app is not in your allow list then you can see how very difficult it will be to see a state update. You won’t see an update until 30 seconds BEFORE your alarm goes off because that is when it is considered NEXT. You have to think in a linear time format here. There is no way around this other than to avoid apps that abuse the API and in order to do that here you need to remove all calendar entries.

1 Like

Apparently during the phone upgrade the Samsung calendar app linked all of my other calendars to itself. Luckily I don’t use the samsung calendar so I had the ability to turn all of those completely off (but I still even had to restart the phone in order for the samsung calendar event to stop updating). That will suck for those users who don’t have that ability.

I have to say that the way the app updates the sensor for next alarm is not intuitive at all.

If the sensor is only set up to update based on only one package (the package listed above) then why would the calendar package have any effect at all on the sensor? I would think that since the sensor update is skipped due to the package not being allowed then the alarms being turned off would be the only event that it listens for. And to make it more confusing it doesn’t actually change the state to reflect any event in the calendar app that is actually blocking the real alarm clock app from updating the alarms correctly. The next_alarm was always set to the state of the earliest clock app alarm even if that alarm was turned off.

Without this exchange there would have been no way at all to know where the issue was. Especially since it had worked before and I never even used the Samsung calendar app before (TBH, I didn’t even know it was installed…by default…and can’t be deleted… :roll_eyes:)

So thanks for the help on this.

You again are misunderstanding how the android API works, I dont really know how else to explain it to you other than to look at things in a linear timeline fashion. If you have an alarm set 5 minutes and another app sets one every 30 seconds. Then the next Alarm API will not report your alarm up until 4 minutes and 30 seconds passes because then AND only then will it be the Next Alarm. Does that make sense when you look at a 5 minute time line? Now imagine you have a recurring 5 minute alarm, when do you think the app will get the update about the second 5 minute alarm? After another 4 minutes and 30 seconds passes, meaning the old 5 minute alarm will still show as a state. It wouldn’t make sense for the app to flip to unavailable here because that state will only show when android reports no next alarms.

That is not how android API works, it only reports the next scheduled alarm which can be set by any app.

This is because other apps are sending in data that we ignore because of the allow list.

This is exactly why the logging section exists and why we print the offending package so the user can correct it. There is nothing we can do about apps that abuse the API.

All I can say about this is ask Samsung why they abuse the API.

I have similar issue with samsung s10e.

I am using Caynax Alarm Clock and I added it to Allow list, but alarms are not picked up by the app.

All I see i the same calendar events as @anon69719423 .

Any clock up should be automatically picked up if added to allow list, right?

The allow list is only used for which events get sent, there is nothing the app can do to ignore events set by other apps. It is up to the user find the offending app and stop it from registering updates with Android API.

I had to enter the Samsung Calendar app on the phone and disable every calendar that contained an entry (I have 5 google calendars I track). I unlinked them all and just kept the phone’s (empty) samsung calendar.

everything works now.

Mine started working by itself after a day… But I have no idea why…