[SOLVED] Newbie, help with my first rule: Hue lights

Hi All, I’m new to OpenHAB and I’m trying to write my first rule:

I have bound Philips HUE and the device have been found, items I have added are:

Switch Top_Landing_Presence “Top_Motion” {channel=“hue:0107:001788499314:2:presence”}
Color Top_bulb “Top” {channel=“hue:0210:001788499314:7:color”}

My rule is:

rule "Turn bulb switch on"
when
   Item Top_Landing_Presence changed from off to on
then.
   Top_Bulb.sendCommand(On)
end

However no matter what I have tried, I can’t et the rules to work, can someone point in the right direction please?

Ian

rule "Turn bulb switch on"
when
   Item Top_Landing_Presence changed from OFF to ON
then
   Top_Bulb.sendCommand(ON)
end

No . after then
Use OFF and ON not off, on, or On

Thank you, I also discovered looking at the log, I had “Top_Bulb” instead of “Top_bulb” that I had defined :slight_smile:

If you look at the logs live when you save a rules file, it should give some feedback if you have errors…
Good luck
Welcome to OH

2 Likes