Johboh / hassalarm

Android app for integration with Hass.io as a sensor for the next scheduled alarm on the device
MIT License
62 stars 6 forks source link

Hassalarm does not determine the correct date / time for the upcoming alarm #7

Closed arjenfvellinga closed 4 years ago

arjenfvellinga commented 4 years ago

Hassalarm does not determine the correct date / time for the upcoming alarm. In case of the settings below it says the next alarm is today (Saturday) at 15:33. I have no (in)-active alarm today or any alarm on that time

Alarms set:

Hassalarm version 1.1 Samsung A70 Android 9

Johboh commented 4 years ago

@arjenfvellinga Hi! Is that what it says as well below the "test connection" button? What if you try setting an alarm in five minutes and then open the app, does it still say the wrong time?

arjenfvellinga commented 4 years ago

Indeed what is shown below the button

When I set a new alarm within 5 minutes and reopen your app, that one is shown correct.

When I then disable that new alarm the next one will be upcoming Monday 7:00. Hassalarm shows the right date but 5 minute too earlier :-)

Johboh commented 4 years ago

@arjenfvellinga What alarm clock app are use using?

arjenfvellinga commented 4 years ago

It's called Clock and from the Galaxy store. The app store of Samsung. It was pre-installed on my phone. Your question lead me to an update of the app, but that didn't solve the problem.

http://apps.samsung.com/appquery/appDetail.as?appId=com.sec.android.app.clockpackage&cId=000004512270

Johboh commented 4 years ago

@arjenfvellinga And what if you disable and then enable your Monday alarm once :)?

arjenfvellinga commented 4 years ago

If I disable the Monday - Thursday 07:00 alarm, the next one would be Friday 08:00, but then Hassalarm thinks the next alarm is 2019-12-02 10:00. And after enabling Monday - Thursday 07:00 it's back to 2019-12-02 06:55

Pretty weird I'd say

I already have the update of your app

Johboh commented 4 years ago

@arjenfvellinga and what if you compare both the time in the request body as well as the returned state payload that you can see when you press the "save and test connection" button in the app? Is that the correct?

arjenfvellinga commented 4 years ago

image

The result in Home Assistant is indeed a sensor with '2019-12-02 06:55' as the next alarm.

Your previous version of the app was, if I remember correctly, from January. It did work some time after that. I can't pinpoint it when it stopped working. I restarted my Hass setup, also changed mobile phone (Samsung Galaxy S6 (also with Clock) to Samsung A70) and also upgrade Android multiple times.

So I can't tell what messed it up, but regardless, your app should be able to get the correct next alarm I assume.

Johboh commented 4 years ago

Interesting. Well, you can work around it if you just adjust for the five minutes on the home assistant side. I have not changed anything with regard to the time in the app, I just use the Android API to get the next scheduled alarm so the OS is reporting that time. I'm guessing the Samsung alarm clock app report a different time then what is set. Can you just try with another alarm clock too see if it's the same five minute offset? E.g. Alarm Clock Xtreme (which I'm using).

arjenfvellinga commented 4 years ago

Off set is not going to work. Indeed 5 minutes for Monday - Thursday 07:00, but the offset is different for the Friday alarm.

I just disabled all alarms in Clock, installed Alarm Clock Xtreme with

So you can't conclude from this if Clock or the API is doing something wrong...

arjenfvellinga commented 4 years ago

https://eu.community.samsung.com/t5/Galaxy-S9-S9/Pie-Clock-app-bug/td-p/927333

Johboh commented 4 years ago

Aha! Looks like the issue you are having.

Johboh commented 4 years ago

Let's hope they fix it soon. Time will tell...

arjenfvellinga commented 4 years ago

First report in February, so I doubt it will be fixed soon...

Thanks for you time - if it weren't for Samsung / Google to mess it up, I really like the app.

Johboh commented 4 years ago

In the thread you linked, the poster said that using Google Clock worked. You might try that if you haven't already.

arjenfvellinga commented 4 years ago

will try that tomorrow

arjenfvellinga commented 4 years ago

The Google Clock indeed does not have the 5 minute off set. That's an improvement. But with only the Friday 08:00 alarm active it still says the next one will be 2019-12-02 10:00.

But then I started thinking, is there another app that does something with alarms? And yes I have a todo app (TickTick) which indeed has a reminder for a task set at 19-12-02 10:00! :-) I don't think a todo-app should set their reminders as system wide alarms, but I think we found the source of my problem!

Johboh commented 4 years ago

Great! I add my reminders in Google calendar using the reminder function, which does not fiddle with the next alarm setting 😊

arjenfvellinga commented 4 years ago

unnamed

Yes, with that setting disabled TickTick is not reporting tasks as alarms!

arjenfvellinga commented 4 years ago

It's working fine now again with the ^^ TickTick setting disabled and Google's clock app instead of the Samsung one.

benblb commented 4 years ago

I'm experiencing the calendar issue. I use a Galaxy S10 with Google Calendar. I cleared Samsung Calendar data and took away its permissions to see cal events, but my "next alarm" is a calendar event reminder.

Any tips?

Johboh commented 4 years ago

@benblb let's continue in https://github.com/Johboh/hassalarm/issues/19!