Door sensor light help

Hi looking for some help would like my hallway light to turn on if the front door is opened after sunset which seems simple enough with a door sensor however, wouldnt this when leaving also turn the light on unless the light was already on when the door was opened to leave. But if you turned the light off to leave and then opened the door the light would turn back on again wouldn’t it?

Yes, anytime the door is opened after sunset would cause the light to come on.

It all depends on what you are using to create the automation and how you have it set up. You don’t give any details of what you have used or tried to use and what is actually happening. More detail might be helpful. Anything is possible given enough programming and time.

Based in the little that we do know and the additional requirements that you are going to shake out of this, webCoRE is probably the best route to take. You didn’t give us detailed and granular specifics. It was kind of hard to understand exactly what you were stating and asking in your first post, but I’m just going to throw out a few things to get you thinking:

  1. If Mode = Home and SHM Status = Disarmed or Armed (Home) and the door sensor changes to Open and the Light = Off, and time is between Sunset and Sunrise, then turn on the Light.

  2. If Mode = Home and SHM Status = Disarmed or Armed (Home) and the door sensor changes to Closed and the Light = On, and time is between Sunset and Sunrise, then turn off the Light.

Those are two basic qualifications that cover things when you are Home and the SHM Status is set to Disarmed or Armed (Home)

Now you need to think about the qualifications and requirements for when you aren’t home. When your Mode is Away and the SHM Status is Armed (Away) what do you want to happen if an intruder opens the door? Do you want the Hallway light to turn on to greet them to make it easier to steal something? Perhaps you have colored bulbs and you want them to flash red, and you want to be notified that the door has just been opened and maybe you have speakers that you want to announce a message to the intruder such as “The police have been notified, so if you are smart, you will turn around and run, but please close my door on your way out”. Or if you have a siren, you could have that activated (sirens to me are a waste as I equate them to a car alarm - neigbors ignore them because they are annoying and if ST goes down, they could become a pain in the ass to turn off in a false alarm).

Any way, some thoughts for you to think about overall picture of what you want your hallway light to do based on when you are present and how you want things to behave when you are away.

Here’s an intro to webCoRE: