Hello,
Run automatically lights on/off in bathrooms in this way without IR sensor, only magnetic switch in the door, can not anything about coding, can you make a code so you do not need to run this many steps, a timer also if you do not close the door as the lights go off after 30 minutes, the advantage of applicants is when cleaning bathrooms so the door is always open and the lights are on and goes off when the 30min timer, if forget door closing this time as well