New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong next alarm #748
Comments
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 |
Okay, to bad. I didn't think this would be a problem, because with Tasker itself I get the true next alarm, which I use to show that time on my dashboards. Should I close this issue or keep it open if someone has a solution for the problem? |
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 I've been looking into this. If we decide to filter out lets say for example just It also seems like other things tend to highjack this as Samsung does some trickery around Google Calendar based on research. I think that providing the |
I think a general warning about this sensor might be the best solution for now 👍 |
Same Issue here :-) (Also primarily Tasker, but there are also other Apps which uses System Alarm Clocks) @dshokouhi as far as i understand to filter out specific Packages like Tasker etc is more or less just an Caching issue? You could completely ignore all Events. Except from Packages, selected by the User. (Or send all, if none is selected) For HA Based Caching:
But actually i dont see the issue if you only update the current sensor on Recieved Events from one or more selected Packages. BTW: My current automation works for me. But i really want to minimize the Updates send to HA. Especially on 1minute Timers in Tasker + Bad Mobile Cell Coverage... its bad |
Well so here is the problem. We can only get the next scheduled event from whatever package that maybe. If you have 1 minute timers setup in Tasker then you may only get 1 notification if that from the actual alarm (it may even get missed in that case). We have to listen to those alarm event changes. We also need to handle when the alarms are off or bad data is received hence the I know its not ideal now but all sensors currently send updates even if there were no changes detected. I noticed this as well when I was trying to get the battery percentage to update faster but it resulted in updates even when the screen turns on/off so I avoided that approach in that PR. I like the idea of adding a description to each sensor so we can be mindful of situations like these and notify the user. I also like the ability to set certain sensors disabled from the start. Currently the only sensors that are disabled when we start are the sensors that require explicit permissions like phone and location. To handle the logic of when to send sensor data if the value has indeed changed is a bit out of my realm but lets keep the ideas coming. I hear you that in bad coverage areas this is problematic. |
Hello,
Sadly this wasn't enough for me with a Samsung phone because other app, (calendar but not only) created some alam ... Hope this help |
Just wanted to chime in to report this as being "not use-able" |
They do not offer the tag/name of the alarm in the next alarm API, only the package that set it. Use the |
That's where I'm having issues.. alarm gets set every few minutes by tasker for some random reason I don't quite understand. These all get detected by the sensor fine and report the package "net.dinglisch.android.taskerm" |
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. |
I did as poofyteddy suggested and it appears to be working.. |
We need an option to filter specific Packages on HA Companion Level.... its just to much Changes which drains Battery/Traffic. I would also like to have an Option to enable Queuing of Sensor Data if the HA Instance is not available. |
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. |
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:
The text was updated successfully, but these errors were encountered: