Next alarm sensor won't stick on the right time

I do not make use of apps that abuse the alarm API and I also have a Pixel.

There is a new feature in version 2.5.0 that allows you to create an allow list so you can block out unwanted events. Go to App configuration > Manage sensors > next alarm > then at the bottom select the allow list and choose the packages you want to get events from.

Also documented here: https://companion.home-assistant.io/docs/core/sensors#next-alarm-sensor

2 Likes

Oooh, I had not noticed that change! You just saved me a whole lot of JS frustration! :smile: Thank you. I very much appreciate it!

1 Like

I am going through the post, I am making sure, bottom line there is no fix from samsung on the next alarm time issue correct? and I understood HA is obeying what is being sent from Samsung phone. So end of the day the issue still exist.

we provide whatever data is given to us by the android api, if a manufacturer decides to go against that not much we can do. Your better off finding an app that follows better standards like the Google Clock app or Sleep as Android. Samsung and others are known to do these odd things with the alarm api.

1 Like

Sure, so say I have installed that apps… how can i send that data to HA? is that what you are referring to as “packages” to select ?

Yup that will filter out the noise from the apps that you don’t need updates from

1 Like

I will try that … thank u !

I’m trying Google clock too. Do you know the name of the package to put in whitelist?

com.google.android.deskclock

2 Likes

Thank you very much.

OT: I just found that Google clock can start a Google Assistant routine when alarm rings! :smiley:
this is great…

@dshokouhi I have a Samsung s20 plus and when I set my alarm in the normal Samsung alarm app, on HA it shows the sensor.my_phone_next_alarm 5 mins ahead of the actual alarm. So e.g. it would show 07:35:00 but in reality the alarm is for 07:40:00.

Is that something normal or? Is there anyway round I can get the actual alarm that I have set in the stock Samsung alarm app?

Thanks.

Please see my previous answer in this thread

1 Like

So I created an allow list, and now, when I disable all my alarms, my next_alarm sensor remains stuck on the most recent datetime that was set, rather than changing to unavailable. Any suggestions?

It actually sounds like this is how the allow list works, from the next_alarm sensor description in the HA app:

“This will ignore alarm events for packages not selected and the state will not update until the next scheduled alarm matches one of the selected packages.

I hope I’m interpreting this incorrectly, and that this doesn’t mean the sensor can’t update to unavailable because there is no next scheduled alarm matching one of the packages.

Btw, I’m only allowing the two packages below because other packages (e.g. Tasker) were causing erroneous times:

com.google.android.deskclock
com.amdroidalarmclock.amdroid

As soon as it updates to the next alarm it will work as you’d expect. You just need to have some patience or set an alarm for 1 minute from now so it updates to that then delete the alarm.

Thanks for the quick reply. But wouldn’t the process of updating to the next alarm also trigger my wake-up routine (which is not desired because I have turned my alarm off) because the sensor still has a stale datetime rather than unavailable? It seems like I might be missing something…

I tried to test that myself just now, but now I’m finding that the sensor is no longer getting stuck, and it’s correctly changing to unavailable when I disable the only scheduled alarm. I didn’t change anything, so I’m not sure why the behavior is different now. But as long as it stays this way, then I guess my problem is solved :slight_smile:

This is because next alarm is one of the lucky sensors that can update immediately upon a state change. So you basically did exactly what I said that needed to be done.

I have the same problem with Google Calendar it do not change state to unavailable. What have do done to make it work?

It seems that г have understood. You just need to delete all the alarm in all alarm apps on your phone. Then it works!

I am having the same problem, that my alarm is stuck on the last alarm, eventhough its turned off. @ten000days how did u achieve to get it working right?
Is there a way to create a blacklist?

there is no blacklist, only an allow list. your best bet is to turn off the allow list…find the offending app and remove alarms/calendar entries from it. you have to find the app that abuses the API and stop it from abusing it.