Need help with Motion Sensor Outside


#1

1) Give a description of the problem
I have noticed that my outside lights labeled Motion sensor 4 remain on all night long. Motion Sensor 4 is a Seer outdoor motion sensor which has a built in switch. Also the front door lights come on when the front door contact is open and then dim down as soon as the door is closed.

2) What is the expected behaviour?
Motion sensor should come on for 5 minutes when motions is sensed or the front door contact is opened. Then the outdoor motion sensor should turn off and the Front door lights should dim to 10 %.

3) What is happening/not happening?
Motion sensor is staying on all night. Door lights are turning dimming as soon as the door is closed.

4) Post a Green Snapshot of the pistonimage

The motion sensor had the lights on all night last night but the motion sensor did not pick up any motion.


#2

You may want to enable trace and also provide logs.

Does the following actually show as true? Feels like the state of both can not occur together.
Can motion sensor 4 motion changes to inactive
And
contact sensor 1 contact changes to closed


#3

Several things about this piston make no sense to me. Maybe it is just me. Here is my 2 cents worth.

  1. If MS4 is active you turn on MS4. It sounds like you are turning on something that is already on.
  2. If MS4 is active you set lights to 100%. Then immediately they are set to 10% after If Statement.
  3. The If statement that checks for MS4 and CS1 changing at exactly the same time is probably never going to happen.
  4. I’m not 100% sure, but I think your WAIT statement terminates whenever ANY trigger fires within the piston. There are non-default piston setting to keep this from happening.

#4

As @Dale mentioned I believe you need to re-think your strategy here. Your first part of an if should be some kind of a trigger.
I think using “IF time between sunset and sunrise” as the start of your IF is not a good idea.

I would start with the sensor change then look at the time and decide what to do.


#5

This is why i am going to give up on Home automation. Unless you are an advanced programmer you cant make it work. What I’m asking this to do is relatively simple yet there is no simple way to make it happen. I have tried and tried and tried to figure this coding out but again unless you are an advanced programmer then you better stick to basic timers. I like the potential that webcore offers but its not for the masses. I cant find an example piston to work off of. I’m at a loss. This should not be this difficult. I want a light to come on for 5 minutes when it sense motion outside. (you know, like all the cheap $10 motion sensors already do) Im so frustrated because everything i try with webcore is a complete failure.

With all that said, I’m no dummy or newb at programming. I have an aquarium controller that I programmed to do all kinds of things and I am considered advanced with that controller system. But this is a different animal.

How do I move forward with this?


#6

Ok so I have the time as the initial trigger because at sunset, I want the lights to set to 10% and stay at 10% until motion is sensed or the door opens. When motion is sensed or the door opens, I want the lights to go from 10% to 100% and the motion sensor switch to turn on (The motion sensor has a built in switch that turns on large flood lights) When there is no motion for 5 minutes, I want the motion sensor switch to turn off the flood lights and the other lights dim to 10%. At sunrise, I want everything to turn off until Sunset.


#7

Does this look better. Remember that “Motion Sensor 4” is a motion sensor and a physical switch.


#8

What you have is a condition. You need a trigger.
Time happens daily at Sunset would be a trigger.

Pistons do not sit and run indefinitely it needs to start.
If time is between sunset and sunrise would be a big window of time for the piston to constantly run and watch for a sensor to change.
I am no expert but I have the best luck when I start the piston from the device I am watching.

If sensor changes to active then
if time between
do something


#9

Maybe try something like this:

Remember that a piston executes from top to bottom every time one of the “lightning Bolt” events happens or a timer event happens.


#10

@Dale is definitely on the right track…

I made a few small changes to his code to account for the early morning possibility of running past sunrise.


#11

Good catch WC


#12

What does “early morning running past sunrise” mean. Isn’t sunrise and sunset a set time everyday?


#13

In piston 2t9fa above, there may be occasions where the light is left on all day.
(line 49 could be true at any time)

Piston bqsx fixes that…