How do I setup an IF statement based on sent command

conditions
lock

#1

Does anyone know how to setup and IF statement if a command is sent? Here is what I’m trying to do: If my door locks are sent a lock command I want to check and see if they are actually locked.


#2

I have a very similar setup actually…
What you can so is, assigning a variable with the command sent…
When that variable changes to new value you can trigger an IF event…

IF switch 1 changes to ON
then
Do with 
  Lock the door
    Set variable status {@doorlock} = TRUE 

IF {@doorlock} changes to TRUE
AND
IF Door Lock status is NOT LOCKED (or Unknown)
With 
Door Lock, Lock the door
Send SMS etc
Do this do that
Set variable @doorlock = FALSE

#3

Thanks I would like to do that, but I’ve run into a few issues with that. If it doesn’t lock then it doesn’t change to ON (or Locked). So the entire “changes to” option doesn’t work.


#4

Yes your are right…
That is why you don’t relly on the command you send but you relly on the variable that changes…
“Switch one” changes to ON was not meant for the lock in my example code, that is however you are locking the door…
How are you locking the door? I can change that line accordingly…


#5

Hmmm…sorry I’m not fully understanding where you set the variable. That might be because all my locks lock/unlock via routines and the smart lock app. Guess if I move them to WebCore then I use a variable inside those pistons.


#6

Yes…
And I would HIGLY recommend NOT using ST app automations and Webcore at the same time. Not only for locks but for anything. Even for a very simple automations I use webcore alone.
Because
A) Webcore can’t read what is happening with ST app automations. You have to find a way to let webcore piston know what is going on.
B) After a while you can forget about on automation and try doing something with webcore and things go crazy. I remember spending 3 days on light lights that were turning ON for no reason??? AND i rememberred they were on a ST app automation:)))))