Motion Timer, Lights and Lux problems

Hi,

I’ve got a problem with a rule for my floor. I want the rule to be triggered if the lux is low and motion is detected. Otherwise the light should be stay off. I’ve read some rules examples but i don’t find the perfect solution for this.

My items

Number		Auge_Node2							"Auge Node2"					<present>											{channel="zwave:device:51cae397:node2:alarm_motion"} //, expire="5m,command=OFF"
Number		Auge_Node2_Temp 					"Temperatur Flur [%.0f °C]"		<temperature>			[ "CurrentTemperature" ]	{channel="zwave:device:51cae397:node2:sensor_temperature"}
Number		Auge_Node2_Licht 					"Licht Flur [%.0f Lux]"			<sun>												{channel="zwave:device:51cae397:node2:sensor_luminance"}
Number		Auge_Node2_Batterie 				"Batterie Flur [%s %%]"			<energy>											{channel="zwave:device:51cae397:node2:battery-level"}
Number		Auge_Node2_Alarm					"Flur Alarm"					<fire>												{channel="zwave:device:51cae397:node2:alarm_tamper"}
Switch		Motion_Flur_Timer																										{ expire="4m,command=OFF" }

My Rule:

rule "Motion sensor triggered floor"
	when
		Item Auge_Node2 changed from OFF to ON
	then
		if (Auge_Node2_Licht.state < 300 ) {
  	
		Flur_Helligkeit.sendCommand(100)
  		Motion_Flur_Timer.sendCommand(ON)
  	}
end
rule "Lights on by motion floor"
	when
		Item Motion_Flur_Timer changed to ON
	then
		Flur_Helligkeit.sendCommand(100)
end
rule "Lights off by no more motion floor"
	when
		Item Motion_Flur_Timer changed to OFF
	then
		Flur_Helligkeit.sendCommand(0)
end

The item “Motion_Flur_Timer” is working nice on my sitemap. Maybe it’s only a little problem but i can’t find my problem.

Thx for you help and sorry for my englisch :relaxed:

Not sure what the problem is that you are trying to solve here / what is happening (or not) that you think is “wrong” ?

BTW you are redundantly sending

Flur_Helligkeit.sendCommand(100) 

in your first two rules. You only need it in the second rule.

In your first rule, put in some logDebug statements to make sure the luminance detection is working. One before the luminance test. Print the luminance value in that statement. Another logDebug statement directly after the luminance test before the sendCommand that also prints the luminance value and a success message. Also add an else clause to the IF test and in that clause logDebug a fail message and the luminance value.

I have fooled around a bit with Aeon multisensors and my experience with the luminance is that you can get wildly varying values.