Help me debug this automation?

I cannot for the life of me get this to work correctly.

What I am trying to do:

If ‘sensor.solis_battery_soc’ is greater than or equal to ‘input_number.eco7_target_soc’ then set ‘input_number.eco7_target_soc’ to match ‘sensor.solis_battery_plus_3’. if ‘input_number.eco7_target_soc’ less than ‘sensor.solis_battery_soc’ do nothing.

My automation:

trigger:
  - platform: time
    at: "00:00:00"
condition:
  - condition: template
    value_template: >-
      {{ states.sensor.solis_battery_soc.state | int >=
      states.input_number.eco7_target_soc.state | int }}
action:
  - service: input_number.set_value
    entity_id: input_number.eco7_target_soc
    data:
      value: "{{ states.sensor.solis_battery_plus_3.state | int }}"

The problem: The automation updates the state of ‘input_number.eco7_target_soc’ to match ‘sensor.solis_battery_plus_3’ even when ‘input_number.eco7_target_soc’ is less than ‘sensor.solis_battery_soc’ as well as higher.

Certainly looks like it should work provided those sensors and helpers exist. A couple of tweaks: try this:

trigger:
  - platform: time
    at: "00:00:00"
condition:
  - condition: template
    value_template: >-
      {{ states("sensor.solis_battery_soc") | int(0) >=
         states("input_number.eco7_target_soc") | int(0) }}
action:
  - service: input_number.set_value
    entity_id: input_number.eco7_target_soc
    data:
      value: "{{ states('sensor.solis_battery_plus_3') | int(0) }}"

Obviously, it only works at midnight — and if you’re running it manually, the conditions are ignored.