Help building piston using Presence Sensor for approaching places


#1

I’m not sure if this should go in this category or piston design help, but will try this out.

With the presence sensor for the iOS app it gives lots of options that sound great and would love to use many of them, if not all. I’ve been wanting to build a piston that can turn my porch light on before arriving home. Currently I’m using a CoRE piston that works alright, but often times have to wait for the light to turn on since I’ve got my geofencing pulled in tight (not even sure if that makes any difference).

Here’s both the working CoRE piston and the work in progress webCoRE piston.


#2

Moved to piston design. Do you have any logs from your webcore version. You have it set up correctly


#3

Ok so the piston works the way it’s setup now, but I’m wondering what he others options for the presence sensor do that I’ve got shown in these screenshots. For example could I have a piston run when I’m 5 miles from home for example? Could a piston run when I’m at certain a place other than my home?

!

!

But here’s a look at the logs in case you’d still like to see…

10/18/2017, 5:07:02 PM +875ms
+1ms ╔Received event [Tall Pines].test = 1508360822867 with a delay of 6ms
+183ms ║RunTime Analysis CS > 23ms > PS > 97ms > PE > 64ms > CE
+196ms ║Runtime (38445 bytes) successfully initialized in 97ms (v0.2.0fa.20171011) (194ms)
+198ms ║╔Execution stage started
+219ms ║║Condition #8 evaluated false (9ms)
+222ms ║║Condition group #1 evaluated false (state did not change) (13ms)
+227ms ║╚Execution stage complete. (29ms)
+241ms ╚Event processed successfully (242ms)
10/18/2017, 5:06:50 PM +830ms
+2ms ╔Starting piston… (v0.2.0fa.20171011)
+325ms ║╔Subscribing to devices…
+337ms ║║Subscribing to Gigantes.arrivingAtPlace…
+424ms ║║Subscribing to Porch Light…
+426ms ║╚Finished subscribing (105ms)
+489ms ╚Piston successfully started (487ms)
10/18/2017, 4:55:33 PM +591ms
+1ms ╔Received event [Gigantes].arrivingAtPlace = with a delay of 70ms
+147ms ║RunTime Analysis CS > 27ms > PS > 99ms > PE > 21ms > CE
+157ms ║Runtime (38761 bytes) successfully initialized in 99ms (v0.2.0fa.20171011) (155ms)
+159ms ║╔Execution stage started
+172ms ║║Comparison (string) changes_to (string) Home = false (1ms)
+174ms ║║Cancelling condition #8’s schedules…
+174ms ║║Condition #8 evaluated false (8ms)
+175ms ║║Cancelling condition #1’s schedules…
+176ms ║║Condition group #1 evaluated false (state changed) (10ms)
+178ms ║╚Execution stage complete. (20ms)
+185ms ╚Event processed successfully (185ms)
10/18/2017, 4:55:32 PM +885ms
+1ms ╔Received event [Gigantes].arrivingAtPlace = Home with a delay of 75ms
+160ms ║RunTime Analysis CS > 27ms > PS > 116ms > PE > 17ms > CE
+171ms ║Runtime (38767 bytes) successfully initialized in 116ms (v0.2.0fa.20171011) (168ms)
+171ms ║╔Execution stage started
+182ms ║║Comparison (string) Home changes_to (string) Home = true (1ms)
+183ms ║║Cancelling condition #8’s schedules…
+184ms ║║Condition #8 evaluated true (7ms)
+185ms ║║Cancelling condition #1’s schedules…
+186ms ║║Condition group #1 evaluated true (state changed) (8ms)
+188ms ║║Cancelling statement #2’s schedules…
+207ms ║║Executed virtual command


#4

Use distance drops below 5 for the heading to home. This could throw some false positives because it would basically be anytime you enter into a 5 mile radius of your house. But it can certainly work.

You can trigger off other places. Use currentPlace and write in the name of the place.

Bearing is either the heading (N, S, E, W) you are from home or that you are currently traveling.

Floor is like you are on the 15th floor of the building. This info is not always provided tho.


#5

Bearing is either the heading (N, S, E, W) you are from home or that you are currently traveling.

Actually it returns the degree value that you are heading. So for example if heading south it will return 180.000. You need to convert that to the letter value that the degrees correspond to


#6

@GRClark I am enclosing how I am doing my sensors. Last weekend when traveling they worked 90% efficiently. Still some tweaking to be done. But will help you along and others.

First. This one is triggered by a smart app that makes a contact sensor for events on my google calendar. It references the contact sensor then if Open triggers the gps tracking. The SmartApp is gcal it is in github. Kind of tricky to get going, but once done it is rock solid

Then\ next piston actuall checks your location against various saved locations in your places

From there it calls this gps bearing piston.

And finally it sens the message to my message piston. I have a virtual switch set up for each person to get the messages. If it is on they get the message, if they turn off it won’t send to them

Hope that helps.

Gopack2


Global Variable across 2 webCORE instances