Cant get a simple rule to work

Hi all, thanks for peeking.

Simple rule - when one switch is turned on - turn on the bathroom light
If someone could sanitize the below - i would be grateful :slight_smile:

---the rule---

rule "Slave_1 On"
when
  Item Slave_1 changed to ON
then
  Bathroom.sendCommand(100)
end

rule "Slave_1 Off"
when
  Item Slave_1 changed to OFF
then
  Bathroom.sendCommand(0)
end


---Items--- 

Switch Slave_1  "Slave 1 [%d %%]"
        {channel="rfxcom:lighting5:41f5363c_16060396_13:command"}
		
Dimmer Bathroom "Bathroom [%d %%]" (Alights) [ "Lighting" ]
        {channel="zwave:device:6f409fa7:node3:command",
         channel="zwave:device:6f409fa7:node3:switch_dimmer1",
         channel="zwave:device:6f409fa7:node3:sensor_power1",
         channel="zwave:device:6f409fa7:node3:meter_kwh1",
         channel="zwave:device:6f409fa7:node3:meter_watts1",
         channel="zwave:device:6f409fa7:node3:alarm_general1"}

Have you tried

Bathroom.sendCommand("0")

There is a whole lot that can go wrong here. Is Slave_1 changing state? Check events.log to verify.

Is the Rule triggering? Add logging statements to the Rules and watch openahb.log to verify.

I don’t see anything wrong with these rules. The only thing that is slightly wrong is [%d %%] makes no sense for a Switch. Do you have any errors in openhab.log?

Hi - thanks for your reply, no i do not see the rule triggering - all i see if the events.log is the below :

2019-01-31 22:52:32.670 [vent.ItemStateChangedEvent] -
rfxcom_lighting5_41f5363c_16058678_13_command changed from OFF to ON
2019-01-31 22:52:32.705 [vent.ItemStateChangedEvent] - rfxcom_lighting5_41f5363c_16058678_13_contact changed from CLOSED to OPEN

I also tried the below that still did not trigger the rule:

rule "slaveWork"
when
Item Slave_1 received command ON or
Item Slave_1 received update On
then
Bathroom.sendCommand(ON)
end

Could you let me know how to add the rule logging?

Ah good spot - yep [%d %%] is not needed (think i had it set up as a dimmer in the past).
No errors seen in openhab.log unfortunately.

If your Item Slave_1 is not changing state then your rule won’t run. You need to look at that Item and its binding. The Item rfxcom channel and the event log you’ve shown us don’t match, were they supposed to?