Helper value in config

Hi all,

I used the Treshold platform to make a binary sensor. The state of this sensor changes depending of the value of a lightsensor. The lower value for switching the lights must be variable by means of an input_number.

This is my code in the config:

  - platform: threshold 
    entity_id: sensor.lichtintensiteit
    lower: {{ states('input_number.lights_on') | float }}
    hysteresis: 50
    name: schemerwaarde  

I’m getting this error:

Error loading /config/configuration.yaml: invalid key: “OrderedDict([(“states(‘input_number.lights_on’) | float”, None)])”
in “/config/binary_sensor.yaml”, line 15, column 0

What is wrong?

According to the docs it only takes a number there, not a template.

Is there an alternative to achieve something similar?

rgds. André

A template sensor (binary or otherwise) would do it.

thanks,
I will give it a try.