1) Give a description of the problem
Trying to figure how to write a piston that would set light level when detecting a door open and turning light off when the door is closed. I can do that just fine, but the but the issue is: I am not sure how to create the piston so that the “light off” does not trigger if the light is already on (i.e. turned on manually). How do i check if the light was turned on by automation or manually before attempting to turn it off?
In addition, is there a way to reset the level of the dimmer without turning it it on? The dimmer seems to remember the last dimmer setting and when turned manually (after automation had set it to lest say 10%) it turns on to that last dimmer setting.
2) What is the expected behavior?
between sunset and sunrise and if the dimmer is not already on
Door opens and the dimmer goes on to 10%
Door closes and after 60 seconds light goes out
but …
I already have it figured out how to prevent automation from running if the light is already on, but how do I prevent it from running (i.e. turning light off) after the door is closed but the light was not turned on using the automation?
It kind of have it working by checking the dimer level and if it is not at 105 automation sets it to 10%) the automation will not run. I do not like it
Not sure if there is a better way.
3) What is happening/not happening?
It kind of have it working by checking the dimer level and if it is not at 10% (automation sets it to 10%) the automation will not run, but I do not like it
Not sure if there is a better way.
**4) Post a Green Snapshot of the piston!