This has probably been done many times, but here is another one.
I wanted to play music and turn on lights right before my alarm went off, and I wanted to use an alarm clock on my device (Android).
So I created an app (https://github.com/Johboh/hassalarm) that will listen for the broadcast intent ACTION_NEXT_ALARM_CLOCK_CHANGED, which is sent once the next scheduled alarm is changed. This is sent by the system when any (decent) alarm clock schedule its next alarm. Once the app receives the intent, it will eventually call the API and post an updated value for a sensor called next_alarm. This can later be used in automations, for example:
Thank you, I like the idea (though I believe it should also be doable with tasker?).
I installed your app (using an access token) on my Note 9. But it doesn’t seem to work? I can not see the sensor. But after clicking “save” it shows the correct Next Alarm in the App.
A “test connection” button with an error message would be a good idea.
Yeah, the app is quite naive when it comes to error handling and assumptions. I will add a “test connection” functionality and expose errors a bit better.
“Unexpected char 0x0a at 14 in Authorization value: Bearer Daniel:
[real token]”
So I made an error making a copy of my auth token (over Telegram). Maybe don’t display it with “*” symbols when entering? (and don’t show it at all later…)
This project is just plain awesome! This is exactly what I was looking for! Thank you for such a great app!
Ever considered of sharing the knowledge?)) There is an open-source android client for HA in development (also on github) which could really benefit from such functionality.
For people running into problems, set the correct timezone in your Home Assistant configuration so the value_template in the condition evaluates correctly.
I know its a old thread, but now Ariela (Ariela - Home Assistant Android Client) supports sending next alarm info to Home Assistant. You can create automation based on that.
Hey, can you tell me where i can find the sensor?
I checked the docs but i dont see this sensor on my device, just bluetooth, battery, light and so on.
Thanks, it was an outdated version.
But is it possible to send an event if the alarm is triggered?
I’m not a big fan of automations that need to run every minute. I think its a bit needless and stressfull for the server. Maybe not with one automation but sometimes there are more of these kind of automations
Has anyone managed to get this working with Ariela / MQTT? I am struggling with the automation setting, I already got MQTT sensor working and its state attribute is in the format “yyyy-mm-dd hh:mm:ss”. How do I integrate this information into an automation to turn on a light at this specific time?