Time Compare Issue

Hello

i want to switch a light scheduled.On HA i have Start and Stop input_datetime element
i send start stop time per textsensor on esphome. every 10 sec i want to compare current time and scheduled time but it didnt work

interval:

  - interval: 10sec

    then:

      lambda: |-

        auto currenttime = id(homeassistant_time).now();

        ESPTime starttime = currenttime;

        starttime.hour = id(global_starttime_hour);

        starttime.minute = id(global_starttime_minute);

        ESP_LOGD("main","ctime_hour: %d", currenttime.hour);

        ESP_LOGD("main","ctime_minute: %d", currenttime.minute);

        ESP_LOGD("main","stime_hour: %d", starttime.hour);

        ESP_LOGD("main","stime_minute: %d", starttime.minute);

        if (currenttime>=starttime){

          id(light_growlight).turn_on();

          ESP_LOGD("TAG","c >= s");

        }

        else {

          id(light_growlight).turn_off();

          ESP_LOGD("TAG","c < s");

        }

result is:
[12:07:40][D][main:129]: ctime_hour: 12
[12:07:40][D][main:130]: ctime_minute: 7
[12:07:40][D][main:131]: stime_hour: 14
[12:07:40][D][main:132]: stime_minute: 0
[12:07:40][D][TAG:135]: c > s

still no answer ?

After changing the values in the ESPTime struct you need to call X.recalc_timestamp_utc().