I would like to forward the dimming percentage from an in wall Leviton dimmer switch (zwave) to a bunch of other devices in the network.
I have the following rules created, and the ON and OFF events are triggered and forwarded correctly. However, when the dimming percentage is changed on the wall switch, it does not trigger any events in the rules engine (according to the logs).
Here is my code; Node 16 is the in wall dimmer, Node 15 is the slave device that should mirror the switch.
package org.openremote.controller.protocol
global org.openremote.controller.statuscache.CommandFacade execute;
global org.openremote.controller.statuscache.SwitchFacade switches;
import java.util.*;
import java.util.regex.*;
rule “Forward Mood Switch Turn Devices On”
when
Event( source == “Node 16 On/Off”, value == “on” )
then
execute.command(“Node 15 (ON)”);
end
rule “Forward Mood Switch Turn Chandelier Off”
when
Event( source == “Node 16 On/Off”, value == “off” )
then
execute.command(“Node 15 (OFF)”);
end
rule “Forward Mood Switch Match Dim Level”
when
Event( source == “Node 16 On/Off”, value == “on” )
Event( source == “Node 16 Dimmer”, $val : value )
then
String valStr = $val.toString();
if (valStr != null )
{
execute.command( “Node 15 Dimmer”, valStr );
}
end
``
I cannot figure out why the rule is not being triggered.
Thanks