Hello,
My father have Samsung galaxy note 20 ultra phone. It connected to the home assistant and I can see all the sensors and the states in the Home assistant.
We did an automation that the AC in the living room will be powered on 30 minutes before the alarm if the temperature outside is less than 12 celsius. It worked great but a days ago something doesn’t work.
In the last few days, the automation triggered automatically although my father doesn’t have any alarms in his phone. I checked the state of the next alarm sensor and I can see that it always have a state although my father deleted all the alarms and it cause that the automation will be triggered.
I am attaching a picture of the state. How can I fix this?
next_alarm can be generated by packages other than the clock app. In your case it is coming from the calendar app. If you go into the Home Assistant Companion App configuration > Settings > Manage Sensors > Next Alarm > Allow List, you can restrict the allowed packages by unchecking everything but the clock app (it’s usually called something like com.google.android.deskclock)
This is not anything new. Samsung is known for making improper use of the API. In order for the sensor to work properly you will want to make sure other apps are not setting an alarm. Otherwise you will not see updates as expected. You will want to remove entries from samsung calendar as those will prevent updates from showing up too. If you search the forums and look at closed github issues you’ll see more info on this subject.
I know this is an old post, but I wanted to thank you for pointing out that there is a way to only allow next_alarm values from a specific app. I have an automation that rolls up the blinds and turns on all the lights in my bedroom just before the alarm goes off. The automation would randomly go off several times during the day and even a few times in the middle of the night. It was so annoying! I really thought I had to disable it before I found this article.
I still have this problem. Because my routine on my phone “sleep-mode” creates a non-exsisting-in-android alarm when it starts e.g. Selecting only ‘clock’ app does not apply. It is like @dshokouhi point out, that it seems that samsung sets extra alarms that are not visible in the clock app.
I had to do this for a similar situation as yours. The sleep as android app is free and comes with way more features than the stock alarm.
I heard about it from dshokouhi’s suggestion in a similar thread and have been a happy user for a few years now.