On Xiaomi devices and also when you install some applications that you can get wrong next alarm time. Some applications use Alarm API to start application at for example midnight to sync data. On Xiaomi devices notorious example is Xiaomi Calendar (com.xiaomi.calendar). Because of that next alarm is set to midnight of local time (example for UTC+2)
I’m not sure what the error is. Can you tell us what time you set the alarm at and what timezone?
And your image is misleading.
You have the cursor on the brown-ish area where the alarm was set to midnight local time (22:00 UTC) and the state and milliseconds show the time in the blue area to the right in the timeline.
OK, I will try to describe it other way. My timezone is UTC+2. In Clock application I have added alarm at 7AM of my time. This means that on all widgets in phone and in HA next alarm should be 7AM next day. But it is not true, next alarm has value at midnight (22:00:00 UTC on screen shot), after midnight alarm will be properly set to 7AM UTC+2 (5:00:00 UTC on screen shot). Alarm at midnight never ring, it just changes to next alarm in queue.
It is known issue in Android. Everything is caused by application that uses Alarms API to do some scheduled task. This alarm will never trigger sound or vibration, but will start application and execute some extra task. In my example it is Xiaomi Calendar app that probably is triggering sync task at midnight (maybe it is setting up everything for next day?). It would be great if Companion app would not report such applications as Next Alarm in HA
I would say this is an error on Xiaomi not on android or HA app.
The API does not specify why there is an alarm as far as I know so HA app can’t filter it out.
This is something that you need to take with Xiaomi
Yes, but it is not only Xiaomi Calendar, there are more applications that can produce false “next alarm” states. It starts to be problematic when your automations depends on next alarm status
More like ask the app developer not to abuse an API designed for alarm clocks. Theres not much we can do if a manufacturer like to override Google’s default. If you use an app that respects the API you don’t have this issue. Samsung is another offender, if you switch to Google Calendar for example you don’t get this issue.