How to compare custom date_time sensors?

Hello all,
I created two sensors:

- platform: template
  sensors:
    input_date_time:
      unique_id: "input_date_time"
      friendly_name: alarm with 10 minutes offset
      value_template: >
        {% set alarm_time_date = ( as_timestamp(states('sensor.next_alarm_time')) | int - 600 ) | timestamp_custom("%Y-%m-%d, %H:%M") %}
          {{ alarm_time_date }}

    current_date_time:
      unique_id: "current_date_time"
      friendly_name: Current date time
      value_template: >
        {% set current_time_date = (as_timestamp(states('sensor.date_time_iso')) | int ) | timestamp_custom("%Y-%m-%d, %H:%M") %}
          {{ current_time_date }}

When I have a look at the sensors in the Dashboard all is fine and both sensors have the same format.

Next I want to set up a binary_sensor that turns on if both sensors hold the same information, else it should be off. I did it on this way:

sunrise_trigger:
  friendly_name: "Trigger sunrise when alarm is set"
  icon_template: >-
    mdi:weather-sunset-up
  value_template: >
    {{ sensor.input_date_time  == sensor.current_date_time }}

This sensor is always unavailable.
I tried around a lot but cannot solve the problem.
Any ideas?
Best
F

  icon_template: >
    {{ mdi:weather-sunset-up }}
  value_template: >
    {{ states('sensor.input_date_time') == states('sensor.current_date_time') }}

thank you :slight_smile:

Have you looked in the thread about next alarm times (assuming it’s from the phone/app)?
There are easier way to get it done.