Templating within a trend binary sensor

Ive just started to play with a trend binary sensor to turn on my bathroom fan with rising and off with levelling humidity levels. I think it’s all working but it’s slow going restarting Hass with every tweak to the min_gradient value. I’ve set up 2 input_numbers and was hoping to use these as the min_gradient value. Could someone point me in the right direction if it’s possible to do? Cheers

this is the code ive got so far.

binary_sensor:
  - platform: trend
    sensors:
      humd_falling:
        friendly_name: "Bathroom Humidity Level"
        entity_id: sensor.bathroom_humidity
        sample_duration: 120
        min_gradient: -0.002
   #     min_gradient: "{{states.input_number.humd_level_grad.state | int }}"
   #     device_class: moisture


      humd_rising:
        friendly_name: "Bathroom Humidity Rising"
        entity_id: sensor.bathroom_humidity
        sample_duration: 120
        min_gradient: 0.02
       # min_gradient: {{states.input_number.humd_rising_grad.state | int }}
        device_class: moisture