Automation help with alarm system

Hi Forum, i need help with my Alarm system automation.

I need if my entity id: sensor.time is equal to: sensor.alarm_clock_time_long
the sensor.time is my clock, the: sensor.alarm_clock_time_long is my alarm status clock.

So i want to change a entity id when the two time in the clock is equal.
The alarm is on, when in the morning my alarm with be disabled.
The state should only change if two minutes and hours and the same.

So if the sensor.time is: 10:30 and the sensor.alarm_clock_time_long is: 10:30 set the entity id: input_boolean.alarm_clock_status to: off

What trigger condition and actions should i try with this automation:

Example that is working almost:

Alarm clock

  • id: Alarm_klokke_troom_alarm_disable_om_morgenen
    alias: Alarm klokke - T-Room - Disable
    trigger:
    platform: template
    value_template: ‘{{ sensor.alarm_clock_time_long == sensor.time }}’
    action:
    service: automation.turn_off
    entity_id: input_boolean.alarm_clock_status

the trigger part is not working, the two times should be equal, and when the state should be set to off.

Can someone help me?

Try this: value_template: '{{ states.sensor.alarm_clock_time_long.state == states.sensor.time.state }}'