Helper "input_number" for lux limit

Hello all,

By now I have a pretty decent setup of Home Assistant.
With around 90 ZigBee Devices, 20 Shellys, and so on.

I want to make things a bit more configurable.
I am using motion detectors to toggle lights, but they should only turn on when it’s a certain lux level.
That works great or a static number in my automations. But now I want to create some kind of “Admin dashboard” where I can centrally control some toggles and numbers (such as lux level, …).

I’ve created an “input_number” for the “lux_limit”.
Tried to use that in an automation like below:

type: is_illuminance
condition: device
device_id: 6c273cfa15c5c876fb7ec8fe97ce716a
entity_id: sensor.lumi_lumi_sensor_motion_aq2_illuminance_4
domain: sensor
below: {{ input_number.lux_limit }}

But I receive the Error “Message malformed: expected float for dictionary value @ data[‘below’]”.
Seems like the Automation is expecting a float, not an int.

Can somebody give me some help?
Thanks in advance.

Is recommend that you make a Template Sensor. Specifically a Binary Sensor whose state is a template that compares the lux level to your input helper. This will make it easier to incorporate into numerous automations.

Have a look at Template sensors.

This is a Device Condition:

type: is_illuminance
condition: device
device_id: 6c273cfa15c5c876fb7ec8fe97ce716a
entity_id: sensor.lumi_lumi_sensor_motion_aq2_illuminance_4
domain: sensor
below: {{ input_number.lux_limit }}

Device Triggers, Device Conditions, and Device Actions do not support templates.

A Device Condition might support an input_number directly for below. Try this:

type: is_illuminance
condition: device
device_id: 6c273cfa15c5c876fb7ec8fe97ce716a
entity_id: sensor.lumi_lumi_sensor_motion_aq2_illuminance_4
domain: sensor
below: input_number.lux_limit

If it fails to work, use a Numeric State Condition:

condition: numeric_state
entity_id: sensor.lumi_lumi_sensor_motion_aq2_illuminance_4
below: input_number.lux_limit

Hey, awesome. Thank you.
The first suggesting didn’t work.
Still the same error, regarding float.

But I just tried the second one which works like a charm.
Now I can change my lux limit with a slider which is pretty handy (at least in the beginning).

You’re welcome!

Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.

For more information about the Solution tag, refer to guideline 21 in the FAQ.

Ok, sure thing I did this.
Thanks again for your quick help.

1 Like