2 Pistons potentially conflicting? Need help


#1

Hey guys, new on WebCore but seems very straightforward and I’m doing quite well with it actually. For reference with this post, I have a Schlage lock that is connected to ST & Google Home, now google home won’t allow for me to lock/unlock it via command so I created a virtual switch to send on/off commands to which then uses webcore to send the lock/unlock the actual switch… so that’s Piston 1. My 2nd piston is supposed to monitor the door every minute and if it’s unlocked, it will lock it automatically and notify me. The problem is that for some reason the two pistons are conflicting with one another and I get erratic behavior from the door sometimes. I will unlock the door and sometimes it will just lock and unlock back and forth non-stop… So i’m trying to figure out why it’s happening and solve. Below are piston codes for each behavior. Maybe you guys can help?


#2

It is easy to mirror Device A to match Device B… or to mirror Device B to match Device A… But a royal pain to try to do both simultaneously.


#3

Maybe I’m miss ing something BUT it looks like your piston is doing exactly what the code says. i’d be surprised if sometimes it’s working properly??? (i’m also fairly new FYI:)))

i strongly believe ELSE part of your coding is messing things up.
Try writing this WITHOUT using ELSE.

I have to go now but let me know if you need me to come up with something (I can try)


#4

Just a quick look…but I know that ELSE statements can be problematic at times. Also, I would make my piston triggers a little different…

IF switch 1 CHANGES TO On
THEN
Lock

IF switch 1 CHANGES TO Off
THEN
Unlock

And the same with the rest of your first piston. Just my two cents. Your mileage may vary…


#5

Thanks for this. I’ve removed all the else statements and converted to only IF statements… I guess we will see how it performs.