Controlling lights with geofenced area


#1

Hello! I’m very new to webcore and am still trying to figure things out. But what I want to do is have my lights turn on/off whenever i enter/leave a particular geofenced location (being my home). I was able to set up the presence sensor using the webcore mobile app. My main issue is being able to input the geofenced area into a piston so when the presence sensor enters or leaves the area my lights turn on and off respectively. This is what I have so far and doesnt seem to work. Any help would be greatly appreciated. Thanks!


#2

I usually encourage new users to avoid using ELSE for a few months.
(it rarely does what we’d expect it to)

This piston should work if you split it into two independent IF blocks.

IF Sensor's presence changes to present
Then
    IF Time is between X & Y
    Then
        Turn on Light
    END IF 
END IF

IF Sensor's presence changes to not present
Then
    Turn off Lights
END IF

#3

Hey! Thank you so much for the help and advice. Ok so this is what I am going with now and hopefully it works. Please let me know if this is what you meant or if i did something wrong.


#4

The example I gave above has two IF’s, entirely independent…
(one IF ends before the other begins)

Combining them together like you did will not work, because the sensor cannot be ‘present’ and ‘not present’ at the same time.


#5

Oh sorry I see what you mean. I didn’t realize I could start a new IF within the same piston. Thanks for the help. Let me know if this is right.


#6

Your structure looks good, but the new code you added to wait until sunset might not work.

My two cents?

Let this piston focus on what happens when you arrive/leave the house… and create a different piston that does things at sunset.