Dog Door Tracking - Restricting Triggers


#21

You bet!


#22

The piston still isnā€™t working, and after further research, I realize itā€™s because the 3-axis numbers are not consistent. Long story short, I think I may be able to make it work using something similar to what you suggested, @WCmore, but Iā€™m having a hard time figuring out how to store a list of values to a variable.

What I want to do is this:

  1. On events from the Multi-Purpose sensor, store all x-axis and z-axis values in a list. Any time the door opens, it should register around 10 values.
  2. Find the average, max, and min values of the x-axis and the z-axis of that ā€œbatchā€ of numbers for further use

Canā€™t find anything in the forumsā€¦


#23

SmartThings is not so great at capturing 10 events from a single device within 3 secondsā€¦
(I was thinking the first 4 swings at most - or outside the range of -150 and +150)

Perhaps more importantly, there is no guarantee that the device will only report the highest part of each swingā€¦


#24

Yes. Your high or low threshold should be much closer to zero than your highest swing


#25

Could you shed some light on how I get Webcore to store a list of sensor data into a variable?

For example:

IF
[door moves out of ā€œstaticā€ range]

THEN
[Capture all events that Webcore receives for the X-axis for the next 10 seconds?]

Thoughts?


#26

Really just looking for how youā€™d do thisā€¦


#27

Sorryā€¦ Walking out the door right nowā€¦ Be back in about 20 hours


#28

No prob. Thank you.


#30

I whipped up a quick piston to show these mathematical formulas at work:

(Note, this example has no negative numbers, so it made more sense to make the last line subtract, instead of add)


I am a bit backed up with clients at the moment, so I will let someone else chime in for the capturing question you had.


#31

Thanks. @WCmore. Anyone else able to weigh in on how I get the piston to store all x-axis readings during a brief period?

For example, it might read

IF door axis moves out of a range
THEN collect every x-axis reading that comes through for the next 5 seconds.

I understand, now, how to store a list of items to a variable, but I donā€™t know how to tell it to pull each unique values as they come in over time and append them to said listā€¦


#32

Triggers here in webCoRE will execute the same piston each and every time the event firesā€¦

Also, for what itā€™s worth, I would not use variable lists. For example, if a variable array has 8 data points, that variable does not want to change later to become 7 or 9 data points. I would stick with multiple individual variables, as seen in my example earlier.


#33

If the piston fires every time there is an event, wonā€™t it just keep overwriting the first variable each time? Or make each individual variable in the piston the same value?

Or does using the brackets like below:

contactsensor.axisx[1]
contactsensor.axisx[2]
contactsensor.axisx[3]

pull in subsequent readings? I figured the ā€œaxisxā€ value could return only one value at any given time, which is why I was thinking it had to be captured periodically.

Thank you for your help, and forgive me if Iā€™m missing something hereā€”Iā€™m still not quite clear on how to make this work.


#34

These are lists, or arrays, and I would avoid them unless the trigger count is identical each and every timeā€¦


Normally, yesā€¦ But there are likely workarounds if you use additional variablesā€¦

This piston is going to be a real pain in the butt to code though, because the piston will run from top to bottom at each and every trigger. (meaning you will need code to direct the path differently each event, and make sure the entire piston can run top to bottom in less than 0.3 seconds)

Unfortunately, you can expect a high level of frustration with coding & testing this ideaā€¦ While I do think it is possible, to be completely honest, it is not something that Iā€™d want to tackle ā€œoff the clockā€.

I hope you can understandā€¦


#35

To simplify a bit, you should only need to monitor one of the three axis points. Iā€™m not sure which one has the most extreme movement in your case, because it depends entirely on the position you installed the device.


#36

Absolutelyā€”thank you for your time and help thus far. Iā€™ll play around with it some more and see what I can come up with. Thank you.