I’m still fairly new to the SmartThings ecosystem and the Groovy language. My goal with this was to take the Smart Night Light SmartApp and make it work for my needs. The original version by ST is a good concept, but has some very annoying behaviors. I used the Smart Night Light Dimmable version as a starting point.
Would anyone be willing to take a look at the code and critique? I’m happy with what I have from a conceptual standpoint, less sure about my actual code execution.
Using runIn() to schedule the shut off
Checking to see if someone changed the dim level, and skipping the scheduled shut off if so.
Checking to see if the light was already on when motion was detected. If it was, don’t reset the dim level.
Assuming this will only be run during the middle of the night mode.
If anyone else would find this SmartApp useful, please use it, modify it, etc.