Numeric trigger for a range

I have the following trigger which works for an actual numeric state of a sensor to go above 100. Is there a way to make a trigger so that it will fire only if the state increases or decreases by 9? So I don’t care what the actual state is, but only if it moves up or down in this range. This sensor is a scale on my bed, and I want to know if the 9 lb cat or the 11 lb cat just got on or off the bed.

  trigger:
    platform: numeric_state
    entity_id: sensor.hx711_custom
    value_template: '{{states.sensor.hx711_custom.state}}'
    below: 100

Yes. Just set a trigger for entity state.
Then use a condition to check the difference between {{ trigger.from_state.state }}
and {{ trigger.to_state.state }}

Something like this?

  trigger:
    platform: state 
    entity_id: sensor.hx711_custom
  condition:
    - condition: template
      value_template: '{{ (trigger.from_state.state - trigger.to_state.state) | float <= 9}}'

Pretty much. Just use the float filter for each trigger value, not the whole block

I don’t understand, why?

Because otherwise you will calculate the difference between 2 strings and then convert to a float. Convert each value to float first then calculate the difference

But I’d still have to float that value, no? Meaning 3 floats

FROM | float - TO | float 

could be positive or negative. I want to test if the cat gets on (FROM - TO is negative) and off (FROM - TO is positive)

No. A float minus a float will give you a float

If you just want a value higher than [say] 9, regardless of whether it’s +9 or -9, then enclose the whole lot in an absolute filter
I believe is abs(float) > 9

Ah, wasn’t thinking straight…