Switch light on if Lux is smaller X

Hey Guys,

I trying to switch lights on, if lux is smaller than defined value but only during specific time.
Therefore I have following rules:
To define specific time I create a switch:

rule "Hilfsschalter an"
when
	Time cron "0 30 16 ? * * ?"
then
	Hilfsschalter.sendCommand(ON)
end

To check the lux and switch the lights:

rule "Lichter an wenn Lux <200"
when
	Item Lichtsensor changed
then
	if (Hilfsschalter.state == ON && Lichtsensor.state < 200) {
		LichtWohnzimmer.sendCommand(ON)
                LichtKueche.sendCOmmand(ON)
	}
end

But the lights don’t switch on. Someone with an idea?

Thanks!

Does your Item state have units? You’ll need to compare with units as well.

Yes, the sensors output is a number in „Lx“ in this case

Okeydoke, you need to compare using units. Otherwise it’s like saying “is 2 buckets more than 5?” 5 what - lorryloads, spoonfuls?
DSL rules give a shorthand for that with pipe character
Lichtsensor.state < 200 | lx