Motion lighting not working


#1

1) Give a description of the problem
Piston quick facts states 2 devices used where there are actually 6. I recently added the portion with the master toilet sensor and variables; everything else has been working for a couple of weeks

2) What is the expected behavior?
Vanity lights should come on when bathroom sensor is active or any of the other three lights come on. It’s level is based on mode. Toilet light should come on with master toilet sensor motion, level based on mode. Variable is to allow a manual bypass of the motion activation/deactivation. Vanity lights should turn off 30 seconds after everything else is off.

3) What is happening/not happening?
If I turn on the master toilet light the vanity lights come on correctly based on the mode, nothing else works

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)


#2

I am not near a computer right now, but there is one thing that stands out with your piston. I would restructure your piston to avoid using the ELSE IF blocks entirely. Basically:

IF something happens
THEN do something
END IF

IF something else happens
THEN do something else
END IF

Rinse and repeat all the way down.


#3

So I restructured as you suggested. I might add back a couple else if statements to avoid using the same condition multiple times but it does make more sense that way. However the piston still seems to act the same. I’m very curious as to why it says only two devices are used rather than 6. If those two are the toilet and vanity lights that would explain the parts that work.


#4

So I had some time to play around with this a bit and I got it to work and recognize all 6 devices but I had to remove everything that referenced the variables. I’ve done some reading and have seen before where you’ve warned against have multiple triggers per IF. Could that be what is happening here? I would really like the ability to manually override the motion function.


#5

No, your problem was that you have both Triggers and Conditions. If you have only conditions, they will act as triggers. But as soon as your have a trigger, your conditions only act as conditions. The difference is called out in WebCore. Triggers are “changes”. Conditions are “is”. If you have a trigger, only triggers will cause your piston to fire.


#6

I want to start by apologizing for the images of the piston that I posted. I thought that “Anonymous Snapshot” meant that it hid personal information. I didn’t realize it would hide the names of the devices. And @Ryan780 you were correct about the triggers. I think that I’m just going to create another piston to control the manual override portion and see how that works. @WCmore I appreciate your suggestion on the structure. I like the flow of it much better this way.


#7

For the record, “Anonymous Snapshot” is the way to go.
(although sometimes I add a note telling others that “Switch 1” is really my lamp etc)


Normally when we add a trigger, a lightning bolt appears in the left margin. The only device you are subscribed to is ‘White Bulb 2’, which means nothing happens until that switch is toggled.

The way I understand your logic is:

Your triggers should be:
Motion Sensor 1
Motion Sensor 2
White Bulb 2

Your conditions should be:
Switch 4
Switch 5
White Bulb 2


The basic structure you want is:

IF Trigger ...
and
Condition ...
THEN do stuff
End IF

The trigger line is what initiates the piston, and then it checks the conditions before deciding whether to do that block of code.