Sorry If this sounds stupid. To put it simply, I have multiple Boolean Global variables in Webcore that function well. I have also setup some Virtual switch toggles that sync with the variable to show me the status of the variable in my Smarthings app and allow me to manually toggle.
However, I have noticed there appears to be a lag in the update of a global variable.
For Example: I have a @EnableMotionSensor Boolean Variable that before I run a routine which the lights might trigger a motion sensor I turn the @EnableMotionSensor = False. it sometimes it doesn’t seem to work so perfectly. Additionally, It My Variable/virtual switch Sync is not the most efficient. Although it works as expected, It may be running twice.
then It dawned on me, I could get rid of the Global Variable and my Virtual switch syncing pistons and just use the Virtual switch as my Global variable. This would allow me to still See and toggle my variables within the smartthings app and the switches would work as the global variable.
Would anyone advise against this? Would the Lag be greater using the Switch as my variable?
Global variable seem to be a sore point. I found concurrency with setting globals can “override” globals that are set from other pistons. I had to re-write all my room automation using locals as rontalley outlined. Also where I do need a “global” I now use a virtual switch for binary indicators.