Q: sensor.in_range dynamic below-value via lambda?

Hello together,
I’m wondering if its possible to set a dynamic below: value at sensor.in_range?

working code snipped:

interval:                                                                               
  - interval: 2s                                                                        
    then:                                                                               
      if:                                                                               
        condition:                                                                      
          sensor.in_range:                                                              
            id: ntc_1                                                                   
            below: 23                                                                   
        then:                                                                           
          fan.turn_off: fan_1      

I would like to have the below limit dynamical. It should be the value of a 2nd sensor plus an offset.
Here is my try:

interval:                                                                               
  - interval: 2s                                                                        
    then:                                                                               
      if:                                                                               
        condition:                                                                      
          sensor.in_range:                                                              
            id: ntc_1                                                                   
            below: !lambda "return id(ntc_2).state + 1.0;"
        then:                                                                           
          fan.turn_off: fan_1      

But during compilation, i get the error: “expected float.”

Failed config

interval: [source ESP32_3_NTC.yaml:238]
  - [source ESP32_3_NTC.yaml:238]
    interval: 2s
    then:  [source ESP32_3_NTC.yaml:240]
      if:  [source ESP32_3_NTC.yaml:241]
        condition:  [source ESP32_3_NTC.yaml:242]
          sensor.in_range:  [source ESP32_3_NTC.yaml:243]
            id: ntc_1
            
            expected float.
            below: !lambda |-
              return id(ntc_2).state + 1.0; [source ESP32_3_NTC.yaml:245]

Any hint would be helpful, thank you in advance.

best regards, thomas

After a hint, i removed the sensor.in_range and add a lambda to solve the issue.

lambda: !lambda |-
if (id(ntc_3).state < id(ntc_2).state + 1.0) { 
 return true; 
} 
else { 
 return false; 
 }