Adjustable Wake-up to Android alarm

@kwint That’s what I use it for. If your light supports transition. You can add a service call ligth.turn_on with transition time to the actions.
Add Action → Call Service → Light: turn on → Select your Target → Select Transition (set a time) → select Brightness (target brightness)

or yaml

service: light.turn_on
data:
  transition: 30
  brightness_step_pct: 100
target:
  entity_id: light.somelight

if your light doesn’t support transition, i made this blueprint script here: Increase or decrease light brightness over time - Blueprints Exchange - Home Assistant Community (home-assistant.io)

I have a problem with this blueprint.

When I make a new automation the alarm which is already sets works. But when I change the alarm the steps in the automation change.
If I look at the trace timeline it says: “Triggered by the state of sensor.tel_ruben_next_alarm at December 22, 2023 at 15:42:42” and suddenly only chooses option 1 therefore not executing the sequence.

sorry, not sure if I understand your question/problem. Sorry. But the blueprint/automation has two triggers. One, when the alarm is being set/changed (changes the helper) and the time condition (actual alarm, with the configures actions)

When I change my alarm this happens.

The wrong option is chosen, it should be option 3.

EDIT: nvm, all of a sudden it’s working again

1 Like

Thank you for this blueprint, it is exactly what I was looking for.

But I still have a question of understanding:
If I create several automations with the blueprint, do I need a separate helper for each automation or can the automations share one helper?

Thank you for this blueprint!

It was working for a while, but since a few days ago I have an issue: the first alarm fails to trigger anything, and only the subsequent snoozes work.
But even weirder: it works fine when I use an alarm in the middle of the day; only the morning one fails :face_with_raised_eyebrow:

I can’t see anything in the traces (https://file.io/q5WxK6JVYxHO) nor the logs :

2024-01-18 07:44:40.836 WARNING (Thread-5) [pychromecast.socket_client] [Salon CCwGTV 4k(192.168.1.25):8009] Heartbeat timeout, resetting connection
2024-01-18 08:06:26.461 WARNING (Thread-5) [pychromecast.socket_client] [Salon CCwGTV 4k(192.168.1.25):8009] Heartbeat timeout, resetting connection
2024-01-18 08:25:10.571 WARNING (Thread-5) [pychromecast.socket_client] [Salon CCwGTV 4k(192.168.1.25):8009] Heartbeat timeout, resetting connection
2024-01-18 08:26:31.666 WARNING (Thread-5) [pychromecast.socket_client] [Salon CCwGTV 4k(192.168.1.25):8009] Heartbeat timeout, resetting connection
2024-01-18 08:55:00.348 WARNING (MainThread) [homeassistant.components.automation.android_reveil_wake_up_alarm] Android : réveil wake up alarm: Already running
2024-01-18 08:55:06.611 WARNING (MainThread) [homeassistant.components.automation.android_reveil_wake_up_alarm] Android : réveil wake up alarm: Already running
2024-01-18 09:04:51.136 WARNING (MainThread) [homeassistant.components.automation.android_reveil_wake_up_alarm] Android : réveil wake up alarm: Already running
2024-01-18 09:04:55.291 WARNING (MainThread) [homeassistant.components.automation.android_reveil_wake_up_alarm] Android : réveil wake up alarm: Already running
2024-01-18 09:15:00.395 WARNING (MainThread) [homeassistant.components.automation.android_reveil_wake_up_alarm] Android : réveil wake up alarm: Already running
2024-01-18 09:15:05.504 WARNING (MainThread) [homeassistant.components.automation.android_reveil_wake_up_alarm] Android : réveil wake up alarm: Already running
2024-01-18 09:15:11.484 WARNING (MainThread) [homeassistant.components.automation.android_reveil_wake_up_alarm] Android : réveil wake up alarm: Already running
2024-01-18 09:15:24.940 WARNING (MainThread) [homeassistant.components.system_log.external] Dots 2 - Single press action
2024-01-18 09:24:28.164 ERROR (MainThread) [homeassistant.components.hassio.handler] /ingress/validate_session return code 401
2024-01-18 09:24:28.164 ERROR (MainThread) [homeassistant.components.hassio] Failed to to call /ingress/validate_session - 
2024-01-18 10:53:30.243 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 350, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadHttpMessage: 400, message:
  Data after `Connection: close`:

    b'HELP'
       ^
2024-01-18 10:59:54.820 WARNING (Thread-5) [pychromecast.socket_client] [Salon CCwGTV 4k(192.168.1.25):8009] Heartbeat timeout, resetting connection
2024-01-18 11:16:46.190 WARNING (Thread-5) [pychromecast.socket_client] [Salon CCwGTV 4k(192.168.1.25):8009] Heartbeat timeout, resetting connection
2024-01-18 11:41:35.310 WARNING (Thread-5) [pychromecast.socket_client] [Salon CCwGTV 4k(192.168.1.25):8009] Heartbeat timeout, resetting connection
2024-01-18 11:49:57.056 WARNING (Thread-5) [pychromecast.socket_client] [Salon CCwGTV 4k(192.168.1.25):8009] Heartbeat timeout, resetting connection
2024-01-18 12:51:19.289 WARNING (Thread-5) [pychromecast.socket_client] [Salon CCwGTV 4k(192.168.1.25):8009] Heartbeat timeout, resetting connection
2024-01-18 13:20:33.725 WARNING (Thread-5) [pychromecast.socket_client] [Salon CCwGTV 4k(192.168.1.25):8009] Heartbeat timeout, resetting connection
2024-01-18 13:37:02.080 WARNING (Thread-5) [pychromecast.socket_client] [Salon CCwGTV 4k(192.168.1.25):8009] Heartbeat timeout, resetting connection
2024-01-18 14:24:13.331 WARNING (Thread-5) [pychromecast.socket_client] [Salon CCwGTV 4k(192.168.1.25):8009] Heartbeat timeout, resetting connection
2024-01-18 15:01:29.214 WARNING (Thread-5) [pychromecast.socket_client] [Salon CCwGTV 4k(192.168.1.25):8009] Heartbeat timeout, resetting connection
2024-01-18 15:48:00.810 WARNING (MainThread) [homeassistant.components.automation.android_reveil_wake_up_alarm] Android : réveil wake up alarm: Already running
2024-01-18 15:48:04.396 WARNING (MainThread) [homeassistant.components.automation.android_reveil_wake_up_alarm] Android : réveil wake up alarm: Already running
2024-01-18 15:55:24.855 WARNING (Thread-5) [pychromecast.socket_client] [Salon CCwGTV 4k(192.168.1.25):8009] Heartbeat timeout, resetting connection
2024-01-18 16:01:08.733 WARNING (MainThread) [homeassistant.components.system_log.external] Dots 2 - Single press action
2024-01-18 16:11:44.649 WARNING (Thread-5) [pychromecast.socket_client] [Salon CCwGTV 4k(192.168.1.25):8009] Heartbeat timeout, resetting connection

There should be something happening at 8:42(alarm at 8:45 with 180s offset) but there is nothing.
It is simply not triggering :face_with_raised_eyebrow:

NOTE: the logs contain a test around 15:48 to confirm it indeed works sometimes/in the middle of the day.

Also I originally thought there could be an issue with the fact that I use a “long running” script as action (Sunrise Simulator Manual) but that does not seem to be an issue (and it worked for a while anyway).

Separate helpers. Per automation a helper. The automation sets the helper to the alarm set on the phone minus offset.

Your logs are full of warning that the automation cannot run because it is already running.

The automation has two modes. 1. Setting the Helper to the alarm - offset 2. triggering the actions when the time equals to the helper.

Try to create a new alarm on your phone and check if the entity (next_alarm) and the helper is set in the dev tools :

Open your Home Assistant instance and show your state developer tools.

Snoozing does set a new next_alarm value => Mode 1, and that’s also why you’d see “already running”

Hello @op00

I have in fact the same problem. In my oppion there is a design failure at the blueprint.

My alarm is set automatically to the next event on the next day at the same time.

Actions are starting with an offset of -60 and if I turn off the alarm the automation is already running. Trigger for a new alarm is starting but cannot run while the automation is already running.

I’v set the automation in mode parallel. In this way it is working but it isn’t the best solution.

Would be awesome to have also an offset (+) for the new next_alarm trigger. Or something else.

regards

Sorry, I don’t really understand the problem.
If you could maybe list a timeline (Setting the alarm, Snoozing, state of the helper, state of the automation). It may be that your alarm app is different and therefore behaves different than mine.

Do I understand correctly if I want this for several phones I just have to create several automations?

Yes, and separate helper. Although I have not tested that yet. Let me know if it worked or not.

I usually have 3 alarm clocks set. 5 seconds before the alarm clock triggers actions - turning on the light or raising the blinds (depending on the sun level) and starting the alarm clock on the nest speaker with a one minute delay.

This one-minute delay means that when the phone alarm clock starts after 5 seconds and the automation wants to set the time of the next alarm clock it does not happen because the automation is already running.

I know that getting rid of the delay will solve the problem but I’m looking for a way to trigger some of the action also after the alarm clock, not just before. To be honest, raising the blinds/ turning on the light would also suit me better after the alarm clock than 5 seconds before.

3 Likes

Is there an easy way to just run this automation when it’s an workday. So it should not run if there is a holiday, weekend (and maybe vacation days

  • this needs manual entries I guess?)

Hello All.

After update to Google alarm App (7.10 (685617841)) yesterday my automations based on this blueprint no longer triggers the intender funktions, i had this problem on android 13 but on android 14 it have been rock solid the last year.
it seems when i look at automation traces that it “chooses” option 1 or 2 But “my” actions is run on option 3 but there is no “choose” options 1 or 2 in the blueprint.
so i think that it maybe some “internal” functions of the blueprint

any help is apricated

Hi @Stephan0815, sorry for the late reply.
under conditions, add Entity and then state, you can try with a schedule helper
Open your Home Assistant instance and show your helper entities. or calendar entity. And it’s state.

hi @martinelv, I just checked my Google alarm version, i am on the exact same version as you are and I even created a new alarm which worked just fine. Things you can check

  • Is your entity helper input_datetime.xxxxx updated? If not check if the sensor in the HA app is enabled
  • Check if your actions run on it’s on, test them in another automation

I noticed one thing, which I need to monitor. That when the alarm has run, it hasn’t update to the next day. But I am not sure when this actually happens. That’s a thing the alarm app does and the home assistant app then updates. Let me montitor this the next few days.

Hi @op00
Thanks for the fast reply.

I rebooted my phone after and also checked the companion app and enabled and disabled some other app in the allowed list.

i made a copy of the my automation with the blueprint and changed the actions to something “testable” and also changed it to the “newish” feature “Take control”

and made a lot of tests last night and discoveret that the automations “both” original and copy also triggers when is change an alarm on the phone i did not know that.

Most of the times Both automations triggered but some times the original with the blueprint didn’t update the last time “run time” when but looking in the traces the both triggede.
but it worked this morning so i will monitor it the followings days and keep you updated
Thanks.

1 Like

Hi @op00

I have now “monitored” the automation for sometime and in the last about 17 days it have failed me 4 times since google released the update to the “alarm app”
every time it fails the automation trace is saying that the automation takes “option1” but it seems that “option1” is something in the blueprint and not my “actions”
it failed these times
1= 31 okt
2= 4 Nov
3= 6 Nov
4= 10 Nov
but it seems random so i have not been able to find the root course other than
the google app update. and before i updated to android 14 i was the same “instability”
but after upgrading to android 14 and before the new google time update it was rock solid.

hope this info is useful

Thanks
/Martin