Hello friends
I ’ m stuck into this: I have two variables into the .items file
Number LightsensorAl1 "Lightsensor [%.3f]" <energy> (Temperature,GF_Corridor) { bacnet="1:0:1" } Number lightSensorConfiguration "lightSensorConfiguration [%.3f ]" <energy> (Temperature,GF_Corridor)
and I want the variable lightSensorConfiguration to take values from a linear function where input is Lightsensor and output is lightSensorConfiguration as below
So in the .rules file I wrote this
rule "Initialize lightSensorConfiguration"
when
System started
then
var Number light_value=LightsensorAl1.state as DecimalType
var Number new_light_value=light_value*40
postUpdate(lightSensorConfiguration, new_light_value)
end
rule "Configure lightsensor"
when Item LightsensorAl1 changed
then
var Number light_value=LightsensorAl1.state as DecimalType
var Number new_light_value=light_value*40
postUpdate(lightSensorConfiguration, new_light_value)
end
`
But it doesn’t send any value . Can anyone please help me find what I have done wrong?
Thanks in advance