Why template is ignored

I have following condition in my automation:

if:
  - condition: and
    conditions:
      - condition: numeric_state
        entity_id: sensor.tz2000_a476raq2_ts0201_temperature
        below: input_number.house_temp
      - condition: template
        value_template: >-
          {{((states('sensor.temometers_bufor_2') | float) - 5.0) >
          (states('sensor.tz2000_a476raq2_ts0201_temperature') | float)}}
then:
  - type: turn_on
    device_id: 4abc896c736d2ba28731614745d52af7
    entity_id: a2c502e3c18d8873759b9b4e7d83aecd
    domain: switch
else:
  - type: turn_off
    device_id: 4abc896c736d2ba28731614745d52af7
    entity_id: a2c502e3c18d8873759b9b4e7d83aecd
    domain: switch

It looks like template condition is ignored. Expression return false, as I’ve checked in Dev Tools, but switch is turned on. This conditions disables heater pump when heat buffer is almost exhausted

I am normally not doing much templating, but I think you need to write

below: {{ input_number.house_temp }}

This should get Jinja to parse the input variable.

No the syntax for that condition is correct, see: Conditions - Home Assistant

But it is the template condition they are having issues with.

Try this:

      - condition: template
        value_template: >
          {{ has_value('sensor.temometers_bufor_2') and
          has_value('sensor.tz2000_a476raq2_ts0201_temperature') }}
      - condition: template
        value_template: >
          {{ states('sensor.temometers_bufor_2') | float(0) - 5.0 >
          states('sensor.tz2000_a476raq2_ts0201_temperature') | float(0) }}

The syntax was correct, output device was in a fault state and refused to process commands. I found it in the logs. It does not like to process multiple commands at once I’ve added 1sec delay and it works perfectly for 2-3 days already

Not really. Your template may fail to load if your float filters are unable to convert the state values to numbers. Which is why you should supply default values. Also there were a lot of unnecessary parentheses.