I have a magnet door switch on my back door and a light switch on the back porch light. When I let my dog outside, I would like for the light to turn on while he’s outside, and off when I let him in as necessary. The problem is, I would like the light to stay on when my dog is outside. For example, if after sunset, or 7:00pm, and the door is opened for the first time, I want the light to come on. I shut the door, nothing should happen. When I re-open the door 5 or 10 min later to let the dog in, nothing should happen. When I shut the door now for the second time, I want the light to turn off. Is all this possible? Or should I have the light turn off after 10 min of being activated? I am not familiar with Luup code
This would be quite easy using PLEG. See PLEG Basics.
You can do it with Lua, though. Most of what you need is in Conditional Scene Execution.