I have a flow like that here:
code:
[{"id":"a4cfead0.cc9458","type":"openhab2-in","z":"9c38b59d.29bee8","name":"","controller":"b5665ec0.78463","itemname":"swMotion_Sensor_Gang_Status","x":210,"y":120,"wires":[[],["5d828df3.af3d44"]]},{"id":"67a8dc9d.c6e354","type":"openhab2-in","z":"9c38b59d.29bee8","name":"","controller":"b5665ec0.78463","itemname":"swMotion_Sensor_Stue_Vindue_Status","x":230,"y":240,"wires":[[],["5d828df3.af3d44"]]},{"id":"36585125.36309e","type":"openhab2-in","z":"9c38b59d.29bee8","name":"","controller":"b5665ec0.78463","itemname":"swMotion_Sensor_Stue2_Status","x":210,"y":300,"wires":[[],["5d828df3.af3d44"]]},{"id":"d0b85519.2ba3b8","type":"openhab2-in","z":"9c38b59d.29bee8","name":"","controller":"b5665ec0.78463","itemname":"swMotion_Sensor_Sove_Status","x":210,"y":180,"wires":[[],["5d828df3.af3d44"]]},{"id":"b03fe8f4.cc5bf8","type":"openhab2-in","z":"9c38b59d.29bee8","name":"","controller":"b5665ec0.78463","itemname":"swMotion_Sensor_Kitchen_Status","x":220,"y":60,"wires":[[],["5d828df3.af3d44"]]},{"id":"6951d663.52b568","type":"switch","z":"9c38b59d.29bee8","name":"On?","property":"payload.payload.value","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"}],"checkall":"true","outputs":1,"x":550,"y":240,"wires":[["63a5e555.de2c2c","194af219.c6eefe"]]},{"id":"4c52683d.1cc438","type":"switch","z":"9c38b59d.29bee8","name":"","property":"item","propertyType":"msg","rules":[{"t":"eq","v":"swMotion_Sensor_Kitchen_Status","vt":"str"},{"t":"eq","v":"swMotion_Sensor_Gang_Status","vt":"str"},{"t":"eq","v":"swMotion_Sensor_Sove_Status","vt":"str"},{"t":"eq","v":"swMotion_Sensor_Stue_Status","vt":"str"},{"t":"eq","v":"swMotion_Sensor_Stue2_Status","vt":"str"}],"checkall":"true","outputs":5,"x":1090,"y":120,"wires":[["d410c389.1fb6c"],["9ffca470.064758"],["88af2ec.9635ad"],["d479fddd.a0de5"],["d479fddd.a0de5","a225af8c.de63c"]]},{"id":"d410c389.1fb6c","type":"openhab2-out","z":"9c38b59d.29bee8","name":"","controller":"b5665ec0.78463","itemname":"gLights_Kitchen_toggle","topic":"ItemCommand","payload":"","x":1430,"y":100,"wires":[]},{"id":"9ffca470.064758","type":"openhab2-out","z":"9c38b59d.29bee8","name":"","controller":"b5665ec0.78463","itemname":"gLights_Gang_toggle","topic":"ItemCommand","payload":"","x":1420,"y":140,"wires":[]},{"id":"9af01c6a.938b4","type":"openhab2-out","z":"9c38b59d.29bee8","name":"","controller":"b5665ec0.78463","itemname":"gLights_Stue_toggle","topic":"ItemCommand","payload":"","x":1440,"y":240,"wires":[]},{"id":"5dddabc1.108fb4","type":"openhab2-out","z":"9c38b59d.29bee8","name":"Plug_stue_lampe","controller":"b5665ec0.78463","itemname":"swPlug_Stue_LAMPE","topic":"ItemCommand","payload":"","x":1430,"y":280,"wires":[]},{"id":"88af2ec.9635ad","type":"openhab2-out","z":"9c38b59d.29bee8","name":"","controller":"b5665ec0.78463","itemname":"gLights_Sove_toggle","topic":"ItemCommand","payload":"","x":1440,"y":180,"wires":[]},{"id":"55bc5258.61eb3c","type":"debug","z":"9c38b59d.29bee8","name":"","active":false,"console":"false","complete":"true","x":870,"y":280,"wires":[]},{"id":"63a5e555.de2c2c","type":"switch","z":"9c38b59d.29bee8","name":"Dark?","property":"IsItDark","propertyType":"global","rules":[{"t":"eq","v":"ON","vt":"str"}],"checkall":"true","outputs":1,"x":630,"y":120,"wires":[["5e2495e9.0c272c","83a90d29.5906c"]]},{"id":"3dc78b12.6057c4","type":"inject","z":"9c38b59d.29bee8","name":"","topic":"","payload":"OFF","payloadType":"str","repeat":"","crontab":"","once":false,"x":1170,"y":40,"wires":[["d410c389.1fb6c","9ffca470.064758","88af2ec.9635ad","9af01c6a.938b4","5dddabc1.108fb4"]]},{"id":"194af219.c6eefe","type":"debug","z":"9c38b59d.29bee8","name":"","active":false,"console":"false","complete":"true","x":690,"y":280,"wires":[]},{"id":"5e2495e9.0c272c","type":"debug","z":"9c38b59d.29bee8","name":"","active":false,"console":"false","complete":"true","x":690,"y":40,"wires":[]},{"id":"7e18f04f.71e09","type":"switch","z":"9c38b59d.29bee8","name":"swMotionSensorLightON?","property":"payload.state","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"}],"checkall":"true","outputs":1,"x":870,"y":120,"wires":[["cea75303.c2a1","277bfe1d.5dedc2"]]},{"id":"83a90d29.5906c","type":"openhab2-get","z":"9c38b59d.29bee8","name":"","controller":"b5665ec0.78463","itemname":"swMotionSensorLight","x":720,"y":180,"wires":[["7e18f04f.71e09","55bc5258.61eb3c"]]},{"id":"cea75303.c2a1","type":"debug","z":"9c38b59d.29bee8","name":"","active":false,"console":"false","complete":"true","x":890,"y":40,"wires":[]},{"id":"5d828df3.af3d44","type":"trigger","z":"9c38b59d.29bee8","op1":"","op2":"","op1type":"nul","op2type":"payl","duration":"200","extend":false,"units":"ms","reset":"","name":"","x":460,"y":160,"wires":[["6951d663.52b568","ee85a1e8.c96bc"]]},{"id":"ee85a1e8.c96bc","type":"debug","z":"9c38b59d.29bee8","name":"","active":false,"console":"false","complete":"true","x":530,"y":40,"wires":[]},{"id":"277bfe1d.5dedc2","type":"change","z":"9c38b59d.29bee8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"ON","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":220,"wires":[["4c52683d.1cc438"]]},{"id":"d479fddd.a0de5","type":"switch","z":"9c38b59d.29bee8","name":"MotionSensingTriggerStue?","property":"MotionSensingTriggerStue","propertyType":"global","rules":[{"t":"neq","v":"OFF","vt":"str"}],"checkall":"true","outputs":1,"x":1160,"y":280,"wires":[["5dddabc1.108fb4","9af01c6a.938b4","31a54a7d.cfbd36"]]},{"id":"31a54a7d.cfbd36","type":"debug","z":"9c38b59d.29bee8","name":"","active":true,"console":"false","complete":"true","x":1390,"y":340,"wires":[]},{"id":"a225af8c.de63c","type":"debug","z":"9c38b59d.29bee8","name":"","active":true,"console":"false","complete":"true","x":1210,"y":340,"wires":[]},{"id":"b5665ec0.78463","type":"openhab2-controller","z":"","name":"Openhab","protocol":"http","host":"192.168.1.109","port":"8080","path":"","username":"","password":""}]