Variables and Switches are for many different things.
Coding is - in a way - like art, or singing the same song from different tones:))))
Everybody has their own way of doing it.
Let me give you an example from my home:
My main entrance door must be closed at all times (3 cats:))) and it can not be left open more than 15 seconds.
If so, alarm will go off…
The piston is very simple.
But when you start adding scenarios to the situation, switches, variables, pausing are needed for you code.
a) A friend comes by and we’re chatting in front of the door and the door is open.
I don’t want to go through my phone and click buttons so that I can shut off the alarm.
It happens automatically
If motion detected in front of the door and if the door sensor is open more than 30 seconds - which means we are talking - a variable changes from FALSE to TRUE and diverts the pistons 15 second alarm time to lets say 2 minutes. Now for two minutes alarm will not go off…
and even 15 second is not a 15 seconds it’s a variable. I don’t have to write another IF block for 30 seconds, I can just change the variable within the piston. Not manually, piston does it by itself.
b) A worker came to the house. He is in and out constantly. Cats are in the back and their door is shut.
I don’t need the door alarm.
I can pause the piston BUT i have to remember the RESUME it.
So instead I use a simulated switch that is on the wall mounted ipad on Action Tiles.
60 minute delay switch.
If I push that button (simulated switch) switch is ON now and that tells my piston to ignore any warning for the next 60 minutes.
c) I’m not home but I know that day randomly a lot is going to happen. Maid, visitors, friends kid etc.
again cats are in their side of the house. And I don’t want to try to teach people to push a god damn button every 60 minutes LOL
I just pause the piston completely. Again through a simulated switch on the Ipad.
When that feature is activated, a timer piston starts, that day after midnight, piston is RESUMED again. To make sure that we don’'t forget…
How to find PAUSE and RESUME:
When you add NEW ACTION
First choice is LOCATION
don’t scroll down the list, just click ADD TASK
now you will see a DO LIST
Scroll down, you’ll see PAUSE
and 4 after that is RESUME…