Piston run once per day


#1

1) Give a description of the problem
I researched many posts about this and thought I did it right but the piston does not turn the light on

2) What is the expected behaviour?
Once per day, between 6 and 11, if motion is detected, turn on the light

3) What is happening/not happening?
Looking at the log it appears that it starts to run but the light does not turn on.

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

5) Attach logs after turning logging level to Full


#2

Looks like it is showing false for the changes to condition which it shouldn’t. I was getting caught by a similar situation last week with a short piston. Try adding a wait at the end of your piston to be sure it completes properly. If that doesn’t work, you could try turning the only when conditions to a nested if statement.


#3

The piston has received a motion active event but the ‘changes to active’ trigger requires it have previously seen a motion inactive event in order to recognise it as having changed. Does your motion sensor device handler send inactive events?

If it doesn’t you can use ‘is active’ which has the side effect of also running the piston at your between times (which is often handy anyway).

Actually looking closer at the logs, it looks like the state has changed which suggests the device handler may well send inactive events but also sends consecutive active events instead of just changes. Some handlers do that.


#4

To elaborate a bit to what @orangebucket said:

  • Clear your log
  • Leave the room for five minutes
  • Walk past the motion sensor
  • Re-post the new logs. (in it’s entirety please. We want to see the inactive trigger as well)

I suspect the light will work this time. (if the time is true, and the day is different)


#5

Yes, it does. It’s a monoprice 4-in-1. It switches to inactive after 2 minutes. I use the DTH created by @RBoy . Looking at the sensor event log, it always shows an inactive event before it reactivates.

I will do this tonight and repost the logs tomorrow.

Thank you everybody for your input. This piston seems too simple to have issues.


#6

@orangebucket Where did you see the consecutive active events in the log?

Just trying to understand so I can figure it out myself next time.
TIA


#7

What I was noting was that the +160ms and +161ms lines showed the ‘changes to active’ trigger condition returning false. As the event being processed is a motion active event, that suggests the piston thinks the motion was already active. However at +162ms and +163ms the condition group is marked as ‘(state changed)’ , suggesting that the previous time the condition was evaluated it was true, suggesting that an ‘inactive’ to ‘active’ change had been received on that occasion.

However I have just noticed that lines +155ms and +156ms are also talking about #1 being evaluated which means I perhaps don’t understand what is going on when a restriction is also in place.


#8

@orangebucket , thanks for the insight. It does help me understand more about what is happening. I had the “Never Cancel” condition on the “when” statement hoping that if the sensor was evaluated as false before the light switched on, it would still activate. It obviously didn’t do what I expected.


#9

@WCmore , here is the log you requested:

    4/7/2020, 7:05:10 AM +674ms
+1ms	╔Received event [Stairwell 4 in 1 Sensor 1].motion = active with a delay of 95ms
+115ms	║RunTime Analysis CS > 17ms > PS > 67ms > PE > 31ms > CE
+117ms	║Runtime (38540 bytes) successfully initialized in 67ms (v0.3.110.20191009) (115ms)
+118ms	║╔Execution stage started
+126ms	║║Comparison (integer) 7 is_different_than (integer) 6 = true (1ms)
+127ms	║║Condition #7 evaluated true (5ms)
+136ms	║║Comparison (time) 25510802 is_between (time) 21600000 .. (time) 39540000 = true (7ms)
+137ms	║║Time restriction check passed
+138ms	║║Condition #8 evaluated true (10ms)
+139ms	║║Cancelling condition #1's schedules...
+140ms	║║Condition group #1 evaluated true (state changed) (18ms)
+144ms	║║Comparison (enum) active changes_to (string) active = true (0ms)
+146ms	║║Cancelling condition #6's schedules...
+147ms	║║Condition #6 evaluated true (6ms)
+148ms	║║Condition group #1 evaluated true (state did not change) (7ms)
+150ms	║║Cancelling statement #2's schedules...
+336ms	║║Executed physical command [Kitchen Pendants].on() (183ms)
+337ms	║║Executed [Kitchen Pendants].on (184ms)
+361ms	║║Executed physical command [Kitchen Pendants].setLevel([70]) (19ms)
+362ms	║║Executed virtual command [Kitchen Pendants].adjustLevel (23ms)
+364ms	║║Cancelling statement #4's schedules...
+370ms	║║Executed virtual command setVariable (3ms)
+373ms	║╚Execution stage complete. (254ms)
+374ms	╚Event processed successfully (373ms)
4/7/2020, 7:04:45 AM +790ms
+2ms	╔Received event [Stairwell 4 in 1 Sensor 1].motion = inactive with a delay of 103ms
+114ms	║RunTime Analysis CS > 22ms > PS > 60ms > PE > 31ms > CE
+116ms	║Runtime (38541 bytes) successfully initialized in 60ms (v0.3.110.20191009) (114ms)
+117ms	║╔Execution stage started
+124ms	║║Comparison (integer) 7 is_different_than (integer) 6 = true (1ms)
+126ms	║║Condition #7 evaluated true (4ms)
+134ms	║║Comparison (time) 25485916 is_between (time) 21600000 .. (time) 39540000 = true (6ms)
+135ms	║║Time restriction check passed
+137ms	║║Condition #8 evaluated true (11ms)
+138ms	║║Cancelling condition #1's schedules...
+138ms	║║Condition group #1 evaluated true (state changed) (18ms)
+142ms	║║Comparison (enum) inactive changes_to (string) active = false (1ms)
+143ms	║║Condition #6 evaluated false (4ms)
+144ms	║║Cancelling condition #1's schedules...
+145ms	║║Condition group #1 evaluated false (state changed) (6ms)
+146ms	║╚Execution stage complete. (29ms)
+147ms	╚Event processed successfully (147ms)
4/7/2020, 7:02:24 AM +519ms
+1ms	╔Received event [Stairwell 4 in 1 Sensor 1].motion = active with a delay of 109ms
+95ms	║RunTime Analysis CS > 17ms > PS > 47ms > PE > 31ms > CE
+97ms	║Runtime (38535 bytes) successfully initialized in 47ms (v0.3.110.20191009) (95ms)
+98ms	║╔Execution stage started
+105ms	║║Comparison (integer) 7 is_different_than (integer) 6 = true (1ms)
+106ms	║║Cancelling condition #7's schedules...
+107ms	║║Condition #7 evaluated true (5ms)
+116ms	║║Comparison (time) 25344627 is_between (time) 21600000 .. (time) 39540000 = true (6ms)
+117ms	║║Time restriction check passed
+119ms	║║Condition #8 evaluated true (10ms)
+119ms	║║Cancelling condition #1's schedules...
+120ms	║║Condition group #1 evaluated true (state changed) (19ms)
+124ms	║║Comparison (enum) active changes_to (string) active = false (0ms)
+125ms	║║Cancelling condition #6's schedules...
+126ms	║║Condition #6 evaluated false (5ms)
+127ms	║║Cancelling condition #1's schedules...
+127ms	║║Condition group #1 evaluated false (state changed) (6ms)
+129ms	║╚Execution stage complete. (31ms)
+130ms	╚Event processed successfully (130ms)

#10

Glad it worked for you!


#11

@WCmore, It worked… But not immediately. I did as you instructed, triggered motion, left the room until sensor went inactive, then reentered and it worked (see logs). The struggle is how to make it work when first triggered.


#12

The log shows the command was sent 0.3 seconds after the motion changed to active.


I do not understand what you mean here.


#13

@WCmore, if you scroll the logs down (they’re in reverse order) you’ll see that the initial trigger did not execute the piston, same as the original post.


#14

I ignored that, because we need to see the inactive BEFORE the active.
(IE: if it doesn’t go inactive first, then the light will never come on)

║║Comparison (enum) active changes_to (string) active = false
║║Cancelling condition #6's schedules...
║║Condition #6 evaluated false

#15

The sensor WAS inactive first. I see it does not acknowledge in webCore that it was. However, in ST it is logged as inactive prior to the piston firing. How do we get it to acknowledge that it’s inactive before the piston runs?


#16

It looks like your DH may take up to 2.3 minutes AFTER the room is cleared before it sends the inactive trigger.


#17

This is true. I have it set to 2 minutes. But it was inactive from 11pm the night before until the logged time of 7:02 when it activated for the first time.


#18

Do you have the webCoRE log from 10:59pm yesterday up thru the 7:03am above?


This next bit may not apply to you, but I have a few sensors that are so sensitive, a cold blooded lizard strutting his stuff in front of it can trigger it…


#19

@WCmore I had an unusual day today which worked out well to gather the logs you asked for since I cleared the log from the day before. This set shows the sensor inactive just before 6am.

4/8/2020, 7:45:25 AM +806ms
+1ms ╔Received event [Stairwell 4 in 1 Sensor 1].motion = active with a delay of 106ms
+104ms ║RunTime Analysis CS > 15ms > PS > 35ms > PE > 54ms > CE
+107ms ║Runtime (38538 bytes) successfully initialized in 35ms (v0.3.110.20191009) (104ms)
+107ms ║╔Execution stage started
+115ms ║║Comparison (integer) 8 is_different_than (integer) 7 = true (1ms)
+116ms ║║Condition #7 evaluated true (5ms)
+126ms ║║Comparison (time) 27925923 is_between (time) 21600000 .. (time) 39540000 = true (7ms)
+127ms ║║Time restriction check passed
+129ms ║║Condition #8 evaluated true (12ms)
+130ms ║║Cancelling condition #1's schedules...
+131ms ║║Condition group #1 evaluated true (state changed) (20ms)
+135ms ║║Comparison (enum) active changes_to (string) active = true (1ms)
+137ms ║║Cancelling condition #6's schedules...
+138ms ║║Condition #6 evaluated true (5ms)
+139ms ║║Condition group #1 evaluated true (state did not change) (6ms)
+141ms ║║Cancelling statement #2's schedules...
+345ms ║║Executed physical command [Kitchen Pendants].on() (201ms)
+346ms ║║Executed [Kitchen Pendants].on (203ms)
+366ms ║║Executed physical command [Kitchen Pendants].setLevel([70]) (13ms)
+367ms ║║Executed virtual command [Kitchen Pendants].adjustLevel (17ms)
+369ms ║║Cancelling statement #4's schedules...
+374ms ║║Executed virtual command setVariable (2ms)
+376ms ║╚Execution stage complete. (269ms)
+377ms ╚Event processed successfully (377ms)
4/8/2020, 6:05:56 AM +66ms
+1ms ╔Received event [Stairwell 4 in 1 Sensor 1].motion = inactive with a delay of 98ms
+98ms ║RunTime Analysis CS > 16ms > PS > 35ms > PE > 47ms > CE
+100ms ║Runtime (38536 bytes) successfully initialized in 35ms (v0.3.110.20191009) (99ms)
+101ms ║╔Execution stage started
+109ms ║║Comparison (integer) 8 is_different_than (integer) 7 = true (2ms)
+110ms ║║Condition #7 evaluated true (5ms)
+120ms ║║Comparison (time) 21956177 is_between (time) 21600000 .. (time) 39540000 = true (7ms)
+121ms ║║Time restriction check passed
+123ms ║║Condition #8 evaluated true (12ms)
+124ms ║║Cancelling condition #1's schedules...
+125ms ║║Condition group #1 evaluated true (state changed) (20ms)
+129ms ║║Comparison (enum) inactive changes_to (string) active = false (1ms)
+130ms ║║Condition #6 evaluated false (4ms)
+131ms ║║Cancelling condition #1's schedules...
+132ms ║║Condition group #1 evaluated false (state changed) (6ms)
+134ms ║╚Execution stage complete. (33ms)
+135ms ╚Event processed successfully (135ms)
4/8/2020, 6:03:34 AM +683ms
+1ms ╔Received event [Stairwell 4 in 1 Sensor 1].motion = active with a delay of 126ms
+120ms ║RunTime Analysis CS > 19ms > PS > 53ms > PE > 47ms > CE
+122ms ║Runtime (38533 bytes) successfully initialized in 53ms (v0.3.110.20191009) (119ms)
+122ms ║╔Execution stage started
+129ms ║║Comparison (integer) 8 is_different_than (integer) 7 = true (1ms)
+131ms ║║Condition #7 evaluated true (4ms)
+139ms ║║Comparison (time) 21814815 is_between (time) 21600000 .. (time) 39540000 = true (6ms)
+140ms ║║Time restriction check passed
+142ms ║║Cancelling condition #8's schedules...
+143ms ║║Condition #8 evaluated true (11ms)
+143ms ║║Cancelling condition #1's schedules...
+144ms ║║Condition group #1 evaluated true (state changed) (18ms)
+148ms ║║Comparison (enum) active changes_to (string) active = false (0ms)
+149ms ║║Cancelling condition #6's schedules...
+150ms ║║Condition #6 evaluated false (4ms)
+151ms ║║Cancelling condition #1's schedules...
+151ms ║║Condition group #1 evaluated false (state changed) (6ms)
+153ms ║╚Execution stage complete. (31ms)
+154ms ╚Event processed successfully (154ms)
4/8/2020, 5:57:56 AM +439ms
+2ms ╔Received event [Stairwell 4 in 1 Sensor 1].motion = inactive with a delay of 114ms
+108ms ║RunTime Analysis CS > 16ms > PS > 44ms > PE > 48ms > CE
+110ms ║Runtime (38535 bytes) successfully initialized in 44ms (v0.3.110.20191009) (108ms)
+111ms ║╔Execution stage started
+118ms ║║Comparison (integer) 8 is_different_than (integer) 7 = true (2ms)
+119ms ║║Condition #7 evaluated true (5ms)
+128ms ║║Comparison (time) 21476559 is_between (time) 21600000 .. (time) 39540000 = false (6ms)
+129ms ║║Condition #8 evaluated false (9ms)
+130ms ║║Condition group #1 evaluated false (state did not change) (16ms)
+132ms ║╚Execution stage complete. (22ms)
+133ms ╚Event processed successfully (133ms)
4/8/2020, 5:55:35 AM +162ms
+1ms ╔Received event [Stairwell 4 in 1 Sensor 1].motion = active with a delay of 115ms
+108ms ║RunTime Analysis CS > 18ms > PS > 44ms > PE > 47ms > CE
+110ms ║Runtime (38533 bytes) successfully initialized in 44ms (v0.3.110.20191009) (108ms)
+111ms ║╔Execution stage started
+118ms ║║Comparison (integer) 8 is_different_than (integer) 7 = true (1ms)
+120ms ║║Condition #7 evaluated true (4ms)
+128ms ║║Comparison (time) 21335282 is_between (time) 21600000 .. (time) 39540000 = false (6ms)
+130ms ║║Condition #8 evaluated false (10ms)
+131ms ║║Condition group #1 evaluated false (state did not change) (17ms)
+132ms ║╚Execution stage complete. (21ms)
+133ms ╚Event processed successfully (133ms)

#20

Thanks… Just to clarify, are you still running piston “qi7w” from your first post above?

Or have you modified it since then? Please post a fresh snapshot if there are any changes.