Nightlight Solution


#1

1) Give a description of the problem
Looking for a motion based nightlight solution

2) What is the expected behavior?
motion trigger will turn on 2 lights and if after x period of time there is no motion, turn the lights off again.

3) What is happening/not happening?
Seems to be turning on but not off… I would also like to include a second or third motion sensor for the off command if possible.

4) Post a Green Snapshot of the pistonimage


#2

Pull your 2nd IF outside your first one. The way it’s written now, when Motion Sensor 1 is inactive your first condition will evaluate false - so your piston never reaches the 2nd IF.


#3

Like this?


#4

You may want to rethink the one command for level is less than or equal to 0%

Technically, a light level can’t be less than zero


#5

Yep, that should do it! If you want location and other switches to restrict it (like your first condition) you’ll need to repeat them in your 2nd IF because they’re independent now.

But what you have now will turn off the two lights when your motion sensor changes to inactive.


#6

Good catch. Unless the level is set to 0% by another piston, that could cause unexpected results. My switches, for example, do not report a level of 0% when they are turned off. Their ‘switch’ is off but their level is whatever they were set to before they were switched off.

All depends on the devices in question I suppose.