Need help with a, should be, easy piston


#21

Certainly it depends on what you’re looking to do… There can be reasons for or against. but if you’re monitoring 3 separate doors and doing different thing with each then perhaps it’s best to make three different pistons.

I have 16 Z Wave light switches throughout my house and they have a double-tap feature to them. In different rooms I’ve done different things with them. So I opted to put them all in their own pistons. But I set the pistons up to use all variables for everything. So that way I can just duplicate it as I add more switches and make a few changes and I’m done.


#22

Well I have another piston that is just a notification piston, so it looks like this:
If door #1 opens
PUSH notification

If door #2 opens for 10m
PUSH notification

If switch #1 turns on
PUSH notification

If switch #2 is on for 60m
PUSH notification

I have like 10 different notifications all in the same piston. So im wondering if I should have a different piston for each.


#23

I’m not saying that one way is inherently better or worse than the other. You just have to understand the effects of what you’re doing if you have multiple triggers which will start your piston. If you have 10 IF conditions in it then all of them are evaluated whenever that piston gets started. If you’ve accounted for that then fine…but if you start seeing some unintended behavior then you may want to make some changes.

There’s also the ability to use Switch Blocks, which can significantly reduce the number of conditions that are tested against. There’s also the option to write a piston which intelligently knows which door opened and then only reacts to that one rather than checking every one (research $currentEventDevice).

(Check this very good thread…you may find it useful: Understanding $device, $devices, $currentEventDevice, etc )

So there are many options that you can use…