I have a series of flows for each room in my home, one for home occupancy status, another for device health monitoring and a final for “routines” which has become larger and larger as I create new automations that don’t really categorize well. In addition to this complex routines flow, Most of the room flows are a jumbled mess or wires.
The one stragegy I have that is successful is I only use a group of nodes for a common set of actions instead of remaking an action for each scenario. i.e. If the lights turn on while occupied, but turn on dimly if the TV is playing, I reuse that same logic for a scenario where the lights are already on and the TV is playing.
I also provide a name for every node describing what it does as well as description nodes for finding sections in this mess.
I’m generally aware of a few design methods that could improve my organization but since most of them would require I rewire everything, I’m looking for some input on good node red design concepts out there.
- Use Link in and Link Out between scenario start and common node tasks
- Are “sub flows” appropriate to build a lower environment for groups of tasks, and link out/in from the parent flow, or am I mis understanding the purpose of sub flows
- is there a way to create a new space as part of a flow, so instead of having to move 10 node groups to make room for a new scenario, I can split them up into separate scenario flows.
I’d also like to know if there is a more extensible method for checking room occupancy and then acting on that state change, as well as other similar scenarios. Currently I have a set of copy/pasted node groups for each room that turn on an input_boolean when a room is occupied and starts a 10 minute timer that eventually turns off the boolean. If presence is detected, the timer countdown is restarted.
The input_boolean then triggers a set of nodes that either turn on or turn off lights, including checks for other input_booleans that determine how bright the lights should be, or if other switches should be turned on.
This works well for me, because the flows aren’t triggered every time the presence detection flaps from on to off and back on.
However, I feel that there likely is a better or more novel way of doing this.