Timing of storage into a variable

@josh, I have several Leviton outlets. I get the $context.event.deviceName and store it to a variable named $CottageOutlet, and its status $context.event.value goes into a variable called $CottageOutletStatus. I have a rule that triggers if an outlet goes offline. Does each time the rule executes have its own instance of the variables? This post would seem to indicate otherwise.

The reason I ask is I was wondering whether a variable would get overwritten by a second triggering of the rule within 100’s of milliseconds of the first triggering?

Thanks.

The variables are global as the other post indicates.

And yes, the last write into the variable wins even if it’s only a few hundred milliseconds later.

1 Like