I wrote this piston to manage a plug that controls the heater in the cat house where our feral cat lives. All it does is turn on the heater when the temp sensor falls below 45 and turn it off then the temperature rises above 65. Can anyone explain the "found nested trigger" warning? Is there a better way to do this? Will my piston get tripped up under certain conditions? Thanks for any insight anyone has.
Not sure why you need the outer if loop. You are doing it again on the inner. Just use that?
Any IF statement that needs to subscribe to an event, that is nested inside of another IF that subscribes to an event, gives you that warning. It is letting you know the inner subscription will have issues since it is conditional. It will get there in your piston since the condition is already met in the first IF, but that wouldn't always be the case.
As @CurioiusB said, there is no need for the first IF. A piston can just be a list of non-joined IF statements, so you just need those two inner IF statements alone, and also no else is needed here.
So just an if rises above, then stuff, and an if drops below, then stuff, is all that is needed.
You could use $currentEventAttribute variable in this case, to check the initial event value in a nested if statement, so it does not have to subscribe to the event again. (lighting bolt is an event subscription)

