This is a general design question and not really related to any specific piston.
I’m just getting started with home automation in general and have a few pistons under my belt at this point. I’m wanting to get some opinions on two design choices though so I can consider how to build my system.
Does the community generally prefer many small pistons, or a few “uber” pistons? For example, would it be preferable to have let’s say an arrival piston and departure piston which simply set the Location Mode and then have multiple pistons which trigger on Location Mode changes (effectively chaining pistons), or just have one uber Arrival and one uber Departure piston.
With chaining, it seems a little easier to test and reason through smaller pistons, but there might be some added latency and might get messy if pistons need to share data since it’d need to be via globals (if that’s even something that’s common). They’re particularly easy to test as I can just manually set the Location Mode to something to test the chained pistons.
With an uber piston, it might be more performant and it’s “all in one place”. Also sharing state would be easier, particularly the person who specifically came home to trigger their particular preferences, although I guess if I really wanted that I could just trigger on their specific presence sensor instead of the location mode change.
Right now I’m leaning toward chaining pistons. I realize it’s ultimately personal preference, but it’d be great to hear from others of particular pitfalls I may not have experienced yet with either approach.
A pretty concrete example of what I’m thinking is that I have an arrival piston which upon either me or my girlfriend’s presence sensors becoming present, I set the location mode to Home. Then I have another piston where if both of us are not present, I set the location to Away. Potentially I could actually merge the two (on either change, if either are present set to home, else set to away), as one “Location Mode Management” piston. Then I would chain pistons off that like turning entry lights on when arriving, turning lights off when leaving, locking doors when leaving, thermostat changes, etc. Each logical set of “things” (lights, locks, temp) would be in their own piston which triggers on Location Mode change instead of inside the same arrival/departure piston.
Thoughts?