First Piston Help


#1

1) Give a description of the problem
I’m not seeing any results from my piston. I can see it is getting activated, so I’m thinking I either failed somewhere in my IF Statement or I still have some element that should be swapped for something of a similar name.

2) What is the expected behavior?
If Home. When the door is unlocked, Turn on a switch and blink the under cabinet lights red. Wait 3 seconds and turn the switch off.
If Home. When the door is locked, Turn on a switch and blink the under cabinet lights green. Wait 3 seconds and turn the switch off.

3) What is happening/not happening?
Piston recognizes the lock changing from what I can tell and runs through the motions, but the lights do not respond. The switch is virtual so I’m not sure if it’s having trouble or not.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
11/7/2017, 10:07:47 PM +347ms +1ms ╔Received event [Abode].test = 1510114067343 with a delay of 4ms +105ms ║RunTime Analysis CS > 16ms > PS > 68ms > PE > 20ms > CE +113ms ║Runtime (39168 bytes) successfully initialized in 68ms (v0.2.0fb.20171026) (111ms) +114ms ║╔Execution stage started +123ms ║║Comparison (string) :851d2a3bd1eeee0b7d6e0a9b04f9ba05: is (string) :851d2a3bd1eeee0b7d6e0a9b04f9ba05: = true (1ms) +124ms ║║Condition #20 evaluated true (6ms) +125ms ║║Condition group #1 evaluated true (state did not change) (8ms) +134ms ║║Condition #11 evaluated false (7ms) +135ms ║║Condition group #2 evaluated false (state did not change) (8ms) +141ms ║║Condition #19 evaluated false (5ms) +142ms ║║Condition group #3 evaluated false (state did not change) (5ms) +144ms ║╚Execution stage complete. (30ms) +150ms ╚Event processed successfully (150ms)


#2

Looks like you used Test to generate the trace, you would need to test by changing Lock 1’s status (i.e. locking or unlocking). Also here’s a suggestion for logic to restrict to Home mode:

only when location mode is Home
If Lock 1s lock changes to locked
else if Lock 1s lock changes to unlocked

If you are unfamiliar with restrictions, look at the control buttons at the top of your edit screen and chose the button below:
image

You’ll see what to do from there. This is just a suggestion and unnecessary, but if your just starting out its something to learn. :slight_smile:


#3

I tried both manually and via the app to lock and unlock but I didn’t get any where. I’ll try the restriction thing out when it get home.


#4

So I decided to start over and start small. Still not seeing results though.

11/13/2017, 11:13:14 PM +779ms
+5ms	╔Starting piston... (v0.2.0fb.20171026)
+440ms	║╔Subscribing to devices...
+517ms	║║Subscribing to Front Door Lock.lock...
+627ms	║║Subscribing to Kitchen UnderCabinet...
+628ms	║╚Finished subscribing (194ms)
+685ms	║Comparison (string) :2695277c52b0480d6b951196a0057318: is_not (string) :e4b8b3f08053c60731285f913a743e5f: = true (9ms)
+690ms	║Cancelling condition #5's schedules...
+703ms	║Cancelling condition #1's schedules...
+750ms	╚Piston successfully started (747ms)
11/13/2017, 10:50:04 PM +251ms
+6ms	╔Starting piston... (v0.2.0fb.20171026)
+264ms	║╔Subscribing to devices...
+349ms	║║Subscribing to Front Door Lock.lock...
+436ms	║║Subscribing to Kill CD...
+437ms	║║Subscribing to Kitchen UnderCabinet...
+438ms	║╚Finished subscribing (179ms)
+492ms	║Comparison (string) :851d2a3bd1eeee0b7d6e0a9b04f9ba05: is (string) :851d2a3bd1eeee0b7d6e0a9b04f9ba05: = true (7ms)
+497ms	║Cancelling condition #2's schedules...
+512ms	║Cancelling condition #2's schedules...
+571ms	╚Piston successfully started (567ms)

#5

You have locked the door (from unlocked) while mode is not away and you see nothing in the log but what’s pasted?

Here’s what the trace should look like when you lock the door:

You can see by the bands that the piston executed, the green band shows the lock changed to “locked” became true.

Here’s the associated log, you can see the piston ran when the subscribed device changed, then the condition evaluated to true. You would get a similar result if the door were unlocked, the piston will run but of course the if evaluates to false. From what you’ve shared so far your piston is not executing.

+1ms ╔Received event [Front Door Lock].lock = locked with a delay of 66ms
+96ms ║RunTime Analysis CS > 15ms > PS > 69ms > PE > 12ms > CE
+104ms ║Runtime (38482 bytes) successfully initialized in 69ms (v0.2.0fe.20171109) (102ms)
+105ms ║╔Execution stage started
+116ms ║║Comparison (string) :fb0dbcd737c0675d5ab8d9eed2d0b78f: is_not (string) :082450da3c7a68b2d3dddc70cb47748c: = true (2ms)
+118ms ║║Condition #5 evaluated true (6ms)
+119ms ║║Cancelling condition #1’s schedules…
+120ms ║║Condition group #1 evaluated true (state changed) (8ms)
+126ms ║║Comparison (enum) locked changes_to (string) locked = true (1ms)
+127ms ║║Cancelling condition #4’s schedules…
+128ms ║║Condition #4 evaluated true (7ms)
+129ms ║║Condition group #1 evaluated true (state did not change) (8ms)
+132ms ║║Cancelling statement #2’s schedules…
+154ms ║║Executed physical command [Indoor Switch 1].on() (19ms)
+155ms ║║Executed [Indoor Switch 1].on (21ms)
+158ms ║╚Execution stage complete. (53ms)
+165ms ╚Event processed successfully (165ms)