android: Wrong next alarm
Home Assistant Android version: 2.1.1-9-g8fef348-258-full
Android version: 10
Phone model: SM-G975F
Home Assistant version: 0.114.0
Last working Home Assistant release (if known):
Description of problem: The next alarm sensor seems to report all kinds of events. In my case instead of the next alarm tomorrow morning, I get the time of the next Tasker profile which triggers a task, which renders this sensor useless.
Traceback (if applicable):
Screenshot of problem:

Additional information:
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (7 by maintainers)
Hello, I encounter this and also hopped for a way to filter (which look like it’ won’t be 😦 ) basically tasker use what it call ‘Reliable alarm’ (google it up, having the right word help) in order to save battery while keeping stuff in sync. If you don’t have task that are based on precise time but only on event, you can disable this in tasker.
Sadly this wasn’t enough for me with a Samsung phone because other app, (calendar but not only) created some alam … I will be looking for something else, maybe not use my phone as an alarm … i don’t know.
Hope this help
This will probably be an allow-list so users can just specify what apps they want the events from. There’s just too many apps out there, now and in the future, that can make use of this API. So its better to let the user dictate what to allow as opposed to what should be blocked. It is an alarm sensor so I would imagine if you downloaded a new alarm app you would want to add it to the list, as opposed to downloading something like Tasker and discovering it uses the API when you didn’t expect it to.
This was actually already completed in the last release, we only send an update if we have something new to send.
There is no way to send back old data into HA, core will need to be updated to achieve that but I don’t think it will happen. The app itself is aware of when it doesnt send data over and we use that for our state change detection to make sure we send the next update once your server is back online.
I did as poofyteddy suggested and it appears to be working… I’ll have to wait and see what effect it has on my tasker automations…
Tasker makes use of AlarmManager for scheduled and timed tasks/profiles. Unfortunately any app or manufacturer can make use of this API so we can’t do anything when an app decides to abuse it. Your best bet is to adjust your tasker tasks to not make use of scheduled time based events.
They do not offer the tag/name of the alarm in the next alarm API, only the package that set it. Use the
packageattribute as a condition in your automation to filter out the packages you don’t care for.I think a general warning about this sensor might be the best solution for now 👍 Maybe the sensor also should be turned off by default, so users can see the warning in the settings.
So this is the API we are using. Tasker is honestly its own animal and they probably can filter their own events easily that way. We don’t really have control over what schedules the next alarm. You can see here the API only returns the next event and not a list of events.
https://developer.android.com/reference/android/app/AlarmManager#getNextAlarmClock()
We can leave this open for now in case someone has a good solution for it.
So this sensor actually reports whatever is the next system scheduled alarm that pretty much any app can use. To combat this we have provided the
packageso you can skip over these unwanted updates. Tasker is known to make a lot of use of this android feature which is the same feature that all alarm apps use. Skipping tasker won’t solve this issue as then we don’t get any value for the next alarm, your better off usingpackageas a condition in your automation.