Using Android Phone Alarm as automation trigger

I’m, trying to create an automation that turns on lights after a defined amount of time, based on my phone alarm.
But I cannot get it to fire.
I’ve followed multiple ‘tutorials’ that seem to be based of the same config, but from mhy testing, the state never seems to change to True.
I am basing this of my phone alarm - Android 13, Pixel 6 Pro
Am I missing something:

- alias: Wake up Lights - Bedroom Light Fade in
  initial_state: 'on'
  mode: restart
  trigger: 
    - platform: template
      value_template: >-
        {{now().strftime("%a %h %d %H:%M %Z %Y") ==
        (((state_attr('sensor.rich_pixel_6_pro_next_alarm', 'Time in Milliseconds') |
        int / 1000)) | timestamp_custom('%a %h %d %H:%M %Z %Y'))}}
  condition:
    - condition: state
      entity_id: person.rich_wallace
      state: 'home'
  action:
    - delay: 
        hours: 0
        minutes: 0
        seconds: 10
        milliseconds: 0
    - service: light.turn_on
      target:
        entity_id: light.bedroom_light
      data:
        brightness: 255

Your template is way more complicated than it needs to be… but, to trigger at the time of the alarm, you don’t need to use a template at all.

- alias: Wake up Lights - Bedroom Light Fade in
  initial_state: 'on'
  mode: restart
  trigger: 
    - platform: time
      at: sensor.rich_pixel_6_pro_next_alarm
  condition:
    - condition: state
      entity_id: person.rich_wallace
      state: 'home'
  action:
    - delay: 
        hours: 0
        minutes: 0
        seconds: 10
        milliseconds: 0
    - service: light.turn_on
      target:
        entity_id: light.bedroom_light
      data:
        brightness: 255
1 Like

yeah, I have tried this also, using the state of the sensor, but it also doesn’t fire.
Will do some more tests later

Pixel 6 (non pro) I’m having the same issue

I’ve tried following a couple of different guides but can’t get it to fire off. I’m beginning to wonder if it’s bugged or something.

It doesnt show up under Trigger, Device, Pixel 6, and so far none of the templates ive tried have worked.

It does show me the sensor.pixel_6_next_alarm under Developer Tools, States.

Local Time: Sun Oct 08 07:45:00 EDT 2023
Package: com.google.android.deskclock
Time in Milliseconds: 1696765500000
device_class: timestamp
icon: mdi:alarm
friendly_name: Pixel 6 Next alarm

If the entity exists and it is returning the correct value in the States tool, then the issue is most likely with your automation. Post what you have tried, the automation debug trace, and what your goal is…

I have the same issue with my pixel 6a and also doesn’t fire.
In my opinion the problem is when the alarm sounds, the sensor or template automatically goes to the next alarm so the condition is never fulfilled. Even if you leave only one alarm, because then it goes to the next day’s alarm.

Any updates on that?

This is my automation, doesn’t triger either…

alias: Wake up Lights - Bedroom Light Fade in
description: ""
trigger:
  - platform: time
    at: sensor.pixel_7_pro_next_alarm
condition: []
action:
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: switch.turn_on
    target:
      entity_id: switch.lumi_lumi_plug_maeu01_switch
    data: {}
initial_state: "on"
mode: restart

I am still having the same problem unfortunately

I have stripped back my automation to bare bones basic:

- alias: Wake up Lights - Bedroom Light Fade in
  initial_state: 'on'
  mode: restart
  trigger: 
    - platform: time
      at: sensor.pixel_6_pro_next_alarm
  action:
    - delay: 
        hours: 0
        minutes: 0
        seconds: 10
        milliseconds: 0
    - service: light.turn_on
      target:
        entity_id: light.lounge_lamp

Does not fire, and same as others have mentioned, HA appears to report the correct stae for the alarm sensor:

2024-03-15T13:45:00+00:00
device_class: timestamp
icon: mdi:alarm
friendly_name: Pixel 6 Pro Next alarm
Local Time: Fri Mar 15 13:45:00 GMT 2024
Package: com.google.android.deskclock
Time in Milliseconds: 1710510300000