Piston not working!


#1

I am trying to use 2 motion sensor to detect direction of travel.
and I created a simple piston.
but the upper part in blue works fine.
but the lower part in yellow never worked, never get executed!
can someone please help?
thank you so much.


#2

Try that without ELSE,
create as a second IF BLOCK


#3

ok, I got most of it to work.

Motion 1 and 7 is IN direction.
Motion 2 and 8 is out direction.

if IN and OUT motion is triggered within 30 seconds, it worked perfectly. on both direction.

but if only one motion is triggered, eg IN is triggered and stay triggered, and 30 seconds later, without any other motion triggered, it will execute the IN direction, vice versa.

so I think is the follow by problem,
please help
thanks.


#4

As already mentioned by @ike2018, you should create separate IF blocks. In your last posted image, everything after the else should be moved into its own IF block and do not use the else statement.


#5

I think I got it working!! :slight_smile: thank you


#6

No, it is still not working!
but I got half fixed!
the IN sensor 1 and 7 now works, even if only IN sensor active for 30 seconds it will not trigger, which is good.

but the OUT Motion Sensor 2 and 8 will still trigger the event “someone left” after only !2and 8 stays active for 30 seconds!

any idea? thanks


#8

You may want to consider breaking your actions into different action blocks, i.e.

With
Music player
Do
Speak blah blah blah and resume
End do
End with

With
Location <— if you choose location, you don’t need to select a device
Do
Send sms Notification blah blah blah
End do
End with

With
Light bulb
Do
Turn on
Wait 2 minutes
Turn off
End do
End with


#9

I almost gives up!!
I made 2 identical Pistons, the only different is that I flipped the motion sensors
one for arrival, one for leaving.

first piston “Motion Driveway someone left”
motion 8 changed to active,
followed strictly by
Motion 7 changed to active
execute SMS “Someone left”

Second Piston “Motion Driveway Someone Arrived”
Motion 7 changed to Active
followed Strictly by
Motion 8 changed to active
Execute SMS “Someone Arrived”

they are identical,
if motion 8 changed to active, and stay active for 15 seconds. motion 7 not active and unchanged
nothing happened, which is good.

but for motion 7 changed to active and stay active for 15 seconds, and motion 8 not active and unchanged,
SMS “Someone arrived” was executed!!!

I have no idea why?
and they are identical pistons!!
please help.


Direction of travel
#10

both of the sensors are virtual motion sensors for testing.


#11

It would help us if you give us logs of EACH piston in action. Thanks.


#12

Logs

Motion Driveway Someone Left Piston (which has no problem)


Motion Driveway Someone Arrived Piston ( HAVE PROBLEM!!)



#13

Log%201
I do not know what this means.


#14

I also do not know anything about it!
I am just troubled about why these 2 pistons react differently!


#15

1 - Are they same brand motion sensors?
2 - What is the time frame that motion sensor keeps registering active in ST APP?


#16
  1. they are both virtual motion sensors that I created for testing.

  2. these 2 pistons are for testing, I made a working piston to register motions from 2 motion sensors to distinguish the direction of travel, everything is working fine. if motions were triggered within the 15 seconds.(followed by 15 seconds),
    eg. if out motion sensor triggered then followed by within 15 seconds the IN motion sensored triggered, sent SMS “someone arrives”

BUT THE PROBLEM is that if OUT motion triggered, and stay triggered without IN triggered, it still sent the SMS. and not the way around!!!
I spend a lot of time try to look for the problem.
and finally I just made these 2 simple pistons to test, and found out this strange problem!!

the working piston is above message 5


#17

Can you do me a favor? create 2 virtual motion sensors, and use the same 2 simple pistons.

if you trigger the 2 virtual sensor one by one, it should do the SMS.
but if you just trigger one of the sensor and wait for the 15 seconds, one will not do anything, and the other one will still sent the SMS.
please tell me if you can duplicate the problem?
or if it just on my system??
thank you so much.


#18

OR if there is better way to distinguish the direction of travel?

I see another post using variables.

but I just don’t know how to create it, I have no programming background! :slight_smile:


#19

If I were you, I wouldn’t test this with virtual sensors.
IMO this one is better tested in a real life situation.


#20

I have tested with real sensor, everytime when someone left, it will follow by Someone Arrived!.
I spent a lot of time trying to figure it out, so I use virtual sensor to do that.
and finally I found the problem.
and it is really a strange one!.


#21

anyone can help?
thank you