Motion Lighting is one of those things many of us use over and over. So I created a 'template' on my 1st page of Node-Red. I can just copy/paste the nodes anytime I need them. Because it's a template, I also tried to add options.. so that I can just delete items vs adding them in. This one has both Mode and time-of-day..
I detailed a large portion of this in my video for Node-Red
Flow
[{"id":"c17b4e60.1855e8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"4ac9a4f7.b6b094","type":"hubitat device","z":"c17b4e60.1855e8","name":"MotionSensor","server":"4681f676.154b78","deviceId":"","attribute":"","sendEvent":true,"x":300,"y":320,"wires":[["2d67ce4e.fe0d8a","96d7be23.de1ed8"]]},{"id":"907ce4f9.26f49","type":"switch","z":"c17b4e60.1855e8","name":"Active/Inactive","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"active","vt":"str"},{"t":"eq","v":"inactive","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":546,"y":391,"wires":[["c065ee86.379aa8"],["1433aecc.60b411"]]},{"id":"ca479ee8.17a6","type":"hubitat command","z":"c17b4e60.1855e8","name":"Office Ceiling Light ON","server":"4681f676.154b78","deviceId":"","command":"","commandArgs":"","x":1185,"y":377,"wires":[["fa994e7.641dc3"]]},{"id":"bcc35300.a236d","type":"hubitat command","z":"c17b4e60.1855e8","name":"Office Ceiling Light OFF","server":"4681f676.154b78","deviceId":"","command":"","commandArgs":"","x":1174,"y":501,"wires":[["fa994e7.641dc3"]]},{"id":"69086cbb.978a64","type":"hubitat mode","z":"c17b4e60.1855e8","name":"Mode Is","server":"4681f676.154b78","sendEvent":true,"x":328,"y":120,"wires":[["396af26d.353eae"]]},{"id":"2d67ce4e.fe0d8a","type":"switch","z":"c17b4e60.1855e8","name":"Mode Switch","property":"currentMode","propertyType":"global","rules":[{"t":"eq","v":"Day","vt":"str"},{"t":"eq","v":"Evening","vt":"str"},{"t":"eq","v":"Night","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":4,"x":270,"y":486,"wires":[["907ce4f9.26f49"],["907ce4f9.26f49"],["907ce4f9.26f49"],["bcc35300.a236d"]]},{"id":"4ef189ac.1550f","type":"change","z":"c17b4e60.1855e8","name":"saveCurrentMode","rules":[{"t":"set","p":"currentMode","pt":"global","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":673,"y":120,"wires":[["a4b0dca3.fa323"]]},{"id":"396af26d.353eae","type":"rbe","z":"c17b4e60.1855e8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":493,"y":120,"wires":[["4ef189ac.1550f"]]},{"id":"a4b0dca3.fa323","type":"debug","z":"c17b4e60.1855e8","d":true,"name":"SavedMode IS","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1298,"y":124,"wires":[]},{"id":"71a8a072.d0bcc","type":"inject","z":"c17b4e60.1855e8","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":130,"y":320,"wires":[["4ac9a4f7.b6b094"]]},{"id":"96d7be23.de1ed8","type":"debug","z":"c17b4e60.1855e8","d":true,"name":"Motion IS","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1330,"y":320,"wires":[]},{"id":"bd451cc7.0b89e","type":"comment","z":"c17b4e60.1855e8","name":"set a global mode variable, global.currentMode, useful everywhere in this Flow.","info":"","x":358,"y":58,"wires":[]},{"id":"161bd6c6.6c2dc9","type":"comment","z":"c17b4e60.1855e8","name":"sample of Motion by Mode","info":"","x":188,"y":261,"wires":[]},{"id":"c30c9e14.48887","type":"inject","z":"c17b4e60.1855e8","name":"","repeat":"","crontab":"","once":true,"onceDelay":"0.1","topic":"","payload":"Started!","payloadType":"str","x":138,"y":121,"wires":[["69086cbb.978a64"]]},{"id":"c065ee86.379aa8","type":"change","z":"c17b4e60.1855e8","name":"Cancelable","rules":[{"t":"delete","p":"payload.value","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":747,"y":384,"wires":[["f149ae45.565e","1433aecc.60b411"]]},{"id":"f149ae45.565e","type":"time-range-switch","z":"c17b4e60.1855e8","name":"Dawn-8PM","lat":"37.3230","lon":"-122.0322","startTime":"sunrise","endTime":"20:00","startOffset":0,"endOffset":0,"x":922,"y":384,"wires":[["ca479ee8.17a6"],["e100ee34.01d4e"]]},{"id":"e100ee34.01d4e","type":"hubitat command","z":"c17b4e60.1855e8","name":"Office Ceiling Light 10%","server":"4681f676.154b78","deviceId":"","command":"","commandArgs":"10","x":1175,"y":438,"wires":[[]]},{"id":"fa994e7.641dc3","type":"debug","z":"c17b4e60.1855e8","d":true,"name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1448,"y":438,"wires":[]},{"id":"1433aecc.60b411","type":"stoptimer-varidelay","z":"c17b4e60.1855e8","duration":"15","durationType":"num","units":"Second","payloadtype":"num","payloadval":"0","name":"","reporting":"none","x":908,"y":458,"wires":[["bcc35300.a236d"],[],[]]},{"id":"4681f676.154b78","type":"hubitat config","z":"","name":"TEST Hub","usetls":false,"host":"192.168.1.100","port":"80","appId":"33","nodeRedServer":"http://raspberrypi2.aclysnet.com:1880","webhookPath":"/hubitat/webhook_","autoRefresh":true,"useWebsocket":false}]