Lighting and contact

Hi there hope someone can help and understand this.

I'm trying to get a smart light to to turn on when a door opens. And then wait until the door closes, then turns off after 5mins after the door has been closed. I have got it working to turn on and turn off. But it turns off even if the door is open or closed. I'm close lol but not close enough. Only started this about a month ago.

Are you using the motion lighting built-in app or rule machine? Or something else?

In addition to the above question about what app you are using to control this, what door sensor/motion sensor and what switch (bulb?) are you using?

At the moment I'm just using "simple automation rules" and the door contact is a Samsung multipurpose sensor and the light is a Ajax online GU10.
I no the simple rules are simple. But the rule machine just makes me look like a deer in headlights

Might be worth posting a screenshot or two of the rule if you can.

this is it

Maybe you could try the Basic Rules app. Like this:

1 Like

OMG!!! thank you so much lol that works much better than my way lol. coz im very new to this im having to test things out and in all honestly im lost most of the time lol

1 Like

We've all been there at one time or another.

1 Like

One feature you might want to explore is virtual devices such as a virtual switch. As has already been noted, you do not need to use a virtual switch for this situation, but there are some situations were virtual devices are useful.

To do this with a virtual switch you could do the following.

  1. Create a virtual switch called LightProxy or whatever you want to call it.
  2. When the door opens the real light turns on and the virtual LightProxy switch turns off.
  3. When the door closes, the LightProxy switch turns on to start the countdown timer.
  4. After waiting the specified delay, the LightProxy turns off and the real light turns off.

As has already been indicated, you do not need the virtual switch this time, but there may be time when you will find it useful.

I use a virtual lock to indicate whether my exterior doors are open or closed. If any of the doors are open, the virtual lock will be unlocked. If all of the exterior doors are closed, the virtual lock is locked. That way, all I have to do is query the single virtual lock to determine if any doors have been left open.

Like you, I like setting things up in Basic Rules if possible. I have found I can do most thing that way without resorting to Rule Machine, Node Red, or other options, but I am glad they are there for special situations.

1 Like

Could you make a walk through if possible, I'm trying to replicate it to understand it

Are you having trouble using the basic rules app?

Or implementing a solution involving a virtual switch, as mentioned in the post right above your last one?

I would consider forgetting entirely about the virtual switch at this time, in case that’s adding to the confusion.

The other option would be to try Motion Lighting app. It works very well, but is a little bit harder (but not much) to use than Basic Rules. It has many options to keep lights on, keep them off in other cases, and so on.