At this stage I haven’t tried to create a piston but wanted someone to help me with the right logic so my brain will be steered at the right path.
I currently have a working piston that flashed a few lights when our ring doorbell is pressed. this works well. what i want is to be able to turn lights off after that weren’t already on, and for the ones that were on to reset them to the previous state or set to a particular colour if easier.
Do I need to define variables for each bulb? My current logic is to have a variable for each light that is set to true when light is on, then it sets to off after a couple of minutes when light goes off. This way once the doorbell routine has run it should be able to turn off those that weren’t on as the variable will be false.
Is this the right way to approach this? Or has someone already got a nice implementation already?