Where am I going wrong? Arlo cameras not turning off with presense


#1

1) Give a description of the problem
(Arlos are not turning in and off when presence meets certain criteria)

2) What is the expected behavior?
(When everyone is home turn off arlos. )

3) What is happening/not happening?
(Arlos aren’t doing expected behavior)

4) Post a Green Snapshot of the pistonimage
(

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

You should try simplifying your problem before scaling it up this big.


#3

to give you an example of what @c1arkbar means if you look at these 2 ifs:

the conditions for the first if and the second if overlaps. so the first if will turn off the arlo then the second if will turn on the arlo … which will make it seem as if the arlos arent behaving … but they are. :slight_smile:


#4

I understand your point but even if they overlap they still aren’t turning off in that snippet.


#5

Do you have any logs?

Your if statements are running from top to bottom. So it could be turning off but then it drops to the next if statement. Which turns it back on.


#6

I’ll turn them on. I really thought the presence would prevent it from overridding.


#7

Breaking down the snippet that @bangali posted.

Scenario 1. PS1 is arriving at home and PS2 is already there. The current time is 10 am. Your Arlos are currently on.

The piston executes on PS1’s arrival. Line 20 is now true because both PS are home. Next the time is true because it is 10 am. And finally the arlos are on. So the entire group is true. Now it starts processing the actions.

Sets location mode to home, disarms the SHM, sends a push notification and then turns off the arlos.

This is what @bangali was mentioning about overlapping.
The piston does not stop executing there. It continues all the way down to the end.

Line 40 is true because it only needs 1 of the 2 PS to be present. Since they are both home it’s true. The time is still true because it’s 10 am. And now that the arlos are off the final condition is true as well. So it processes all those actions and ultimately turns the arlos back on.


#8

I get the logic here but the arlos aren’t turning off. So I know it was mentioned to break this into smaller pistions but I’d rather fix this.

Is there a way to end an if and start a new one?


#9

I wasn’t saying it as make smaller pistons. I was saying to test things it is easier if you break a large complex piston down to the base. It is easier to figure out issues that way. Then build the logic around it after you have it working. Testing each step.


#10

Got it. I ended up separating out the night mode from this main one. It is easier to test now. Seems the issue was webCore wasnt following the time of day to separate my piston.