Arrival of people including multiple people at once


#141

Where is the 30 seconds?


#142

On Line 76, it has a comment about it on it


#143

Seems to be working good now! I was just thinking that I might be able to use my Ring Doorbell at the front door for motion as it would be a good trigger for people just coming into the house. that way I could have the wait time lower. What do you think? I will have to play with it.


#144

This is exactly what I use :smile: if you use this your need to go back to my original piston again (the one I made for you with the GET).

The only problem I have with the ring is it needed to be on normal sensitivity. Then because there is a road and path literally outside my door if I drive home I park on my garden opposite my house but if someone walks past before I get to the house it triggers. But I still get the push I just miss the speaker, that’s why I have the wait on the arrive, so I try and run into my house to catch it :laughing:.

I was also going to suggest something else with your motion sensor again that would have made it work better but your dog’s triggering it early would always be a issue so the ring is better idea :slight_smile:


#145

Aren’t we a funny lot of people! I am the same way! My kids and hubbie doesn’t care that the speakers greet them when they come home but I liked trying to get into the house to hear the greeting! Ha!


#146

Have you seen these! Strips! These look really cool! Just ordered one to put on my garage door which is the other door that people use to enter the home.


#147

Yeah seen them but over here their quite expensive. I’m going to be using standard reed switches for doors and the window then using them to trigger the fibaro binary sensors. That way it strengthens the z wave network, it will also allow me to put temperature probs around the house and I won’t have to replace the batterys. :smile:


#148

What are reed switches?


#149

Standard dumb security contacts that come as small bars or ones that get installed inside the door frame. They come in pairs one is a magnet the other the reed switch. But if I was starting again I would have looked at the new start up Konnected and used the reed switches.


#150

Wow! I didn’t know about the Konnected! That is exactly what I need as we moved into a house 3 years ago that had an old alarm system which we don’t use. I thought just the other day, wouldn’t it be nice to somehow integrate that into ST. I think I am going to pre-order one of these.


#151

yeah looks good don’t it :smile: if I had known about it I wouldn’t have brought so many universal binary sensors! It’s also a great time to get one as its still cheap as on the kickstarter.


#152

I have an issue where the variable ‘i’ is being initialized to -1 so it is throwing a IndexOutOfBounds error. Any help would be appreciated.

1/18/2018, 8:34:24 AM +329ms

+1ms ╔Received event [Scott Home].time = 1516289665203 with a delay of -874ms
+192ms ║RunTime Analysis CS > 15ms > PS > 39ms > PE > 138ms > CE
+197ms ║Runtime (59805 bytes) successfully initialized in 39ms (v0.2.102.20180116) (195ms)
+198ms ║╔Execution stage started
+210ms ║║Calculating (datetime) 1516289664535 - (datetime) 1516289635203 >> (datetime) 29332
+215ms ║║Comparison (datetime) 29332 is_greater_than (integer) 300000 = false (1ms)
+216ms ║║Condition #27 evaluated false (11ms)
+217ms ║║Condition group #24 evaluated false (state did not change) (13ms)
+244ms ║║Condition #20 evaluated false (20ms)
+261ms ║║Condition #56 evaluated false (17ms)
+262ms ║║Condition group #55 evaluated false (state did not change) (40ms)
+263ms ║║Condition group #11 evaluated false (state did not change) (41ms)
+273ms ║║Comparison (time) 30864595 happens_daily_at (datetime) 1516289635203 = true (4ms)
+274ms ║║Time restriction check passed
+276ms ║║Cancelling condition #49’s schedules…
+276ms ║║Condition #49 evaluated true (10ms)
+278ms ║║Cancelling statement #49’s schedules…
+282ms ║║Requesting time schedule wake up at Fri, Jan 19 2018 @ 8:34:25 AM MST
+295ms ║║Comparison (boolean) false is (boolean) false = true (2ms)
+296ms ║║Condition #48 evaluated true (12ms)
+297ms ║║Cancelling condition #38’s schedules…
+298ms ║║Condition group #38 evaluated true (state changed) (33ms)
+300ms ║║Cancelling statement #39’s schedules…
+306ms ║║Executed virtual command setVariable (3ms)
+313ms ║║Comparison (integer) 2 is_greater_than (integer) 0 = true (1ms)
+315ms ║║Cancelling condition #65’s schedules…
+316ms ║║Condition #65 evaluated true (6ms)
+317ms ║║Cancelling condition #61’s schedules…
+318ms ║║Condition group #61 evaluated true (state changed) (8ms)
+320ms ║║Cancelling statement #52’s schedules…
+338ms ║║Executed virtual command [Family Room Speaker, Lannouncer S8+].setVariable (2ms)
+364ms ║║Calculating (integer) 7 - (integer) -1 >> (integer) 8
+367ms ║║Calculating (integer) 8 - (integer) 2 >> (integer) 6
+373ms ║║Calculating (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 + (string) and >> (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and
+377ms ║║Calculating (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and + (string) ackson >> (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and ackson
+381ms ║║Calculating (integer) -1 > (integer) 0 >> (boolean) false
+386ms ║║Executed virtual command [Family Room Speaker, Lannouncer S8+].setVariable (3ms)
+405ms ║║Calculating (integer) 7 - (integer) -1 >> (integer) 8
+407ms ║║Calculating (integer) 8 - (integer) 2 >> (integer) 6
+415ms ║║Calculating (integer) 2 == (integer) 1 >> (boolean) false
+424ms ║║Calculating (integer) 2 == (integer) 1 >> (boolean) false
+430ms ║║Calculating (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 + (string) and >> (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and
+435ms ║║Calculating (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and + (string) ackson >> (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and ackson
+438ms ║║Calculating (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and ackson + (string) have >> (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and ackson have
+442ms ║║Calculating (string) Jackson + (string) has >> (string) Jackson has
+445ms ║║Calculating (integer) -1 > (integer) 0 >> (boolean) false
+451ms ║║Executed virtual command [Family Room Speaker, Lannouncer S8+].setVariable (3ms)
+460ms ║║Calculating (integer) 2 == (integer) 1 >> (boolean) false
+464ms ║║Calculating (string) Jackson has + (string) left home. >> (string) Jackson has left home.
+468ms ║║Executed virtual command [Family Room Speaker, Lannouncer S8+].setVariable (2ms)
+480ms ║║Calculating (integer) 2 == (integer) 1 >> (boolean) false
+494ms ║║Calculating (integer) 2 == (integer) 2 >> (boolean) true
+500ms ║║Calculating (string) Goodbye + (string) Jackson >> (string) Goodbye Jackson
+503ms ║║Calculating (string) Goodbye Jackson + (string) , >> (string) Goodbye Jackson,
+506ms ║║Calculating (string) Goodbye Jackson, + (string) Jackson has >> (string) Goodbye Jackson, Jackson has
+509ms ║║Calculating (string) Goodbye Jackson, Jackson has + (string) left. >> (string) Goodbye Jackson, Jackson has left.
+513ms ║║Executed virtual command [Family Room Speaker, Lannouncer S8+].setVariable (2ms)
+539ms ║║Executed virtual command [Family Room Speaker, Lannouncer S8+].sendNotificationToContacts (20ms)
+552ms ║║Comparison (time) 30864872 is_between (time) 21600000 … (time) 86340000 = true (7ms)
+553ms ║║Time restriction check passed
+555ms ║║Condition #75 evaluated true (12ms)
+555ms ║║Condition group #74 evaluated true (state did not change) (13ms)
+557ms ║║Cancelling statement #74’s schedules…
+837ms ║║Executed physical command [Family Room Speaker].speak([Goodbye Jackson, Jackson has left.]) (274ms)
+838ms ║║Executed [Family Room Speaker].speak (277ms)
+1797ms ║║Executed physical command [Lannouncer S8+].speak([Goodbye Jackson, Jackson has left.]) (957ms)
+1798ms ║║Executed [Lannouncer S8+].speak (958ms)
+1801ms ║║Cancelling statement #76’s schedules…
+1808ms ║║Executed virtual command setVariable (3ms)
+1813ms ║║Executed virtual command setVariable (2ms)
+1816ms ║╚Execution stage complete. (1618ms)
+1818ms ║Setting up scheduled job for Fri, Jan 19 2018 @ 8:34:25 AM MST (in 86399.057s)
+1827ms ╚Event processed successfully (1827ms)


#153

When you look at the piston in Webcore it shows that the variable for i is equal to -1 in the beginning. It then sets it later on in the piston.


Echo Arrival/Departure with voicemonkey
#154

your using a slightly different version of the piston but looks ok; once you have ran it it should clear correctly; are you still getting errors?


#155

I did take the latest version posted above and made some minor tweaks (my presence sensors, my speakers … nothing major different). It does seem to run and I am getting the results I expect. However when I look at the log I see the IndexOutOfBounds error and the variable ‘i’ is being set at -1? I am not positive, but I believe it may be set in this statement:
set variable {i} = indexOf(pSensors, $currentEventDevice)

I am guessing that it is not finding $currentEventDevice in the pSensor array so it is set to -1? I have not had time to continue to debug this, but my guess is the variable {i} is then reset later on and therefore the rest of the script works?? When I look at the list of local variables and their values (on the right hand side of the piston dashboard) it shows that {i} is equal to -1, even after the piston has been run multiple times.

Hopefully I will have some time this weekend to continue to look into this.


#156

Yes this is supposed to happen as, @bangali did the original code hes the man to speak to. But as I understand it this bit works out which person has left and how many have left.
You don’t need to worry that the variable is stored at -1 at the end of the piston eather as everytime it runs it rechek’s it and changes it if its needed. Your find if more than one person leaves it will change.


#157

Thanks. As I said the piston does seem to be performing the functions properly. I was just concerned that I fat-fingered something when I saw the error in the logs. I will monitor and ignore as long as it still continue to function. Thanks for your input.


#158

that should not happen. that section of the code is only executed for the named presence sensors so it should always find the indexof value.

it could be happening on the lastindexof statement further down. if you have time to debug this further please let me know.

thanks.


#159

Okay. Went back to the piston I was using when I first noticed the error in the log. I have added logs for the variables so I could see what they were at trhe time it runs and the Piston is below:

I think it is the lastIndexOf(who[whoI], ) on line 152 that is the problem as that is evaluating to -1 … but I do not know why?

|+2ms|╔Received event [Scott Home].time = 1516481285036 with a delay of -908ms|

|—|---|
|+225ms|║RunTime Analysis CS > 19ms > PS > 77ms > PE > 128ms > CE|
|+229ms|║Runtime (65837 bytes) successfully initialized in 77ms (v0.2.102.20180116) (225ms)|
|+230ms|║╔Execution stage started|
|+242ms|║║Calculating (datetime) 1516481284366 - (datetime) 1516481255036 >> (datetime) 29330|
|+251ms|║║Comparison (datetime) 29330 is_greater_than (integer) 300000 = false (6ms)|
|+252ms|║║Cancelling condition #27’s schedules…|
|+253ms|║║Condition #27 evaluated false (16ms)|
|+254ms|║║Cancelling condition #24’s schedules…|
|+255ms|║║Condition group #24 evaluated false (state changed) (18ms)|
|+258ms|║║Cancelling statement #77’s schedules…|
|+266ms|║║Calculating (string) LOG: The value of i is = + (string) 0 >> (string) LOG: The value of i is = 0|
|+269ms|║║Calculating (string) LOG: The value of i is = 0 + (string) (line 59) >> (string) LOG: The value of i is = 0 (line 59)|
|+273ms|║║LOG: The value of i is = 0 (line 59)|
|+274ms|║║Executed virtual command log (2ms)|
|+300ms|║║Condition #20 evaluated false (20ms)|
|+316ms|║║Condition #56 evaluated false (15ms)|
|+318ms|║║Condition group #55 evaluated false (state did not change) (37ms)|
|+319ms|║║Condition group #11 evaluated false (state did not change) (39ms)|
|+328ms|║║Comparison (time) 49684450 happens_daily_at (datetime) 1516481255036 = true (4ms)|
|+330ms|║║Time restriction check passed|
|+331ms|║║Cancelling condition #49’s schedules…|
|+332ms|║║Condition #49 evaluated true (11ms)|
|+342ms|║║Cancelling statement #49’s schedules…|
|+347ms|║║Requesting time schedule wake up at Sun, Jan 21 2018 @ 1:48:05 PM MST|
|+360ms|║║Comparison (boolean) false is (boolean) false = true (2ms)|
|+361ms|║║Cancelling condition #48’s schedules…|
|+362ms|║║Condition #48 evaluated true (13ms)|
|+363ms|║║Cancelling condition #38’s schedules…|
|+364ms|║║Condition group #38 evaluated true (state changed) (43ms)|
|+367ms|║║Cancelling statement #39’s schedules…|
|+373ms|║║Executed virtual command setVariable (3ms)|
|+380ms|║║Comparison (integer) 2 is_greater_than (integer) 0 = true (2ms)|
|+382ms|║║Cancelling condition #65’s schedules…|
|+383ms|║║Condition #65 evaluated true (6ms)|
|+384ms|║║Cancelling condition #61’s schedules…|
|+385ms|║║Condition group #61 evaluated true (state changed) (8ms)|
|+387ms|║║Cancelling statement #81’s schedules…|
|+395ms|║║Calculating (string) LOG: The value of i is = + (string) 0 >> (string) LOG: The value of i is = 0|
|+398ms|║║Calculating (string) LOG: The value of i is = 0 + (string) (line 143) >> (string) LOG: The value of i is = 0 (line 143)|
|+402ms|║║LOG: The value of i is = 0 (line 143)|
|+403ms|║║Executed virtual command log (1ms)|
|+406ms|║║Cancelling statement #52’s schedules…|
|+439ms|║║Calculating (integer) 7 - (integer) 0 >> (integer) 7|
|+442ms|║║Calculating (integer) 7 - (integer) 2 >> (integer) 5|
|+449ms|║║Calculating (string) + (string) and >> (string) and|
|+453ms|║║Calculating (string) and + (string) eyson >> (string) and eyson|
|+456ms|║║Calculating (integer) 0 > (integer) 0 >> (boolean) false|
|+464ms|║║Executed virtual command [Family Room Speaker, Lannouncer S8+].setVariable (4ms)|
|+472ms|║║Calculating (string) LOG: The value of whoI is = + (string) 2 >> (string) LOG: The value of whoI is = 2|
|+475ms|║║Calculating (string) LOG: The value of whoI is = 2 + (string) (Line 150) >> (string) LOG: The value of whoI is = 2 (Line 150)|
|+479ms|║║LOG: The value of whoI is = 2 (Line 150)|
|+480ms|║║Executed virtual command [Family Room Speaker, Lannouncer S8+].log (2ms)|
|+488ms|║║Calculating (string) LOG: The value of who[whoI] is = + (string) Greyson >> (string) LOG: The value of who[whoI] is = Greyson|
|+491ms|║║Calculating (string) LOG: The value of who[whoI] is = Greyson + (string) (Line 151) >> (string) LOG: The value of who[whoI] is = Greyson (Line 151)|
|+495ms|║║LOG: The value of who[whoI] is = Greyson (Line 151)|
|+496ms|║║Executed virtual command [Family Room Speaker, Lannouncer S8+].log (1ms)|
|+513ms|║║Calculating (string) ) is = + (string) -1 >> (string) ) is = -1|
|+516ms|║║Calculating (string) ) is = -1 + (string) (Line 152) >> (string) ) is = -1 (Line 152)|
|+519ms|║║Calculating (string) LOG: The value of lastIndexOf(who[whoI], , (string) ) is = -1 (Line 152) >> (string) LOG: The value of lastIndexOf(who[whoI], ) is = -1 (Line 152)|
|+524ms|║║LOG: The value of lastIndexOf(who[whoI], ) is = -1 (Line 152)|
|+525ms|║║Executed virtual command [Family Room Speaker, Lannouncer S8+].log (1ms)|
|+535ms|║║Executed virtual command [Family Room Speaker, Lannouncer S8+].setVariable (3ms)|
|+543ms|║║Calculating (string) LOG: The value of i is = + (string) -1 >> (string) LOG: The value of i is = -1|
|+546ms|║║Calculating (string) LOG: The value of i is = -1 + (string) (Line 154) >> (string) LOG: The value of i is = -1 (Line 154)|
|+550ms|║║LOG: The value of i is = -1 (Line 154)|
|+551ms|║║Executed virtual command [Family Room Speaker, Lannouncer S8+].log (1ms)|
|+570ms|║║Calculating (integer) 7 - (integer) -1 >> (integer) 8|
|+573ms|║║Calculating (integer) 8 - (integer) 2 >> (integer) 6|
|+581ms|║║Calculating (integer) 2 == (integer) 1 >> (boolean) false|
|+593ms|║║Calculating (integer) 2 == (integer) 1 >> (boolean) false|
|+603ms|║║Calculating (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 + (string) and >> (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and|
|+610ms|║║Calculating (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and + (string) reyson >> (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and reyson|
|+617ms|║║Calculating (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and reyson + (string) have >> (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and reyson have|
|+622ms|║║Calculating (string) Greyson + (string) has >> (string) Greyson has|
|+626ms|║║Calculating (integer) -1 > (integer) 0 >> (boolean) false|
|+632ms|║║Executed virtual command [Family Room Speaker, Lannouncer S8+].setVariable (3ms)|
|+640ms|║║Calculating (integer) 2 == (integer) 1 >> (boolean) false|
|+644ms|║║Calculating (string) Greyson has + (string) left home. >> (string) Greyson has left home.|
|+649ms|║║Executed virtual command [Family Room Speaker, Lannouncer S8+].setVariable (3ms)|
|+661ms|║║Calculating (integer) 2 == (integer) 1 >> (boolean) false|
|+675ms|║║Calculating (integer) 2 == (integer) 2 >> (boolean) true|
|+680ms|║║Calculating (string) Farewell + (string) Greyson >> (string) Farewell Greyson|
|+683ms|║║Calculating (string) Farewell Greyson + (string) , >> (string) Farewell Greyson,|
|+686ms|║║Calculating (string) Farewell Greyson, + (string) Greyson has >> (string) Farewell Greyson, Greyson has|
|+689ms|║║Calculating (string) Farewell Greyson, Greyson has + (string) gone out. >> (string) Farewell Greyson, Greyson has gone out.|
|+694ms|║║Executed virtual command [Family Room Speaker, Lannouncer S8+].setVariable (2ms)|
|+778ms|║║Executed virtual command [Family Room Speaker, Lannouncer S8+].sendNotificationToContacts (79ms)|
|+791ms|║║Comparison (time) 49684910 is_between (time) 21600000 … (time) 86340000 = true (7ms)|
|+793ms|║║Time restriction check passed|
|+795ms|║║Condition #75 evaluated true (14ms)|
|+796ms|║║Condition group #74 evaluated true (state did not change) (15ms)|
|+798ms|║║Cancelling statement #74’s schedules…|
|+1328ms|║║Executed physical command [Family Room Speaker].speak([Farewell Greyson, Greyson has gone out.]) (523ms)|
|+1329ms|║║Executed [Family Room Speaker].speak (524ms)|
|+2126ms|║║Executed physical command [Lannouncer S8+].speak([Farewell Greyson, Greyson has gone out.]) (795ms)|
|+2127ms|║║Executed [Lannouncer S8+].speak (797ms)|
|+2130ms|║║Cancelling statement #76’s schedules…|
|+2136ms|║║Executed virtual command setVariable (4ms)|
|+2142ms|║║Executed virtual command setVariable (2ms)|
|+2146ms|║║Cancelling statement #84’s schedules…|
|+2155ms|║║Calculating (string) LOG: The value of i is = + (string) -1 >> (string) LOG: The value of i is = -1|
|+2158ms|║║Calculating (string) LOG: The value of i is = -1 + (string) (line 187) >> (string) LOG: The value of i is = -1 (line 187)|
|+2162ms|║║LOG: The value of i is = -1 (line 187)|
|+2163ms|║║Executed virtual command log (1ms)|
|+2167ms|║╚Execution stage complete. (1936ms)|
|+2168ms|║Setting up scheduled job for Sun, Jan 21 2018 @ 1:48:05 PM MST (in 86398.74s)|
|+2176ms|╚Event processed successfully (2176ms)|


#160

change that line to:

set i = (contains(who[whoI], ‘,’) ? lastIndexOf(who[whoI], ‘,’) : -1)