I’m trying to create a piston that notifies me a specified amount of times that a light has been left on and there is no motion. If the light isn’t turned off, then it would be automatically switched off.
More or less, here is how I’d like it to flow:
- Light is left on and there is no motion for 30 mins
- Send a notification that light was left on, repeat this up to three times with 1/2 hour in between.
- If light is turned off before the loop completes, then break the loop and send a message that the light is now off.
- If the light isn’t turned off after the loop ends, then turn off the light.
See below for where I’m at. I could mostly use help with the loops and stopping said loop if a condition changes. Any help would be really appreciated!