Basic WebCoRE piston false


#1

1) Give a description of the problem
Brand new to smartthings and webCoRE. There is a more complex piston I wanting to make, but I wanted to start off with a very simple one. I keep getting “false” as my piston state though.

2) What is the expected behaviour?
Devices: Zen34 Switch and Zen17 relay. With this piston, I’m simply trying to make it that when the zen34 button is pressed, the zen17 relay is closed (on) and then opens (off) after 1 second.

3) What is happening/not happening?
Nothing happens. Piston State is False

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach logs after turning logging level to Full
7/13/2022, 11:49:45 AM +623ms
+1ms ╔Received event [Master HW remote].button = up with a delay of 44ms
+38ms ║RunTime Analysis CS > 14ms > PS > 5ms > PE > 19ms > CE
+41ms ║Runtime (36348 bytes) successfully initialized in 5ms (v0.3.114.20220203) (38ms)
+42ms ║╔Execution stage started
+51ms ║║Comparison (enum) up gets (string) pushed = false (1ms)
+53ms ║║Condition #2 evaluated false (5ms)
+54ms ║║Condition group #1 evaluated false (state did not change) (7ms)
+56ms ║╚Execution stage complete. (14ms)
+58ms ╚Event processed successfully (58ms)


#2

The above is what stands out to me. I am not familiar with that device but it looks like the driver is sending up instead of pushed like you’re expecting.


#3

I never found a use for the default ‘piston state’ of true or false. I believe it just represents the value of the last condition evaluated when the piston executed. I wouldn’t get hung up on that.

@eibyer has pointed out the problem but I think it is worth expanding on.

When working with webCoRE and SmartThings, you are really working with SmartThings as it was a few years ago. Back then the button capability had a single button attribute that could only have the values pushed or held. In order to handle other possibilities like double or triple pushes a de facto standard evolved where a buttonNumber was added to the event data. So a triple push might be represented by the pushed event on button number 7, say.

That convention is still supported in the latest drivers but not used so much. Now there are about twenty or so possible values for button events. You have encountered one. Your button is generating an up event but you are testing for a pushed event.

Although webCoRE doesn’t know about all the current values, it is flexible enough to adapt. Instead of selecting a predefined value to compare the button press to, you can select an expression and type in up as a string. You’ll figure out what quotes you need.


#4

Thank you! I was able to change it to expression with “up” as my condition in the expression. I won’t have a chance to test this until tomorrow morning when I’m back home. I’ll report back!


#5

Yall are the best! This was my hold up. The “up” was the key. Or if I wanted a double press of the up button, I needed “up_2x”.

The little steering you did here was the exact nudge I needed with how to look at the log file and see what was going on!

Appreciate your help!!!