Hi,
I managed to create automation that switches lights on when motion is detected and off when no motion detected. However, I want to go further step by making the brightness of the lights 20% when motion is first triggered, then the brightness increases as long as motion duration increases. Any ideas how to do that?
Here is the code I have now for the automation:
alias: Hallway Light On/Off by Motion
description: “”
trigger:
The basic approach is this;
Get the current brightness
Define the amount to go up or down (I’m using 2)
Set the new brightness value (note VALUE, not State)
Test to see if new value is within defined range
Set the brightness State
Delay a set time period
The UNTIL portion defines when to stop ramping.
at no less than 73
no more than 24 decrements (loops/steps)
if the light turns off
if the input boolean that controls the dimming is turned off.