Set Variable to true


#1

1) Give a description of the problem
I am attempting to write a piston to warn us when Smoke or CO2 is detected with our Zwave smoke/co2 detectors. I have am example piston but I am having a hard time trying to figure out how do I set a variable in the piston. In the example the code is in a when true block. But for the life of me I cannot figure out how to get the following statement in the piston, x2 Set variable {@smokeAlarms} = true

2) What is the expected behavior?
(PUT YOUR INFO HERE)

3) What is happening/not happening?
(PUT YOUR INFO HERE)

4) Post a Green Snapshot of the pistonimage
(UPLOAD YOUR IMAGE HERE)

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

By trial and error I actually figured it out…


#3

How did you do it? I can’t figure it out.


#4

Add an action. Choose any device (or leave it as location if you’re not physically changing any devices)… choose add task, then scroll down to “set variable”.


#5

That part confused me for a while. I assumed Location was the Home/Away/Night state, but it seems to be basically anything that isn’t for a specific device. Piston state, variables, logging, sending notifications, etc. are all there.


#6

I did the same thing for a long time… it’s basically a “no specific device” selection.


#7

Ah ha, there it is! Thanks, all.