Adjustable Wake-up to Android alarm

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



Hi @martinelv,
when you take control of the blueprints,
image

Then you would see that

option1 is (right star)
When:

  • When alarm changes state or any attributes (except unavailable or unknown)

Then:

  • Set the date time helper to the new time - offset

option2 is: (right star)
When:

  • When alarm changes state to unavailable or unknown

Then:

  • Set the date time helper to 1970-01-01 00:00:00

option3 is: (left star)
When:

  • When current time equals the date time helper

Conditions:

  • your conditions
    Then:
    • your actions

So, these are essentially to 2 modes of this blueprint / automation.

  1. Setting the datetime helper (offset corrected)
    1.1 Error handle [“unknown”,“unavailable”]
  2. Run your configured actions and conditions, when datetime equals helper datetime

In your case (3 Screenshots, the alarm sensor from the app changed and it set a new time). So these are no fails.

  • at 5.30 am 31. Okt it set the alarm to 9.00 am 2. Nov
  • at 5.30 am 31. Okt it set the alarm to 5.30 am 2. Nov (this is weird, i guess your alarm should be 9am)
  • at 5.30 am 4. Nov it set the alarm to 8.59 am 9. Nov

Do you maybe have any conditions configured?

Hi @op00

Then i have mostly figured out how the blueprint works,
the year 1970 now makes more sense… thanks for the detailed explanation.
you are correct in that i have some conditions for the “3” option.

here is the whole automation

 offset: 2
mode: single
triggers:
  - platform: time
    at: input_datetime.mae_mobil_vaeggeur
    id: wake_up
  - platform: state
    entity_id:
      - sensor.mae_zenfone_9_next_alarm
    id: helper_update
actions:
  - choose:
      - conditions:
          - condition: trigger
            id: helper_update
          - condition: template
            value_template: '{{ trigger.to_state.state not in ["unknown","unavailable"] }}'
        sequence:
          - data:
              timestamp: '{{ (as_timestamp(trigger.to_state.state) |int ) - (offset)}}'
            target:
              entity_id: input_datetime.mae_mobil_vaeggeur
            action: input_datetime.set_datetime
      - conditions:
          - condition: trigger
            id: helper_update
          - condition: template
            value_template: '{{ trigger.to_state.state in ["unknown","unavailable"] }}'
        sequence:
          - data:
              datetime: '1970-01-01 00:00:00'
            target:
              entity_id: input_datetime.mae_mobil_vaeggeur
            action: input_datetime.set_datetime
      - conditions:
          - condition: trigger
            id: wake_up
          - condition: and
            conditions:
              - condition: zone
                entity_id: person.martin
                zone: zone.home
        sequence:
          - choose:
              - conditions:
                  - condition: time
                    after: '03:55:00'
                    before: '07:29:00'
                    weekday:
                      - mon
                      - tue
                      - wed
                      - thu
                      - fri
                sequence:
                  - delay:
                      hours: 0
                      minutes: 0
                      seconds: 2
                      milliseconds: 0
                  - data: {}
                    action: script.godmorgen_pa_170
              - conditions:
                  - condition: time
                    after: '07:30:00'
                    before: '09:30:00'
                    weekday:
                      - sat
                      - sun
                sequence:
                  - delay:
                      hours: 0
                      minutes: 0
                      seconds: 2
                      milliseconds: 0
                  - data: {}
                    action: script.godmorgen_pa_170
          - action: script.tander_shelly_dimmer_i_10_min
            metadata: {}
            data: {}
    default: []
id: '1692554426072'
alias: Martins Mobil Android Vægge ur
description:

when i look in the logs of the Time Helper
it seems that google time is updating the helper to both my workday and weekend wake up time inside the same second even on work days when the next logical would be next workday and maybe that is making trouble.

i on purpose have the automation run with an offset of 2 sec and the delayed my actions to try to have “option 3” running before the the helper is updated but my “logic” behind this seem to not work either.

but my companion app it set to only allow google desktop clock app… “aka time”

but i have recently tested an app to disable android Doze and that app used the “alarm manager api” in android and when that app was running the “time helper” was updated every minute even when it was not selected in the companien app…
i do not know if this maybe an issue also

Thanks
/Martin