Nope, it still doesn’t behave correctly when using the LastDimLevel BathMotion ? LastDimLevel : LightLevel condition. I have resorted to hard coding values and now (mostly) have the desired behavior. It’s not perfect or as elegant as I would like, but the following PLEG with a 5 second reset of the motion sensor comes closest to providing the behavior that I desire.
Triggers
BathMotion Bath_Motion Sensor is tripped
NoBathMotion Bath_Motion Sensor is not tripped
Device Properties
LightLevel Bath Lights LoadLevelStatus
Conditions
Lighten BathMotion AND LightLevel == 2
Brighten BathMotion AND LightLevel == 10
RestoreLightenLevel LightLevel == 9 AND (NoBathMotion; NOW > 1:00)
RestoreBrightenLevel LightLevel == 61 AND (NoBathMotion; NOW > 1:00)
Actions
Actions for Condition: Brighten
Bath Lights SetLoadLevelTarget newLoadlevelTarget=61
Actions for Condition: Lighten
Bath Lights SetLoadLevelTarget newLoadlevelTarget=9
Actions for Condition: RestoreLightenLevel
Delay 10
Bath Lights SetLoadLevelTarget newLoadlevelTarget=2
Actions for Condition: RestoreBrightenLevel
Delay 10
Bath Lights SetLoadLevelTarget newLoadlevelTarget=10
It’s still not perfect. There are still a few of issues, beyond the amateurish hard coded values.
PLEG - Sometimes, though infrequently, the Restore??ightenLevel will activate within several seconds of NoBathMotion, immediately bounce back up to the previous higher level and then 10 to ~100 seconds later Restore??ightenLevel. Visually it looks like the action trips, realizes it is in error, corrects itself and then functions normally.
Vera & PLEG - Due to Vera’s 1 minute resolution, the dim levels will be reset anywhere from 10 seconds to ~100 seconds. Not a big problem, but there is a level of unpredictability that I don’t like.
Vera? - You may also notice that I have changed my lowest “resting level” to 2%. For some reason, Vera has for some reason started to show/interpret the switch as 0%(Off) after polling it. This despite it actually being set at 1% and the light is indeed still On. Though it did not behave this way, even at 1%, before I started experimenting with this PLEG, using 2% seems to avoid the problem. I just hate inexplicable results.