I’ve started having a play with nodered in the last few days, and I’m starting to think that it’s a little overcomplicated. The reality of it is probably that I am not doing it right!
Take a look at this flow as an example of just one room:
This is for my kitchen lights that work on a sensor. Also there is an override for a light switch too.
Would there be any way of simplifying this? Or am I on the right track?
[{“id”:“86f69bc1.22f928”,“type”:“inject”,“z”:“9c3fbcbe.6a356”,“name”:“Force On”,“topic”:“”,“payload”:“on”,“payloadType”:“str”,“repeat”:“”,“crontab”:“”,“once”:false,“onceDelay”:0.1,“x”:120,“y”:160,“wires”:[[“b87306e6.d2b898”]]},{“id”:“903e84ef.645d88”,“type”:“inject”,“z”:“9c3fbcbe.6a356”,“name”:“Force Off”,“topic”:“”,“payload”:“off”,“payloadType”:“str”,“repeat”:“”,“crontab”:“”,“once”:false,“onceDelay”:0.1,“x”:120,“y”:200,“wires”:[[“b87306e6.d2b898”]]},{“id”:“b87306e6.d2b898”,“type”:“api-current-state”,“z”:“9c3fbcbe.6a356”,“name”:“Home?”,“server”:“cfa79f02.db9d4”,“outputs”:2,“halt_if”:“home”,“halt_if_type”:“str”,“halt_if_compare”:“is_not”,“override_topic”:true,“entity_id”:“group.family”,“state_type”:“str”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“x”:340,“y”:80,“wires”:[[“4af1c709.207148”],]},{“id”:“614a1304.5abf4c”,“type”:“server-state-changed”,“z”:“9c3fbcbe.6a356”,“name”:“Motion in kitchen”,“server”:“cfa79f02.db9d4”,“entityidfilter”:“binary_sensor.hue_motion_motion_kitchen”,“entityidfiltertype”:“exact”,“outputinitially”:false,“state_type”:“str”,“haltifstate”:“”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“outputs”:1,“output_only_on_state_change”:true,“x”:120,“y”:80,“wires”:[[“b87306e6.d2b898”]]},{“id”:“fb6cdda8.2ff0c”,“type”:“switch”,“z”:“9c3fbcbe.6a356”,“name”:“on or off”,“property”:“payload”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“on”,“vt”:“str”},{“t”:“eq”,“v”:“off”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:2,“x”:560,“y”:60,“wires”:[[“82483540.c41218”,“144c5641.6ddbaa”,“67054652.281088”],]},{“id”:“570ac7b0.25d598”,“type”:“api-call-service”,“z”:“9c3fbcbe.6a356”,“name”:“Ceiling”,“server”:“cfa79f02.db9d4”,“service_domain”:“switch”,“service”:“turn_off”,“data”:“{"entity_id":"switch.kitchen_ceiling_lights"}”,“mergecontext”:“”,“output_location”:“”,“output_location_type”:“none”,“x”:1230,“y”:360,“wires”:[]},{“id”:“e9fbac14.f9ba2”,“type”:“api-call-service”,“z”:“9c3fbcbe.6a356”,“name”:“Kitchen Table On 80%”,“server”:“cfa79f02.db9d4”,“service_domain”:“light”,“service”:“turn_on”,“data”:“{"entity_id":"light.kitchen_table","brightness_pct":"80"}”,“mergecontext”:“”,“output_location”:“”,“output_location_type”:“none”,“x”:1280,“y”:140,“wires”:[]},{“id”:“dc71515b.3b78”,“type”:“api-call-service”,“z”:“9c3fbcbe.6a356”,“name”:“Ceiling”,“server”:“cfa79f02.db9d4”,“service_domain”:“switch”,“service”:“turn_on”,“data”:“{"entity_id":"switch.kitchen_ceiling_lights"}”,“mergecontext”:“”,“output_location”:“”,“output_location_type”:“none”,“x”:1230,“y”:20,“wires”:[]},{“id”:“42583766.db12a8”,“type”:“api-call-service”,“z”:“9c3fbcbe.6a356”,“name”:“Kitchen Counter On 1%”,“server”:“cfa79f02.db9d4”,“service_domain”:“light”,“service”:“turn_on”,“data”:“{"entity_id":"light.counter_lights","brightness_pct":"1"}”,“mergecontext”:“”,“output_location”:“”,“output_location_type”:“none”,“x”:1290,“y”:200,“wires”:[]},{“id”:“82483540.c41218”,“type”:“api-current-state”,“z”:“9c3fbcbe.6a356”,“name”:“light below 85”,“server”:“cfa79f02.db9d4”,“outputs”:2,“halt_if”:“85”,“halt_if_type”:“num”,“halt_if_compare”:“gte”,“override_topic”:true,“entity_id”:“sensor.kitchen_light_level”,“state_type”:“num”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“x”:820,“y”:60,“wires”:[[“ce1f8241.13728”],]},{“id”:“2954d8ca.b04678”,“type”:“api-call-service”,“z”:“9c3fbcbe.6a356”,“name”:“Cupboards”,“server”:“cfa79f02.db9d4”,“service_domain”:“switch”,“service”:“turn_on”,“data”:“{"entity_id":"switch.cupboard_lights"}”,“mergecontext”:“”,“output_location”:“”,“output_location_type”:“none”,“x”:1250,“y”:80,“wires”:[]},{“id”:“f0a86ea3.77a2a”,“type”:“api-call-service”,“z”:“9c3fbcbe.6a356”,“name”:“Cupboards”,“server”:“cfa79f02.db9d4”,“service_domain”:“switch”,“service”:“turn_off”,“data”:“{"entity_id":"switch.cupboard_lights"}”,“mergecontext”:“”,“output_location”:“”,“output_location_type”:“none”,“x”:1250,“y”:420,“wires”:[]},{“id”:“144c5641.6ddbaa”,“type”:“api-current-state”,“z”:“9c3fbcbe.6a356”,“name”:“Light below 20”,“server”:“cfa79f02.db9d4”,“outputs”:2,“halt_if”:“25”,“halt_if_type”:“num”,“halt_if_compare”:“gte”,“override_topic”:true,“entity_id”:“sensor.kitchen_light_level”,“state_type”:“num”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“x”:820,“y”:120,“wires”:[[“971c4285.25fa4”,“79737ee9.f785a”,“4c83c194.9dd93”],]},{“id”:“67cef0cc.1b02e”,“type”:“api-current-state”,“z”:“9c3fbcbe.6a356”,“name”:“Already Off?”,“server”:“cfa79f02.db9d4”,“outputs”:2,“halt_if”:“off”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“override_topic”:true,“entity_id”:“switch.cupboard_lights”,“state_type”:“str”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“x”:1050,“y”:420,“wires”:[[“f0a86ea3.77a2a”],]},{“id”:“70c6dac7.b65bc4”,“type”:“api-current-state”,“z”:“9c3fbcbe.6a356”,“name”:“Already Off?”,“server”:“cfa79f02.db9d4”,“outputs”:2,“halt_if”:“off”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“override_topic”:true,“entity_id”:“light.kitchen_table”,“state_type”:“str”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“x”:1050,“y”:280,“wires”:[[“3efe6749.b766d8”],]},{“id”:“2b87a932.caacb6”,“type”:“api-current-state”,“z”:“9c3fbcbe.6a356”,“name”:“Already Off?”,“server”:“cfa79f02.db9d4”,“outputs”:2,“halt_if”:“off”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“override_topic”:true,“entity_id”:“switch.kitchen_ceiling_lights”,“state_type”:“str”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“x”:1050,“y”:360,“wires”:[[“570ac7b0.25d598”],]},{“id”:“971c4285.25fa4”,“type”:“api-current-state”,“z”:“9c3fbcbe.6a356”,“name”:“Already On?”,“server”:“cfa79f02.db9d4”,“outputs”:2,“halt_if”:“on”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“override_topic”:true,“entity_id”:“switch.cupboard_lights”,“state_type”:“str”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“x”:1050,“y”:80,“wires”:[[“2954d8ca.b04678”],]},{“id”:“79737ee9.f785a”,“type”:“api-current-state”,“z”:“9c3fbcbe.6a356”,“name”:“Already On?”,“server”:“cfa79f02.db9d4”,“outputs”:2,“halt_if”:“on”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“override_topic”:true,“entity_id”:“light.kitchen_table”,“state_type”:“str”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“x”:1050,“y”:120,“wires”:[[“e9fbac14.f9ba2”],]},{“id”:“ce1f8241.13728”,“type”:“api-current-state”,“z”:“9c3fbcbe.6a356”,“name”:“Already On?”,“server”:“cfa79f02.db9d4”,“outputs”:2,“halt_if”:“on”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“override_topic”:true,“entity_id”:“switch.kitchen_ceiling_lights”,“state_type”:“str”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“x”:1050,“y”:40,“wires”:[[“dc71515b.3b78”],]},{“id”:“4c83c194.9dd93”,“type”:“api-current-state”,“z”:“9c3fbcbe.6a356”,“name”:“Already On?”,“server”:“cfa79f02.db9d4”,“outputs”:2,“halt_if”:“on”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“override_topic”:true,“entity_id”:“light.counter_lights”,“state_type”:“str”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“x”:1050,“y”:160,“wires”:[[“42583766.db12a8”],]},{“id”:“9c54f28e.0022e”,“type”:“trigger”,“z”:“9c3fbcbe.6a356”,“op1”:“”,“op2”:“on”,“op1type”:“nul”,“op2type”:“str”,“duration”:“2”,“extend”:true,“units”:“min”,“reset”:“”,“bytopic”:“all”,“name”:“”,“x”:450,“y”:300,“wires”:[[“6a594b36.f10944”]]},{“id”:“3abbb49a.da7b4c”,“type”:“trigger”,“z”:“9c3fbcbe.6a356”,“op1”:“”,“op2”:“on”,“op1type”:“nul”,“op2type”:“str”,“duration”:“8”,“extend”:true,“units”:“min”,“reset”:“”,“bytopic”:“all”,“name”:“”,“x”:450,“y”:260,“wires”:[[“358cad2c.ecdd52”]]},{“id”:“3efe6749.b766d8”,“type”:“api-call-service”,“z”:“9c3fbcbe.6a356”,“name”:“Kitchen Table Off”,“server”:“cfa79f02.db9d4”,“service_domain”:“light”,“service”:“turn_off”,“data”:“{"entity_id":"light.kitchen_table"}”,“mergecontext”:“”,“output_location”:“”,“output_location_type”:“none”,“x”:1270,“y”:280,“wires”:[]},{“id”:“933afc45.9651c”,“type”:“api-call-service”,“z”:“9c3fbcbe.6a356”,“name”:“Kitchen Counter Off”,“server”:“cfa79f02.db9d4”,“service_domain”:“light”,“service”:“turn_off”,“data”:“{"entity_id":"light.counter_lights"}”,“mergecontext”:“”,“output_location”:“”,“output_location_type”:“none”,“x”:1280,“y”:320,“wires”:[]},{“id”:“e9b0e61a.5bff18”,“type”:“api-current-state”,“z”:“9c3fbcbe.6a356”,“name”:“Already Off?”,“server”:“cfa79f02.db9d4”,“outputs”:2,“halt_if”:“off”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“override_topic”:true,“entity_id”:“light.counter_lights”,“state_type”:“str”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“x”:1050,“y”:320,“wires”:[[“933afc45.9651c”],]},{“id”:“4af1c709.207148”,“type”:“change”,“z”:“9c3fbcbe.6a356”,“name”:“home to on”,“rules”:[{“t”:“change”,“p”:“payload”,“pt”:“msg”,“from”:“home”,“fromt”:“str”,“to”:“on”,“tot”:“str”}],“action”:“”,“property”:“”,“from”:“”,“to”:“”,“reg”:false,“x”:550,“y”:140,“wires”:[[“fb6cdda8.2ff0c”]]},{“id”:“c5489803.019328”,“type”:“comment”,“z”:“9c3fbcbe.6a356”,“name”:“Kitchen Motion”,“info”:“”,“x”:120,“y”:40,“wires”:},{“id”:“67054652.281088”,“type”:“api-current-state”,“z”:“9c3fbcbe.6a356”,“name”:“sulight <9”,“server”:“cfa79f02.db9d4”,“outputs”:2,“halt_if”:“9”,“halt_if_type”:“num”,“halt_if_compare”:“lte”,“override_topic”:true,“entity_id”:“sensor.sunlight_pct”,“state_type”:“num”,“state_location”:“payload”,“override_payload”:“msg”,“entity_location”:“data”,“override_data”:“msg”,“x”:540,“y”:200,“wires”:[[“3abbb49a.da7b4c”,“9c54f28e.0022e”],]},{“id”:“6d3cea27.0d4514”,“type”:“trigger”,“z”:“9c3fbcbe.6a356”,“op1”:“”,“op2”:“restart”,“op1type”:“nul”,“op2type”:“str”,“duration”:“30”,“extend”:true,“units”:“min”,“reset”:“on”,“bytopic”:“all”,“name”:“”,“x”:710,“y”:480,“wires”:[[“54c2856e.7f028c”,“e090e062.c6d75”]]},{“id”:“37d82964.ee85f6”,“type”:“server-state-changed”,“z”:“9c3fbcbe.6a356”,“name”:“Dimmer Press”,“server”:“cfa79f02.db9d4”,“entityidfilter”:“sensor.hue_dimmer_kitchen”,“entityidfiltertype”:“exact”,“outputinitially”:false,“state_type”:“str”,“haltifstate”:“”,“halt_if_type”:“str”,“halt_if_compare”:“is”,“outputs”:1,“output_only_on_state_change”:true,“x”:110,“y”:420,“wires”:[[“fc86ae00.6da87”]]},{“id”:“fc86ae00.6da87”,“type”:“change”,“z”:“9c3fbcbe.6a356”,“name”:“”,“rules”:[{“t”:“change”,“p”:“payload”,“pt”:“msg”,“from”:“1_click_up”,“fromt”:“str”,“to”:“dimmer_click”,“tot”:“str”},{“t”:“change”,“p”:“payload”,“pt”:“msg”,“from”:“2_click_up”,“fromt”:“str”,“to”:“dimmer_click”,“tot”:“str”},{“t”:“change”,“p”:“payload”,“pt”:“msg”,“from”:“3_click_up”,“fromt”:“str”,“to”:“dimmer_click”,“tot”:“str”},{“t”:“change”,“p”:“payload”,“pt”:“msg”,“from”:“4_click_up”,“fromt”:“str”,“to”:“dimmer_click”,“tot”:“str”},{“t”:“change”,“p”:“payload”,“pt”:“msg”,“from”:“1_hold_up”,“fromt”:“str”,“to”:“dimmer_click”,“tot”:“str”},{“t”:“change”,“p”:“payload”,“pt”:“msg”,“from”:“2_hold_up”,“fromt”:“str”,“to”:“dimmer_click”,“tot”:“str”},{“t”:“change”,“p”:“payload”,“pt”:“msg”,“from”:“3_hold_up”,“fromt”:“str”,“to”:“dimmer_click”,“tot”:“str”},{“t”:“change”,“p”:“payload”,“pt”:“msg”,“from”:“1_hold”,“fromt”:“str”,“to”:“dimmer_click”,“tot”:“str”},{“t”:“change”,“p”:“payload”,“pt”:“msg”,“from”:“2_hold”,“fromt”:“str”,“to”:“dimmer_click”,“tot”:“str”},{“t”:“change”,“p”:“payload”,“pt”:“msg”,“from”:“3_hold”,“fromt”:“str”,“to”:“dimmer_click”,“tot”:“str”}],“action”:“”,“property”:“”,“from”:“”,“to”:“”,“reg”:false,“x”:560,“y”:420,“wires”:[[“6d3cea27.0d4514”,“e090e062.c6d75”,“54c2856e.7f028c”]]},{“id”:“e090e062.c6d75”,“type”:“traffic”,“z”:“9c3fbcbe.6a356”,“name”:“”,“property_allow”:“payload”,“filter_allow”:“restart”,“ignore_case_allow”:false,“negate_allow”:false,“send_allow”:false,“property_stop”:“payload”,“filter_stop”:“dimmer_click”,“ignore_case_stop”:false,“negate_stop”:false,“send_stop”:false,“default_start”:true,“differ”:false,“x”:830,“y”:260,“wires”:[[“70c6dac7.b65bc4”,“e9b0e61a.5bff18”,“2b87a932.caacb6”]]},{“id”:“54c2856e.7f028c”,“type”:“traffic”,“z”:“9c3fbcbe.6a356”,“name”:“”,“property_allow”:“payload”,“filter_allow”:“restart”,“ignore_case_allow”:false,“negate_allow”:false,“send_allow”:false,“property_stop”:“payload”,“filter_stop”:“dimmer_click”,“ignore_case_stop”:false,“negate_stop”:false,“send_stop”:false,“default_start”:true,“differ”:false,“x”:830,“y”:300,“wires”:[[“67cef0cc.1b02e”]]},{“id”:“6a594b36.f10944”,“type”:“time-range-switch”,“z”:“9c3fbcbe.6a356”,“name”:“”,“lat”:“53.0060”,“lon”:“-1.4587”,“startTime”:“09:00”,“endTime”:“dusk”,“startOffset”:0,“endOffset”:“-60”,“x”:630,“y”:300,“wires”:[[“54c2856e.7f028c”],]},{“id”:“358cad2c.ecdd52”,“type”:“time-range-switch”,“z”:“9c3fbcbe.6a356”,“name”:“”,“lat”:“53.0060”,“lon”:“-1.4587”,“startTime”:“09:00”,“endTime”:“dusk”,“startOffset”:0,“endOffset”:“-60”,“x”:630,“y”:260,“wires”:[[“e090e062.c6d75”],]},{“id”:“cfa79f02.db9d4”,“type”:“server”,“z”:“”,“name”:“Home Assistant”,“legacy”:false,“hassio”:true,“rejectUnauthorizedCerts”:true,“ha_boolean”:“y|yes|true|on|home|open”,“connectionDelay”:false}]