Hi,
Is there a way to test if change of brightness was triggered by automation or by user input (via app or button press)?
I am working on automation like this:
if there is no motion in room for some time decrease brightness of the lights to 50% of ITS CURRENT brightness.
if there is motion set brightness back to its ORIGINAL brightness before dimming.
if there is no motion after some time after dimming lights turn it off completelly.
Most of this is up and runnig fine, but I am struggling with reading and storing brightness of those lights.
When the automation starts I need to determine what is the current brightness of lights and store it into input_helper. This is based on trigger brightness change, so it will catch if user change brightness while timer is running. If I use turn on trigger I will miss potential changes in the brightness after automation was started.
BUT and here comes the catch, if I decrease brightness to 50% of the original stored brightness, this will trigger brightness change and overwrite stored value with reduced number and therefore I can’t restore lights to its original brightness.
Is there a way to test if change of brightness was triggered by automation or by user input (via app or button press)? If I can add this as condition, it will only respond to user triggered change of brightness and therefore leave the stored value intact after automation triggered change.