Is it possible to clear a device variable?
Or to set the device variable to initial on every piston start
Clear a device variable or set initial
Just set variable to “” at the start of the piston run… allongside your wait 2 minutes.
Your piston will never allow more than one device to be listed in your ‘problemList’ though, as each run of the ‘for each’ statement that finds a problem, will overwrite the last.
You’d be better off using the ‘save matching devices to variable’ function, which can be found within the IF statement by clicking on the cog symbol.
thanks
do i need the “Just set variable to “” at the start of the piston run” for the updated piston?
I don’t think so… if there are no matching devices to save to the variable, I think it clears the variable automatically.
ok perfect.
is it possible to check the entries in the device list - problem list?
at the moment, i got the push notification with "empty list macht Probleme!"
so i going to create an if statement.
“if problem_list is empty” - do nothing
You should already have that check on lines 52 and 55… if either of those statements are true then the list should be populated and the message sent.
If both are false, lists will be empty and the THEN will not fire, so no message.
If one statement is true and the other false, then one lost will be empty the other populated, and message will be sent (assume that is what you are seeing?)
i have some problems with the fibaro switches. so i need a double security check.
if i turn on the switch and then turn it off, again. then often it works.
so i have updated the code and also the point with the two lists an the output.
is it correct so?
What exactly is the problem with the Fibaro switches?
They are usually very very reliable… I have zero issues with mine…
What handler are you using?
Fibaro Wall Plug ZW5
(name: “Fibaro Wall Plug ZW5 ST”, namespace: “ClassicGOD”, author: “Artur Draga”)
Fibaro Wall Plug
name: “Fibaro Wall Plug ST”, namespace: “cscheiene”, author: “SmartThings,gpsmith,cscheiene”)
Fibaro FGS-222 Double Relay Switch
(name: “Fibaro FGS-222 Double Relay Switch”, namespace: “smartthings”, author: “Robin”) {
Fibaro Double Switch 2 FGS-223
(name: “Fibaro Double Switch 2 FGS-223”, namespace: “erocm123”, author: “Eric Maycock”) {
Looks ok… but you’ll still need to test it.
There really is no right or wrong way with webCoRE… If it works it’s good.
So are you having issues with all of those Fibaro devices?
What exact issues are you having?
Every 3 -4 days, a device didn´t siwtch off after the routine "good night"
i dont know why.
that is why i created the “security check piston”
do you have a idea to resolve the problem otherwise?
are my device handler ok?
Is it one of those devices in particular or have all of them had problems at some point?
It’s no uncommon for ST to miss commands if you are trying to turn off a lot of things at the same time (maybe 20+)
Try this:
Nice, I’m gonna use this one. Only thing that seems to be missing, is a counter reset.
I set up my lights and switches into global variables a while ago while testing another piston, and never got back to using the variables. This works nicely with that.
Thanks!
A post was split to a new topic: How to stop additional ‘IF’ blocks running with the rest of the piston?