Really stumped about what is going on here, and why the sensor doesn't seem to be updating reliably, or at all. I've tried both the Samsung and Google versions of the alarm app (and put the relevant one on the allow list when doing it) and nothing works. It was sort of working yesterday, and I recently deleted the samsung calendar app, so not sure whether that has caused it to go from sort of working to not working at all. Any advice would be incredibly appreciated.
#Android 'Next Alarm' sensor not working
1 messages · Page 1 of 1 (latest)
It does appear to work to a certain extent, but it doesn't seem to be pulling information from something other than just the clock app. For example, it's now showing my next alarm is 5pm. If I set an alarm to 3pm it then updates itself to reflect this. But, if I then cancel that alarm it will still say that is my next alarm.
Unfortunately every app has access to the same API you'll need to either remove usage from the apps adding the data you don't need or try to use the allow list which really just skips updates when they not wanted. The API only returns the next scheduled alarm and there can only be 1. The package attribute in the sensor will tell you which app set the current alarm.
Is there a way for me to figure out which apps are sending alarms? If I knew then I could at least figure out how to proceed from there.
Right. So for me it says com.android.providers.calendar. So does that Package attribute change when a different source occurs?
yes
that souds like the samsung calendar app still
which is known to cause issues with the sensor
I've literally uninstalled the calendar app.
Does that then mean if I set the filter to the clock package, and then wait until that time passes before setting my actual alarm that I want (say 8am tomorrow morning), would from then out things work as expected?
best to think of the api on a linear scale where only 1 event can be considered the next event at a time...so say for example you had an app that sets an alarm every 30 sec and you only care for your alarm app which is once a day...you may only see an update 30 seconds before the actual alarm goes off
are you sure you actually uninstalled that app, its probably a system app
Right, but in that circumstance the device should theoretically still update itself in time for the alarm to occur?
I do use outlook calendar, so it might be that.
most likely cant be fully removed
could be, depends on the package name of the app
youll see the update, you can use the package attribute as a condition if you want
The condition in home assistant/
yea your automation
What then does the allow list do on the app side?
Right, right. So it still only polls the most recent alarm, but then it won't update home assistant until it seems the one/s I've allowed. Hence, what is happening for me is that there are other alerts in the way (probably events in my calendar), and so home assistant won't be updated with my alarm until that is the next one in terms of time?
yea that sounds about right in those cases, only way to fix that is to remove the apps/events that are causing those updates
Which I can't do. So, seems the solution is to basically filter for the source like you said in the automation.
yea dont use the allow list in that case
So it only triggers the automation if the alarm is before a set time, and com.google.android.deskclock?
My last scheduled calendar event concludes in an hour, so we'll see if after that it updates as I want it to.
I think I can use the allow list. It uses two different packages for the calendar and the phone.
Thanks for your help, you've really aided my understanding.
Is there a chance you could suggest an example for how to code things in HA which accesses the source of the next alarm?