Automation seemingly not working anymore

Im trying to make it so alarms set my lights to max brightness. as far as I can tell the trigger is broken, but I can’t tell what’s broken about it… this is it:

alias: Alarm Lights
description: ""
trigger:
  - platform: template
    value_template: >-
      {{ (((as_timestamp(now()) | int) + 0*60) | timestamp_custom('%Y-%m-%d
      %H:%M:00')) == (((state_attr('sensor.pixel_5_next_alarm', 'Time in
      Milliseconds') | int / 1000) + 0*60 ) | timestamp_custom('%Y-%m-%d
      %H:%M:00')) }}
condition:
  - condition: and
    conditions:
      - condition: time
        before: "16:00:00"
        weekday:
          - sun
          - mon
          - tue
          - wed
          - thu
          - fri
          - sat
        after: "00:00:00"
      - condition: device
        device_id: 0df4f9c7cbf8c8f71af95ad9d3d2012f
        domain: device_tracker
        entity_id: device_tracker.pixel_5
        type: is_home
action:
  - service: scene.turn_on
    target:
      entity_id: scene.bedroom_bright
    metadata: {}
mode: single

edit: it did work on the first day I tried it, but it doesn’t work anymore…