I tried it with and without the subscription. I just took the screenshot after I tried it with but it still kept looping only the loop.
To answer the questions about why the loop, well,
It goes back to what I mentioned in my first post. I have been having some issues with pistons firing in WebCoRE. I agree, guxdudes idea of " set variable @Z_Locationmode = Location mode" is brilliant and should change the variable to directly reflect the current status of location mode. But, from all of my testing and going about my day to day life with these pistons running automationâs to make my life a bit easier, for some reason, sometimes, pistons just donât function as expected.
For instance, I have had problems with WebCoRE;
Skipping statements (Real Examples)
IF
Time between 8pm - 3:00am
&
Goodnight button is pushed
THEN
Set variable GoodnightRunning to True.
Set variable GoodnightBedroomLight to True.
Send PUSH notification - âGoodnightâ - Store in messages = True
Set SHM to Stay
Turn off (all devices incept bedroom light.)
Without any apparent reason setting GoodnightBedroomLight to True sometimes just skips completely. So I now have another piston that after GoodnightRunning changes to false, it checks to see if GoodnightBedroomLight is True and sets it if it isnât.
Sometimes Global variables just fail to set for me. In the below I have a local variable to reflect the change purely for fault finding, like this, and a global variable to reflect the change but itâs the one I actually need to change. You can see the 2 statuses are different, even though the triggers are the same.
Hence the timer loop, so after an hour I âknowâ that the variable will be changed to the correct value if this set variable failure happens again.
This incredibly simple piston that turns on the bedroom light on Bedroom motion, only when someone is not asleep will sometimes randomly turn on the Bedroom Light when the variable is True and no motion occurred according the smart-things. Also going into smart-things Bedroom Light activity it shows â@ Bedroom Motion Light Sent on command to Bedroom Light.â
Literally as I was just typing this, my microwave just turned on when it shouldnât have. So lets work this out together, Here is the piston;
Okay so the microwave turned on so Kitchenâs Motion must have changed to active. Go into smart-things;
Hmm, thatâs strange, last motion recorded by Kitchen motion was last night, 7 hours ago. Maybe it wasnât this piston that turned it on?
And these are the problems I have with WebCoRE, roughly once a week. Last week it was the bedroom light just turning on for no reason. Week before it was WebCoRE running goodbye when me and my wife were both at home. I did find out later that both of our GPSâs had for 13 seconds shown us as being in California, but we live in Australia. Fair enough, but smart-things has a setting that doesnât actually change your location mode (Home, Away) until you have been outside of the set geofence for a set amount of time (2 minutes), but the piston ran anyway.
Basically I am trying to create reliable pistons. I know there are a lot simpler ways of doing what I want to do but for some reason I just donât get consistent results even if the conditions havenât changed. Iâve completely reworked all my pistons twice now, as when I started I decided to code by mode. So if someone is home, do this, that, when this, do that, send that, turn this off after x minutes etc, but my pistons became too massive (Mem used 76%, 37 chunks) and sometimes pistons would freeze. So with some help from the community I rewrote every piston based on itâs sole function/device it controlled. The outcome was improved reliability however by splitting the pistons up I had to use global variables, and thatâs where these problems started. I have been soo frustrated with these issues I was at one point willing to pay someone to write my pistons for me as long as they worked reliably.
Iâm not saying iâm ungrateful, any and all help is appreciated, thank you, but I know all software has bugs. Using WebCoRE for a year now, I figured that these issues I have been having with global variables was just limitations in the engine, so instead of going to the community and constantly asking for help with all my pistons with global variables (12 pistons, 4 total variables), I would rather create work aroundâs and fail-safes to limit the possibility of a malfunction. That way I know my chances of getting woken up again at 1:20 am by the Bedroom Light deciding it wantâs to turn on, is reduced.