Normally, events will only arrive to CoRE if stateChanged is true. There is no initial global variables - those are user variables you define yourself. There is a list of system variables, find it in any piston, under Local Variables - or in the dashboard. In order to do what you want, a THEN IF piston is probably best, where the main IF triggers the action, whereas the secondary IF builds the message and performs the actions - enable expert mode and use when true/when false actions to add text to the message and do actions as you go along.
IF
Mode changes
THEN IF
Door is locked
> when true, using location, set doorMessage = 'door was already locked'
> when false, using door, lock, set doorMessage = 'locking the door now'
AND
Light is on
> when true, using light, turn off, set lightMessage = 'turning off the light'
> when false, using location, set lightMessage = 'light was already off'
etc...
AND
Time is any time of the day <<< DUMMY condition to allow for the final message assembly and delivery
Using location...
> Set message = doorMessage + lightMessage + ...
> Send notification '{message}'
@ady624, I think expert mode is exactly what I’m looking for. To clarify, doorMessage and lightMessage, in this case, are variables that I will then call at the end of the piston to give me one cohesive message?
[EDIT] Looks like you just added that in the code! I am so pumped right now. Thank you so much! Finally, this may add stability to what I’m using. You’re awesome man, thanks so much!
Great advice on this. I am now using CoRE to perform all the actions on Routine execution.
Thanks,
1 Like
bamarayne
(Jason "The Enabler" as deemed so by @Smart)
46
Feel free to post your postings for others to see, especially the ones with the messages. I’d like to see how you made it work… And I’ll put it on the wiki.
I have a slight variation. I have a routine trigger piston that watches all the routines and calls a specific piston when a specific routine is executed. However you build it, the results are the same.
You take all responsibility away from SmartThing’s Routines because they are an abject failure and ST hasn’t demonstrated meaningful effort to fix them.