Nothing new but just my implementation of great examples found on this forum and made 'my own'
A LED-dimmer triggered with a motion-sensor and managed via PLEG on a VeraLite. The box is mounted under my bathtub as floor-lighting. PLEG takes care of the intensity depending on day- or night. The sketch has a watchdog routine for taking care of switching of might there never be an 'off' command coming in from Vera.