Problems triggering action based on illuminance

I’m a newbie to HA. I created an automation that turns on a hall light based on a Tuya TS0601 motion sensor. The motion sensor also provides illumination data. I have successfully used the automation to trigger the light at different brightness levels depending on the time of night in addition to motion detection. However, I am trying to add a condition that will combine motion detection during the day when it’s cloudy outside, making the hallway darker during the day than usual. Since the motion sensor has an illuminance sensor, I am creating a condition that checks for that state…less than 50 lx. However, I cannot seem to get the settings correct to get a positive result on the illuminance state. As a simple test, I have played around with different state values to see if I could get any positive results: “< 50”, “<50”, “< 50 lx”, “<50 lx”, “<50lx”, “1”, “1 lx”.

Is there something I need to do differently?

Please don’t use screenshots of yaml code.

For numeric comparison, use the numeric_state, e.g

condition: numeric_state
entity_id: sensor.illuminance
below: 10

Generally speaking, the state of a sensor will never include the unit of measurement, it’s purely for display purposes.

Also, remove your attribute: line. You’re looking at the state of the sensor, not one of its attributes. I assume you’re creating this in the UI — just leave the attribute field blank.

1 Like

Thanks to both of you. Sorry about the screenshot.
Yes, I am using the UI and just learning…lots of dumb mistakes made but learning.
Thanks again!