Next Alarm issue

I’ve never used next alarm sensor before. Actually, I’m newby in home automation world. Nevertheless I was able setup my Home Assistant server on Raspberry Pi in Docker, add some integrations and wright several automations by myself. But this issue literally brought me to my knees.

I was trying create an automation which should turn light on when alarm on my Android phone goes off. Sounds simple, right? Just use next_alarm sensor. Not so much.

I live in the country which still switching to Daylight Saving Time. And we switched to it at March 26. The problem is Local Time attribute of Next Alarm sensor is still Standard Time. It’s one hour behind. You may say ‘So what? Just adjust the time in code.’ That what I was thinking. But here begins the weird stuff.

When You set an alarm within current hour (let say current local time is 18:20 and you set an alarm at any time up to 18:59) Local Time attribute is equal to local current time. If you’ll set it one or more hours further, it shows one hour less than actual alarm time. But real weirdness begins when an alarm is set in less than hour interval. My system time now is 18:45. I set my alarm at 19:30. That what is shown in attributes section of Next Alarm sensor in developers tools:

Local Time: Sun Apr 02 19:15:00 GMT+03:00 2023

Do You want more?
If I set an alarm at several hours from now, I see the Next Alarm attribute is one hour behind actual alarm time. But during this time somehow it changes to that weird time like 3: 23 or 13:22. It can’t be predicted and can’t be fixed in automation code.

I’ve opened an issue on home-assistant/android GitHub page.

Any help, please

1 Like

The problem was my Xiaomi phone. After disabling alarm that came with the phone, I installed Clock app by Google. All values are correct now.

1 Like