Cabinet lights on only when home but not after bedtime


Hello WebCore Community.

I recently installed under cabinet lighting and put this on a smart switch called “Kitchen Cabinets”. I enjoy having the lights on any time of day, however I would like them off when neither my wife or I are at home. I can create a simple automation that turns the lights off when neither of us are home and back on when at least one of us returns. The problem is that I want to also turn them off when we go to bed. I already have a Google Routine that turns off “most” lights for bedtime, and I would also include these lights in that routine.

So basically, lights on when at least one of us is at home, turn off after routine, turn back on at pre defined time in the morning or with another routine. Additionally I may add motion detector to the mix so if I get up in the middle of the night the light comes on for a time period after motion is detected and then back off.

Any ideas would be greatly appreciated. Thanks in advance for your help.



For this part you can use phone presence but they are not 100% reliable…

You might need to create a simulated switch for this one that google turns it off (Alexa can do that but not sure about google)

now you need to start using variables…


Is google linked to your account? Could you have this google routine also turn off these lights?

This might be a good $10 - 50 investment.

Do you have a contact sensor on your bedroom door? I’ve done that, and use it to turn down my thermostat and activate the night alarm. It could easily turn off your kitchen lights too.

I’ve had reasonable luck using this. It does fail sometimes. The logic might be something like this:

if Wife's Presence Sensor is Not present and
mj's presence sensor is Not Present:
    with Kitchen Lights, turn off

if (Wife's Presence Sensor is Present or
mj's presense sensor is Present)
and time is between (wake up time) and (bed time):
    with Kitchen Lights, turn on

Every 1 days at Bed Time:
    with Kitchen Lights, turn Off
Every 1 days at Wake time:
    if Wife or MJ are Present:
        with Kitchen Lights, turn On


I have tried this and you are correct, not 100% reliable. It seems to work ok with my phones presense but not my wifes.

I added these lights to my routine, so they turn off just fine, every night at bedtime no problem.

Not sure how I want to play this. I ordered 3 motion detectors and I am thinking If I place them well enough I may just be able to rely on these and ditch the phone presence idea.

Thanks for your ideas


Yes, I have added to my routine for shutoff at bedtime. Just didn’t know how this would playout if I was relying on a piston to manage the lights as well.

I’ve ordered 3 motion detectors. I will play with these when I get them. I may just be able to bag the whole phone presence idea if it works well.

Good idea about the contact sensor. I have an extra one. I’ll add it to my bedroom door and give that a go.