[SOLVED] Creating a Scene

I’m new to writing rules this way but you can test this to see if it works.

rule "Etenstijd"
when
	Item Scene_Eten received command ON
then
	logInfo("Scene Etenstijd gestart", "bjorn en lili licht aan bij starten van de scene")
      Officebjornlicht.sendCommand(if(Officebjornlicht.state == ON) ON else OFF)
	Officelililicht.sendCommand(if(Officelililicht.state == ON) ON else OFF)
	
      Scene_Eten.postUpdate(OFF)

end

The rule should change the light to it’s opposite state every time Scene_Eten receives command ON.:crossed_fingers:

EDIT: Now the rule has been tested and works, credit goes to @rlkoshak for showing me how to use edge cases.:sunglasses: Thanks Rich

1 Like