Piston Trigger Behavior/Logic Not Executing As Expected


#1

1) Give a description of the problem
I’m using a piston for a motion sensor. When I only use a single argument in the “if” section, the piston performs the action in the “then” section without an issue. If I add an additional argument in the “if” section, it no longer triggers the action in the “then” section. I believe the logic I’m using is correct, but it’s not working for some reason, and I’m unsure why.

2) What is the expected behavior?
I would like to receive a PUSH alert if the motion sensor no longer detects motion for 45 seconds. I would like for the action in the "then" section to execute when I use two arguments in the "if" section.

3) What is happening/not happening?
When I use two arguments in the “if” section, the action in the “then” section doesn’t successfully execute.

4) Post a Green Snapshot of the piston

5) Attach any logs (From ST IDE and by turning logging level to Full)
(1/30/2019, 1:13:08 PM +361ms
+2ms ╔Received event [Dryer Sensor].motion = inactive with a delay of 927ms
+10188ms ║RunTime Analysis CS > 21ms > PS > 10121ms > PE > 46ms > CE
+10190ms ║Piston waited at a semaphore for 10058ms
+10192ms ║Runtime (37472 bytes) successfully initialized in 10121ms (v0.3.109.20181207) (10188ms)
+10193ms ║╔Execution stage started
+10204ms ║║Comparison (enum) inactive changes_to (string) inactive = false (1ms)
+10206ms ║║Cancelling condition #2’s schedules…
+10207ms ║║Condition #2 evaluated false (7ms)
+10209ms ║║Cancelling statement #1’s schedules…
+10210ms ║║Condition group #1 evaluated false (state did not change) (11ms)
+10213ms ║╚Execution stage complete. (21ms)
+10215ms ╚Event processed successfully (10215ms)
1/30/2019, 1:13:08 PM +352ms
+2ms ╔Received event [Dryer Sensor].motion = inactive with a delay of 868ms
+122ms ║RunTime Analysis CS > 25ms > PS > 55ms > PE > 41ms > CE
+124ms ║Runtime (37391 bytes) successfully initialized in 55ms (v0.3.109.20181207) (121ms)
+125ms ║╔Execution stage started
+137ms ║║Comparison (enum) inactive changes_to (string) inactive = true (1ms)
+139ms ║║Cancelling condition #2’s schedules…
+140ms ║║Condition #2 evaluated true (7ms)
+141ms ║║Cancelling statement #1’s schedules…
+142ms ║║Condition group #1 made progress up the ladder, currently at step 1 of 2
+149ms ║║Fast executing schedules, waiting for 996ms to sync up
+1154ms ║║Conditional ladder step failed due to a timeout
+1155ms ║║Cancelling statement #1’s schedules…
+1157ms ║║Condition group #1 evaluated false (state did not change) (5ms)
+1159ms ║╚Execution stage complete. (1034ms)
+1160ms ╚Event processed successfully (1160ms)
1/30/2019, 1:12:04 PM +868ms
+1ms ╔Received event [Dryer Sensor].motion = active with a delay of 894ms
+84ms ║RunTime Analysis CS > 23ms > PS > 31ms > PE > 29ms > CE
+86ms ║Runtime (37390 bytes) successfully initialized in 31ms (v0.3.109.20181207) (84ms)
+88ms ║╔Execution stage started
+98ms ║║Comparison (enum) active changes_to (string) inactive = false (1ms)
+100ms ║║Condition #2 evaluated false (5ms)
+101ms ║║Cancelling statement #1’s schedules…
+102ms ║║Condition group #1 evaluated false (state did not change) (9ms)
+104ms ║╚Execution stage complete. (17ms)
+106ms ╚Event processed successfully (106ms)
)


#2

Hi @sna93
Try, deleting line #19
and line 20 is also a trigger.
use, IS INACTIVE istead of STAYS inactive.One is a trigger the other one is a condition.

And here is a great article about the difference:


#3

I would combine these 3 lines:

temp

Into one:

IF Motion Sensor 1's motion stays inactive for 45 seconds

(This will fire about 50 seconds after the room is cleared.)


On a side note, I am curious as to how a motion sensor can detect when the dryer cycle is complete


#4

Probably, either sensor is placed in front of the dryer (seeing the rotation??) or it’s a multi sensor with vibration but if so, code has to be different…


#5

Hi WCmore and ike2018. Thank you both for your suggestions. I’m going to dig into the differences on conditions and triggers and give your suggestions a shot.

In relation to your inquiry about the sensor and how I’m using it, I’m using an “Ecolink Z-Wave Plus PIR Pet Immune Motion Sensor” which I’ve mounted on the inside of the dryer case at a 45 degree angle in the corner and detects when the dryer tub is moving and when it’s not. I checked the temperature inside the dryer case prior to mounting this sensor, and it never exceeded the sensor’s operating temperature range. This sensor has 3 motion sensitivity modes (most sensitivity, less sensitivity, test sensitivity mode). The non-test modes send a Z-wave signal as soon as motion is detected but don’t send a “no-motion” signal until 4 minutes after there is no motion. The test mode sends a signal almost immediately when no motion is detected. Since I want to know sooner than 4 minutes after a drying cycle has ended, I’m using this sensor on “test” mode. Unfortunately when using “test” mode, this sensor picks up no motion “false alerts”, so I have to make sure that the sensor detects “no motion” consistently for 45 seconds and then triggers an alert so that I can ensure that the dryer has actually completed its drying cycle. Let me know if you have any other questions regarding this. I’ll re-post as soon as I’ve tested out your suggestions and I have success (or need more help).

Thanks!


#6

I always try my best to help people in a way they want to be helped…
In rare cases i suggest things that they are not asking:))))
I am going to go ahead and recommend that you should get a sensor with vibration detection built in and put that on the outside of dryer.
I am highly sceptical about the temperature you will be using this sensor. lifespan of your sensor plus lithium batteries and heat combination.

other than that let us know what ever you need for the piston…:)))))


#7

just did a quick research

  • “lithium can ignite in contact with humid air.” That means the cathode can catch fire: the metal oxide’s grid structures can dissolve when overheated, releasing oxygen. The burning lithium is a metal fire.

#8

One small addition:
In “test mode”, you will go thru batteries more than 500% faster than in normal mode. (It’s often much worse)

A vibration sensor (installed on the outside) would be my preferred path as well. Something like this monitors both vibration and temperature. (as well open/close and orientation, but those two aren’t needed for your current project)