Making a Bathroom light double as a night light

Did some searching on the forums and did not (so far) find a possible solution to this idea. Was walking around in my not completed first floor, planning out my lighting control design. Had an idea…

In my old bathroom we had a ceiling fan that was a 3 in 1 combo unit, fan, regular light and nite lite. The unit was less than stellar and this time we decided to go with dedicated fixtures for specific functions. So now we have a fantastic ceiling fan (quiet and good cfm air movement) and a very nice fixture above the vanity. But no nite lite. Normally my wife uses those plugin nite lights that fit in a wall socket. I want something slicker/more elegant. I have yet to plug in my Vera since I don’t have device modules to control (coming this week), but here’s my idea.

Is it possible to have something in Vera that does the following:
During the day, have the zwave light switch for the vanity light operate normally.
At night, a function kicks in that basically says, ‘if it is night AND the status of vanity light is off, then switch vanity light to 10% level on’.
The problem I see with that is then when someone walks into the bathroom, they hit the switch, the light goes off. If they hit the switch again, the light will come back on, but at the 10% level?

I know I’m going at this the wrong way, and not sure it’s even possible. Thoughts?

-TC

It is possible to recognize the rapid off/on sequence and set the light to 100% - provided the dimmer supports instant-status reporting. You could also reset to 10% a few seconds after the switch is turned back off when it is night. This could be done by scenes with embedded Lua code or by using the Program Logic Event Generator (PLEG) plugin.

Further idea… what if I put a motion sensor in the bathroom? Basic logic would then be:

If night time AND motion sensor not active AND light off, put light at 10%.
If night time AND motion sensor active, put light at 100%.
If person is in there and light is on, they hit the switch before walking out. The motion sensor shouldn’t override, right? Maybe put in some kind of delay that would stop the motion sensor trigger for a second after the light goes off via switch?
The first rule then would kick in again.

Just thinking out loud here…

As Rex suggested, PLEG will do what you wish and more. Down the rabbit hole you go. Enjoy!

Basic Light, Motion Sensor, Night Time Example

Restore previous dimmer level

You da man, Z-waver. Thanks!