Went through a lot of others arrival pistons and had issues with just about all of them. This is a basic version that only speaks the names. However this is scalable for the # of arrival sensors and handles multiple people arriving within 5 minutes of each other. The number of minutes is easily adjusted.
Arrival Piston - who arrived
Arrival/departure if/then or case statement?
Welcome Home piston help
Arrival of people including multiple people at once
What music players are you using? Can we use Chromecast Audio or Google Home to broadcast?
My piston looks like this. Very simple. ST is running on an android control tablet. That tablet is running Tasker with AutoNotification, which intercepts the below notifications and says “greetings __________” based on the name.
execute
if
Front Door Lock’s lock #X gets unlocked
then
Send PUSH notification “Frontdoorunlocked ____________” and store in Messages;
end if;
if
Front Door Lock’s lock #2 gets unlocked
then
Send PUSH etc
end execute;
Reliable presence sensor door open announcement
Your piston is awesome! I set it up and configured it and it worked perfectly. I then (mistake time) tried to combine it with my main presence piston and I think I got trapped in that async/task cancellation thing because now it no longer works.
Can you tell where I went wrong?
I wil post a log when I capture a presence even and contact open event.
10/9/2017, 11:40:38 AM +446ms
+2ms â•”Received event [Laundry Room Door].contact = closed with a delay of 152ms
+222ms â•‘RunTime Analysis CS > 18ms > PS > 49ms > PE > 155ms > CE
+235ms â•‘Runtime (73801 bytes) successfully initialized in 49ms (v0.2.0f9.20171007) (232ms)
+236ms â•‘â•”Execution stage started
+263ms â•‘â•‘Comparison (enum) present is (string) not present = false (1ms)
+265ms â•‘â•‘Condition #13 evaluated false (22ms)
+266ms â•‘â•‘Condition group #12 evaluated false (state did not change) (24ms)
+267ms â•‘â•‘Condition group #1 evaluated false (state did not change) (25ms)
+282ms â•‘â•‘Condition #22 evaluated false (11ms)
+283ms â•‘â•‘Condition group #21 evaluated false (state did not change) (13ms)
+289ms â•‘â•‘Comparison (string) :472aa3c15fdca56c034bac858d175e13: is (string) :3101233cb6a3896338af96d248600401: = false (1ms)
+291ms â•‘â•‘Condition #47 evaluated false (5ms)
+292ms â•‘â•‘Condition group #45 evaluated false (state did not change) (6ms)
+307ms â•‘â•‘Comparison (enum) not present is (string) not present = true (2ms)
+309ms â•‘â•‘Comparison (enum) not present is (string) not present = true (1ms)
+311ms â•‘â•‘Condition #53 evaluated true (14ms)
+321ms â•‘â•‘Comparison (enum) present is (string) present = true (2ms)
+323ms â•‘â•‘Condition #54 evaluated true (10ms)
+329ms â•‘â•‘Comparison (string) :472aa3c15fdca56c034bac858d175e13: is_any_of (string) :3101233cb6a3896338af96d248600401:,:62cfeb32d55e4be236fd007df7e88b11:,:7d26172d1ac50b98e0031196eaf2c2af: = false (4ms)
+330ms â•‘â•‘Condition #55 evaluated false (7ms)
+331ms â•‘â•‘Condition group #52 evaluated false (state did not change) (35ms)
+332ms â•‘â•‘Condition group #51 evaluated false (state did not change) (37ms)
+334ms â•‘â•šExecution stage complete. (99ms)
+342ms â•šEvent processed successfully (342ms)
10/9/2017, 11:40:31 AM +814ms
+1ms â•”Received event [Laundry Room Door].contact = open with a delay of 523ms
+223ms â•‘RunTime Analysis CS > 34ms > PS > 49ms > PE > 139ms > CE
+233ms â•‘Runtime (73784 bytes) successfully initialized in 49ms (v0.2.0f9.20171007) (231ms)
+234ms â•‘â•”Execution stage started
+265ms â•‘â•‘Comparison (enum) present is (string) not present = false (1ms)
+267ms â•‘â•‘Condition #13 evaluated false (26ms)
+268ms â•‘â•‘Condition group #12 evaluated false (state did not change) (27ms)
+269ms â•‘â•‘Condition group #1 evaluated false (state did not change) (29ms)
+284ms â•‘â•‘Condition #22 evaluated false (11ms)
+285ms â•‘â•‘Condition group #21 evaluated false (state did not change) (12ms)
+291ms â•‘â•‘Comparison (string) :472aa3c15fdca56c034bac858d175e13: is (string) :3101233cb6a3896338af96d248600401: = false (2ms)
+292ms â•‘â•‘Condition #47 evaluated false (5ms)
+293ms â•‘â•‘Condition group #45 evaluated false (state did not change) (6ms)
+307ms â•‘â•‘Comparison (enum) not present is (string) not present = true (2ms)
+309ms â•‘â•‘Comparison (enum) not present is (string) not present = true (1ms)
+311ms â•‘â•‘Condition #53 evaluated true (14ms)
+321ms â•‘â•‘Comparison (enum) present is (string) present = true (1ms)
+323ms â•‘â•‘Condition #54 evaluated true (11ms)
+329ms â•‘â•‘Comparison (string) :472aa3c15fdca56c034bac858d175e13: is_any_of (string) :3101233cb6a3896338af96d248600401:,:62cfeb32d55e4be236fd007df7e88b11:,:7d26172d1ac50b98e0031196eaf2c2af: = false (3ms)
+331ms ║║Cancelling condition #55’s schedules…
+331ms â•‘â•‘Condition #55 evaluated false (7ms)
+333ms ║║Cancelling condition #52’s schedules…
+333ms â•‘â•‘Condition group #52 evaluated false (state changed) (37ms)
+334ms ║║Cancelling condition #51’s schedules…
+335ms â•‘â•‘Condition group #51 evaluated false (state changed) (39ms)
+338ms â•‘â•šExecution stage complete. (103ms)
+355ms â•šEvent processed successfully (355ms)
10/9/2017, 11:39:56 AM +156ms
+0ms â•”Received event [Home].time = 1507563597200 with a delay of -1045ms
+211ms â•‘RunTime Analysis CS > 18ms > PS > 50ms > PE > 143ms > CE
+224ms â•‘Runtime (73781 bytes) successfully initialized in 50ms (v0.2.0f9.20171007) (223ms)
+225ms â•‘â•”Execution stage started
+262ms â•‘â•‘Calculating (enum) not present == (enum) present >> (boolean) false
+277ms â•‘â•‘Calculating (long) 69840 / (long) 60000 >> (long) 1.164
+280ms â•‘â•‘Calculating (long) 1 < (long) 5 >> (boolean) true
+283ms â•‘â•‘Calculating (boolean) false && (boolean) true >> (boolean) false
+300ms â•‘â•‘Calculating (enum) not present == (enum) present >> (boolean) false
+312ms â•‘â•‘Calculating (long) 22090149 / (long) 60000 >> (long) 368.16915
+315ms â•‘â•‘Calculating (long) 368 < (long) 5 >> (boolean) false
+318ms â•‘â•‘Calculating (boolean) false && (boolean) false >> (boolean) false
+323ms â•‘â•‘Calculating (dynamic) 0 + (dynamic) 0 >> (dynamic) 0
+324ms â•‘â•‘Evaluating switch with values [[i:133:null:0, v:[t:dynamic, v:0, vt:string]]]
+328ms â•‘â•‘Comparison (dynamic) 0 is (integer) 1 = false (2ms)
+334ms â•‘â•‘Comparison (dynamic) 0 is (integer) 2 = false (2ms)
+339ms â•‘â•‘Comparison (dynamic) 0 is (integer) 3 = false (1ms)
+420ms â•‘â•‘Calculating (string) At + (string) 11:39 A.M. >> (string) At 11:39 A.M.
+423ms ║║Calculating (string) At 11:39 A.M. + (string) . I put the house into >> (string) At 11:39 A.M… I put the house into
+427ms ║║Calculating (string) At 11:39 A.M… I put the house into + (string) Babysitter >> (string) At 11:39 A.M… I put the house into Babysitter
+430ms ║║Calculating (string) At 11:39 A.M… I put the house into Babysitter + (string) because everybody left and the babysitter is present. The vacuum is >> (string) At 11:39 A.M… I put the house into Babysitter because everybody left and the babysitter is present. The vacuum is
+433ms ║║Calculating (string) At 11:39 A.M… I put the house into Babysitter because everybody left and the babysitter is present. The vacuum is + (string) paused >> (string) At 11:39 A.M… I put the house into Babysitter because everybody left and the babysitter is present. The vacuum is paused
+435ms ║║Calculating (string) At 11:39 A.M… I put the house into Babysitter because everybody left and the babysitter is present. The vacuum is paused + (string) . >> (string) At 11:39 A.M… I put the house into Babysitter because everybody left and the babysitter is present. The vacuum is paused.
+462ms ║║Executed virtual command [Bedroom Light, Bedroom TV, Helen’s Closet Light, Justin’s Closet, MB Bath MS, MB J Bath 1, MB J Bath2].sendPushNotification (22ms)
+475ms â•‘â•‘Calculating (string) The location mode is + (string) Babysitter >> (string) The location mode is Babysitter
+479ms â•‘â•‘Calculating (string) The location mode is Babysitter + (string) and the alarm is >> (string) The location mode is Babysitter and the alarm is
+483ms â•‘â•‘Calculating (string) The location mode is Babysitter and the alarm is + (string) off >> (string) The location mode is Babysitter and the alarm is off
+488ms â•‘â•‘Calculating (string) The location mode is Babysitter and the alarm is off + (string) . >> (string) The location mode is Babysitter and the alarm is off.
+493ms ║║Executed virtual command [Bedroom Light, Bedroom TV, Helen’s Closet Light, Justin’s Closet, MB Bath MS, MB J Bath 1, MB J Bath2].setState (2ms)
+557ms ║║Comparison (time) 41996654 is_between (time) 1507547820000 … (time) 1507589940000 = true (9ms)
+558ms â•‘â•‘Time restriction check passed
+560ms â•‘â•‘Condition #121 evaluated true (63ms)
+561ms â•‘â•‘Condition group #113 evaluated true (state did not change) (64ms)
+562ms ║║Cancelling statement #113’s schedules…
+1162ms â•‘â•‘Executed physical command [Curtains].close() (597ms)
+1163ms â•‘â•‘Executed [Curtains].close (599ms)
+1181ms â•‘â•‘Comparison (time) 41997322 is_before (time) 1507564800000 = true (8ms)
+1182ms â•‘â•‘Time restriction check passed
+1184ms â•‘â•‘Condition #119 evaluated true (18ms)
+1185ms â•‘â•‘Condition group #117 evaluated true (state did not change) (19ms)
+1186ms ║║Cancelling statement #117’s schedules…
+2103ms â•‘â•‘Executed physical command [null].start() (915ms)
+2104ms â•‘â•‘Executed [Downstairs Vacuum].start (917ms)
+2107ms â•‘â•šExecution stage complete. (1882ms)
+2139ms â•šEvent processed successfully (2140ms)
10/9/2017, 11:39:46 AM +483ms
+0ms â•”Received event [Home].time = 1507563587498 with a delay of -1016ms
+411ms â•‘RunTime Analysis CS > 17ms > PS > 52ms > PE > 343ms > CE
+426ms â•‘Runtime (73781 bytes) successfully initialized in 52ms (v0.2.0f9.20171007) (424ms)
+427ms â•‘â•”Execution stage started
+468ms â•‘â•‘Calculating (enum) not present == (enum) present >> (boolean) false
+479ms â•‘â•‘Calculating (long) 60368 / (long) 60000 >> (long) 1.0061333333
+482ms â•‘â•‘Calculating (long) 1 < (long) 5 >> (boolean) true
+486ms â•‘â•‘Calculating (boolean) false && (boolean) true >> (boolean) false
+501ms â•‘â•‘Calculating (enum) not present == (enum) present >> (boolean) false
+512ms â•‘â•‘Calculating (long) 22080676 / (long) 60000 >> (long) 368.0112666667
+515ms â•‘â•‘Calculating (long) 368 < (long) 5 >> (boolean) false
+519ms â•‘â•‘Calculating (boolean) false && (boolean) false >> (boolean) false
+525ms â•‘â•‘Calculating (dynamic) 0 + (dynamic) 0 >> (dynamic) 0
+527ms â•‘â•‘Evaluating switch with values [[i:133:null:0, v:[t:dynamic, v:0, vt:string]]]
+531ms â•‘â•‘Comparison (dynamic) 0 is (integer) 1 = false (2ms)
+538ms â•‘â•‘Comparison (dynamic) 0 is (integer) 2 = false (2ms)
+545ms â•‘â•‘Comparison (dynamic) 0 is (integer) 3 = false (1ms)
+605ms â•‘â•‘Skipped execution of physical command [Bedroom Light].off([]) because it would make no change to the device. (3ms)
+605ms â•‘â•‘Executed [Bedroom Light].off (5ms)
+610ms â•‘â•‘Skipped execution of physical command [Bedroom TV].off([]) because it would make no change to the device. (3ms)
+611ms â•‘â•‘Executed [Bedroom TV].off (4ms)
+616ms ║║Skipped execution of physical command [Helen’s Closet Light].off([]) because it would make no change to the device. (2ms)
+617ms ║║Executed [Helen’s Closet Light].off (4ms)
+621ms ║║Skipped execution of physical command [Justin’s Closet].off([]) because it would make no change to the device. (2ms)
+622ms ║║Executed [Justin’s Closet].off (4ms)
+629ms â•‘â•‘Skipped execution of physical command [MB J Bath 1].off([]) because it would make no change to the device. (3ms)
+629ms â•‘â•‘Executed [MB J Bath 1].off (5ms)
+635ms â•‘â•‘Skipped execution of physical command [MB J Bath2].off([]) because it would make no change to the device. (4ms)
+636ms â•‘â•‘Executed [MB J Bath2].off (5ms)
+705ms ║║Executed virtual command [Bedroom Light, Bedroom TV, Helen’s Closet Light, Justin’s Closet, MB Bath MS, MB J Bath 1, MB J Bath2].setLocationMode (64ms)
+714ms ║║Executed virtual command [Bedroom Light, Bedroom TV, Helen’s Closet Light, Justin’s Closet, MB Bath MS, MB J Bath 1, MB J Bath2].wait (1ms)
+716ms â•‘â•‘Requesting a wake up for Mon, Oct 9 2017 @ 11:39:57 AM EDT (in 10.0s)
+727ms â•‘â•šExecution stage complete. (300ms)
+730ms â•‘Setting up scheduled job for Mon, Oct 9 2017 @ 11:39:57 AM EDT (in 9.988s)
+753ms â•šEvent processed successfully (752ms)
10/9/2017, 11:38:47 AM +163ms
+0ms â•”Received event [Helen].presence = not present with a delay of 573ms
+210ms â•‘RunTime Analysis CS > 33ms > PS > 44ms > PE > 133ms > CE
+225ms â•‘Runtime (73810 bytes) successfully initialized in 44ms (v0.2.0f9.20171007) (223ms)
+226ms â•‘â•”Execution stage started
+252ms â•‘â•‘Comparison (enum) present is (string) not present = false (1ms)
+254ms â•‘â•‘Condition #13 evaluated false (22ms)
+255ms â•‘â•‘Condition group #12 evaluated false (state did not change) (23ms)
+256ms â•‘â•‘Condition group #1 evaluated false (state did not change) (25ms)
+270ms â•‘â•‘Comparison (enum) not present changes_to (string) present = false (1ms)
+273ms ║║Cancelling condition #22’s schedules…
+274ms â•‘â•‘Condition #22 evaluated false (14ms)
+275ms ║║Cancelling condition #21’s schedules…
+276ms â•‘â•‘Condition group #21 evaluated false (state changed) (16ms)
+282ms â•‘â•‘Comparison (string) :7d26172d1ac50b98e0031196eaf2c2af: is (string) :3101233cb6a3896338af96d248600401: = false (2ms)
+283ms â•‘â•‘Condition #47 evaluated false (4ms)
+284ms â•‘â•‘Condition group #45 evaluated false (state did not change) (6ms)
+295ms â•‘â•‘Comparison (enum) not present is (string) not present = true (1ms)
+298ms â•‘â•‘Comparison (enum) not present is (string) not present = true (1ms)
+299ms â•‘â•‘Condition #53 evaluated true (12ms)
+311ms â•‘â•‘Comparison (enum) present is (string) present = true (2ms)
+313ms â•‘â•‘Condition #54 evaluated true (13ms)
+320ms â•‘â•‘Comparison (string) :7d26172d1ac50b98e0031196eaf2c2af: is_any_of (string) :3101233cb6a3896338af96d248600401:,:62cfeb32d55e4be236fd007df7e88b11:,:7d26172d1ac50b98e0031196eaf2c2af: = true (3ms)
+322ms â•‘â•‘Condition #55 evaluated true (7ms)
+323ms â•‘â•‘Condition group #52 evaluated true (state did not change) (36ms)
+324ms â•‘â•‘Condition group #51 evaluated true (state did not change) (37ms)
+327ms ║║Cancelling statement #56’s schedules…
+334ms ║║Executed virtual command [Bedroom Light, Bedroom TV, Helen’s Closet Light, Justin’s Closet, MB Bath MS, MB J Bath 1, MB J Bath2].wait (1ms)
+335ms â•‘â•‘Requesting a wake up for Mon, Oct 9 2017 @ 11:39:47 AM EDT (in 60.0s)
+340ms â•‘â•šExecution stage complete. (115ms)
+341ms â•‘Setting up scheduled job for Mon, Oct 9 2017 @ 11:39:47 AM EDT (in 59.994s)
+359ms â•šEvent processed successfully (360ms)
10/9/2017, 11:37:30 AM +632ms
+2ms â•”Received event [Helen].presence = present with a delay of 470ms
+231ms â•‘RunTime Analysis CS > 39ms > PS > 48ms > PE > 143ms > CE
+242ms â•‘Runtime (73777 bytes) successfully initialized in 48ms (v0.2.0f9.20171007) (239ms)
+243ms â•‘â•”Execution stage started
+269ms â•‘â•‘Comparison (enum) present is (string) not present = false (1ms)
+271ms â•‘â•‘Condition #13 evaluated false (20ms)
+272ms â•‘â•‘Condition group #12 evaluated false (state did not change) (22ms)
+272ms â•‘â•‘Condition group #1 evaluated false (state did not change) (23ms)
+285ms â•‘â•‘Comparison (enum) present changes_to (string) present = true (0ms)
+289ms ║║Cancelling condition #22’s schedules…
+290ms â•‘â•‘Condition #22 evaluated true (14ms)
+291ms ║║Cancelling condition #21’s schedules…
+291ms â•‘â•‘Condition group #21 evaluated true (state changed) (16ms)
+294ms ║║Cancelling statement #23’s schedules…
+334ms â•‘â•‘Executed virtual command setLocationMode (38ms)
+338ms â•‘â•‘Executed virtual command setVariable (1ms)
+344ms â•‘â•‘Executed virtual command setVariable (2ms)
+352ms â•‘â•‘Calculating (string) Helen + (string) Arrived - >> (string) Helen Arrived -
+355ms â•‘â•‘Calculating (string) Helen Arrived - + (string) Mon, Oct 9 2017 @ 11:37:30 AM EDT >> (string) Helen Arrived - Mon, Oct 9 2017 @ 11:37:30 AM EDT
+359ms â•‘â•‘Helen Arrived - Mon, Oct 9 2017 @ 11:37:30 AM EDT
+361ms â•‘â•‘Executed virtual command log (3ms)
+367ms â•‘â•‘Executed virtual command setVariable (2ms)
+371ms â•‘â•‘Executed virtual command wait (1ms)
+372ms â•‘â•‘Requesting a wake up for Mon, Oct 9 2017 @ 11:42:31 AM EDT (in 300.0s)
+376ms â•‘â•šExecution stage complete. (133ms)
+378ms â•‘Setting up scheduled job for Mon, Oct 9 2017 @ 11:42:31 AM EDT (in 299.995s)
+475ms â•šEvent processed successfully (475ms)
This is what I was looking for in another post. I just have the presence sensors but I couldn’t figure out how to incorporate multiple people arriving. Thanks!
Hope you were able to get it working for your situation. I went through a LOT of multiple people arrival pistons and none really worked all the time. I ended up with this which isn’t perfect, but it is pretty simple. I’m sure someone could improve it.
I took out the door sensor and adjusted for just 3 people and then put in a web request to have my sonos speak the Welcome Home. However, it didn’t speak. Any ideas why?
You need something to trigger on. I use the door that we always enter through. I don’t think you can trigger on a variable change. Aka… Use whatever the house uses to know you are in the house. Usually people use an entry door closing.
What about setting up a virtual switch and using that? So when someone comes home the switch turns on.
Using the presence sensors like the piston is fine to trigger on who has arrived. However to fire off an action, like speaking who is home. You really need a trigger that you have entered the house so the piston knows WHEN to speak who is home. You must have a man door or garage door?
See this thread…https://community.webcore.co/t/arrival-of-people-including-multiple-people-at-once/3275/5
Just looking at your piston again and I have a question…What is the 60000 in the dynamic variable stand for? Also, is the wait 5 minutes to wait to see who else arrives? Then it would say Welcome Home, right? If I wanted to adjust this time, would I need to adjust the dynamic variable equation also?
See the other thread too. Yes 5 minutes. It considers anyone “home” that has arrived within 5 minutes previous to the door(or motion sensor) being triggered to be “new”. 60000 = 5 minutes
you could do this with any presence sensor detecting presence also but that might get a little tricky because both statements will fire at the same time and the anyonehome might not be set to true yet.