Is it possible in a rule statement to check when a a switch receives an update AND a variable (i define) equals something.
For example, i want to check for a switch to receive an update and my variable to equal something:
rule "Sync Soffit Lights if Double Tapped"
when
Item Light_House_Soffit received update AND
syncDimmer == 1
then
percent = ((Light_House_Soffit.state as DecimalType)).intValue
sendCommand(Light_Garage_Soffit, percent)
end
This is currently how i have it working:
rule "Sync Soffit Lights if Double Tapped"
when
Item Light_House_Soffit received update
then
if(syncDimmers == 1) {
percent = ((Light_House_Soffit.state as DecimalType)).intValue
sendCommand(Light_Garage_Soffit, percent)
//pushover("Lights have been dimmed")
}
else
logInfo("DIMMERS", "Dimmers not synced.")
}
end