First piston help (doesn't do anything)


#1

So I’m trying to get tamper working on my new window sensors. I already hacked together a very crude custom device handler that reports the tamper, now I’m attempting my first piston to act when it sees a tamper. Here’s what I have:

It’s really simple right now, but it also doesn’t seem to do anything :yum:

When I pull the cover off the sensor I can see the tamper on the device in the smartthings app. The piston dashboard “Last executed” shows it ran when I pulled the cover, but I don’t hear a chime on my alarm and we don’t get notifications on either of our phones. Did I miss a configuration step somewhere or make a mistake in the piston?


(jkp) #2

post your piston logs :slight_smile:


(Keith Croshaw) #3

Huh, I don’t have a ton of experience with media devices in ST but there’s an entire community for webcore. Maybe a little more active than this one at this point. :stuck_out_tongue_winking_eye:


#4

Well I should have thought of looking at logs.

4/20/2018, 7:58:57 PM +942ms
+1ms	╔Received event [Downstairs Window 1].tamper = tampered with a delay of 881ms
+65ms	║RunTime Analysis CS > 16ms > PS > 36ms > PE > 14ms > CE
+67ms	║Runtime (37024 bytes) successfully initialized in 36ms (v0.3.104.20180323) (65ms)
+68ms	║╔Execution stage started
+76ms	║║Comparison (enum) tampered changes_away_from (string) clear = false (0ms)
+77ms	║║Condition #7 evaluated false (4ms)
+78ms	║║Condition group #1 evaluated false (state did not change) (6ms)
+80ms	║╚Execution stage complete. (11ms)
+81ms	╚Event processed successfully (80ms)

So am i understanding that the script only executes once tamper = tampered already so the “changes away from” fails because it’s already changed when the script starts?

The problem with the tamper is it doesn’t reset by itself (only a cover off event, no cover on event). So I choose “changes away from” so that it wouldn’t repeatedly fire the script before I could deal with the tamper and clear it. Is there a different way I should be going about it?


(Don) #5

I’m no expert, can you use changes to vice changes away from?
Or just select is cover off?

Wouldn’t it just trigger and run once even if you choose cover off state.


#6

Uggh ok I think I might see the problem. The webcore only gives me drop down options of “clear” and “detected” for tamper values. My custom device handler uses “tampered” and “secure” as the values. So I guess i’m never changing away from “clear” since that’s never a valid value for my device. I’ll correct that and see what happens.


#7

I’m not sure how this forum work quite yet, so my last post might have replied to just myself :roll_eyes:

I changed the device handler to use clear and detected and also changed the piston to “if tamper changes to detected” and it worked flawlessly. I didn’t get any repeat messages either, I suppose since the piston won’t execute again until there’s a state change on tamper.

So I think I have it now, unless further testing finds another hickup. Thanks for the help guys!