Help structuring/expanding a motion sensor piston


#1

1) Give a description of the problem
Currently have a piston that i use to turn a virtual switch on/off based on motion captured on 3 motion sensors. I just bought a Ring doorbell and want to incorporate the Ring motion trigger into the overall motion detection scheme.

I feel like the easiest way to accomplish this is to break everything into 3 pistons:

  1. Motion trigger from motions sensors
  2. Motion trigger from Ring
  3. Actions based on 1 and 2 (1 and 2 would trigger this 3rd Piston)

Not sure if it’s generally good design to break things out like this, or if there are performance considerations?

2) What is the expected behaviour?
That the Ring and motion sensor pistons would trigger the actions piston.

**4) Post a Green Snapshot of the piston!


#2

Generally, I find it much easier to write task specific pistons and stay away from multi-task pistons. Task specific pistons are much easier to debug and you are more likely to get prompt assistance on this forum with short, easy-to-debug pistons.


#3

Yes, I like to have simplicity in my life too. I often struggle, though, with figuring out where that line is when it comes to pistons. For this case, you’re saying I should break them up into separate pistons?


#4

Yes, at first glance, it seems to me that the motion from sensors and motion from the Ring should be different pistons.


#5

I think you’re right. I’m going to split them up and do a trial run and see how it works out. Thanks for the advice!