Many years ago, about 10, I installed lights for the entry step. I finally got around to hooking them up. I used a reed switch with magnet to activate them to turn on when I open the door. In the same general theme of not doing anything simple I put a new clock above the door that I could see while driving. Then to further complicate things I added a light under that to also light up the entrance. As I get older I found that, in the dark, I used the cabinet above the passenger seat to steady myself. Soooo I added a grab handle to the bottom of the cabinet. Still not content with leaving things alone I made the grab handle a touch sensor to turn on the light so I could descend the steps with light. While I was at that, I made the reading light just installed to also touch to turn on.
Here's the wiring diagram.
As usual the coding gave me a bit of problem but, I was able to figure it out by myself. Is it bad code if it does what you want it to?