Use input_numer to set below: value in automation

I wish to use the output of a soil sensor to determine whether the sprinklers should go on.
I use a input number slider to set this value and then want to use it as the below value in the condition.
So if the slider is set to 40 and the moisture sensor detect a moisture content below 40 the sprinklers will switch on.

This is the code for testing the humidity output of the sensor.

type: is_humidity
condition: device
device_id: 072013b11b4d8c592eb569ae502d1ba1
entity_id: 3d2685e24490faa840b408d5f8c04ef2
domain: sensor
below: "{{ states('input_number.lowermoisturelevel')|float }}"

An I get this error

Message malformed: expected float for dictionary value @ data[‘below’]

Also tried the following based on some post, but still get error

below: input_number.lowermoisturelevel

Message malformed: expected float for dictionary value @ data[‘below’]

Use a Numeric State trigger, not a device trigger. In the UI, this is under Entity.

In YAML:

trigger:
  - platform: numeric_state
    entity_id: sensor.YOUR_SENSOR
    below: input_number.lowermoisturelevel

Thx, Very new at this.

Appreciate people like you with the patience to help.

1 Like