Location Based On Presence and Time


#1

I’m trying to set up location based on presence and time. I’m a bit newer at this and have seen some code that does this with many modes, but I believe it over complicates things.

As the code shows, it should identify if any of us are home, then if it’s between 6 AM and 830PM, it should set it to home, else, night.

if both of us are away, it should be set to away.

At this moment, we are both gone, WebCore sees that we are both not present, but the location is home (using default home, away, night).

My gut tells me this is being caused due to no event actually causing the trigger to go off. Would presence changing be enough to start the piston?

Thanks


#2

If the presence is the trigger then there will need to be a presence event to evaluate the piston. While in piston view mode, click the External URL and see if the piston will reevaluate the presence devices (I have not tried it before). What I usually do when testing presence piston is create a virtual presence device in the ST IDE where I can make it present/not-present at will. I include that virtual presence in the piston while testing and substitute the real device when done.

image


#3

Thanks for the quick reply. So I click the external link but there is no real way to notify me if it will reevaluate. I get result: OK (in Red), timestamp: xxxxxx. Headers show Connection as keep-alive and I’m guessing nothing else really matters?

I can also see that when I click external link, Last Executed shows the current time.

I’m going to create the test presence sensor to see if that could help as well.


#4

If evaluated the presence, the mode will change as you expected. If not, then I would go the virtual presence route for instant gratification :slight_smile: