#Android 'Next Alarm' sensor not working

1 messages · Page 1 of 1 (latest)

regal rose
#

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.

regal rose
#

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.

rigid igloo
#

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.

regal rose
rigid igloo
#

the package attribute i mentioned

#

that will update everytime the state changes

regal rose
rigid igloo
#

yes

#

that souds like the samsung calendar app still

#

which is known to cause issues with the sensor

regal rose
regal rose
# rigid igloo yes

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?

rigid igloo
#

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

regal rose
#

Right, but in that circumstance the device should theoretically still update itself in time for the alarm to occur?

regal rose
rigid igloo
#

most likely cant be fully removed

rigid igloo
rigid igloo
regal rose
rigid igloo
#

yea your automation

regal rose
rigid igloo
#

skips unwanted updates

#

all the app can do

regal rose
# rigid igloo all the app can do

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?

rigid igloo
#

yea that sounds about right in those cases, only way to fix that is to remove the apps/events that are causing those updates

regal rose
rigid igloo
#

yea dont use the allow list in that case

regal rose
#

So it only triggers the automation if the alarm is before a set time, and com.google.android.deskclock?

rigid igloo
#

unfortuately its an api every app has access to

#

correct

regal rose
#

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.

regal rose
regal rose
# rigid igloo correct

Is there a chance you could suggest an example for how to code things in HA which accesses the source of the next alarm?