Motion Night Light


#1

1) Give a description of the problem
I need help making sure this code will work. Do i need to mess with TCP settings?

2) What is the expected behavior?
I would Like to set up a Night light that will turn on with Motion so that when i am up at 3am with a hungry infant I don’t have to turn on the lights and wake him up even more when going to the Kitchen.

Between 3 Hours after sunset and the next days sunrise when motion is triggered it will turn a dimmer on at 25% then wait 5 Min then turn off. But if motion is detected during the 5 min it will reset the timer for another 5 Min. It also will allow you to cancel the automation by physically turning the switch off and then on again and the light will stay on till you turn it off.

3) What is happening/not happening?
I have been reading about setting TCP to Never and it has me confused but i want to see if what I have Frankenstein’d together will work.


#2

You could try changing ‘Motion Changes to Inactive’ to ‘Is Inactive for 5 minutes’.
Then delete the wait 5 mins.
That would probably do the trick.


#3

Thanks for the quick response!

I just looked and i don’t see an option for (is inactive for X) I just copied @bangali 's work and tried to make it my own.


#4

Scroll all the way down into the triggers.
Its ‘Stays’ off the top of my head.


#5

How does it look?!?!?!?!


#6

It looks good to me but I must confess I have never used the programmatic function.


#7

I will test it out tonight and let you know tomorrow if it works! I have a couple other projects that are in need of help but will post other threads so people can search for them if they have the same issues.

Thanks for your help!!!


#8

Fingers crossed for you.


#9

the original version you posted should work fine without messing with TCP.


#10

It works!!!

Now my followup question because there is always a follow up question is if i want to have multiple sensors control the light or i want to add an additional light to this do i need to mess with the TCP settings?

I wish i could post an example but i only have one motion sensor ATM the other ones ore on their way from Amazon.


#11

Shouldnt need to do anything but add the sensors so line 22 becomes

If any of Motion Sensor 1, Motion Sensor 2 … motion change to active
etc

:slight_smile:


#12

Perfect thank you!