Arrival of people including multiple people at once


#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)


#161

I made that change and the error remains the same???

`|+1ms|╔Received event [Garage Entry Door].contact = closed with a delay of 85ms|

|—|---|
|+194ms|║RunTime Analysis CS > 14ms > PS > 38ms > PE > 143ms > CE|
|+199ms|║Runtime (66788 bytes) successfully initialized in 38ms (v0.2.102.20180116) (197ms)|
|+200ms|║╔Execution stage started|
|+212ms|║║Calculating (datetime) 1516503255910 - (datetime) 1516503052998 >> (datetime) 202912|
|+216ms|║║Comparison (datetime) 202912 is_greater_than (integer) 300000 = false (2ms)|
|+218ms|║║Condition #27 evaluated false (12ms)|
|+219ms|║║Condition group #24 evaluated false (state did not change) (13ms)|
|+222ms|║║Cancelling statement #77’s schedules…|
|+230ms|║║Calculating (string) LOG: The value of i is = + (string) 0 >> (string) LOG: The value of i is = 0|
|+233ms|║║Calculating (string) LOG: The value of i is = 0 + (string) (line 59) >> (string) LOG: The value of i is = 0 (line 59)|
|+238ms|║║LOG: The value of i is = 0 (line 59)|
|+238ms|║║Executed virtual command log (1ms)|
|+263ms|║║Comparison (enum) closed changes_to (string) closed = true (1ms)|
|+265ms|║║Cancelling condition #20’s schedules…|
|+266ms|║║Condition #20 evaluated true (22ms)|
|+267ms|║║Cancelling condition #55’s schedules…|
|+268ms|║║Condition group #55 evaluated true (state changed) (24ms)|
|+275ms|║║Comparison (boolean) false is (boolean) false = true (2ms)|
|+277ms|║║Cancelling condition #29’s schedules…|
|+278ms|║║Condition #29 evaluated true (9ms)|
|+279ms|║║Cancelling condition #11’s schedules…|
|+280ms|║║Condition group #11 evaluated true (state changed) (37ms)|
|+282ms|║║Cancelling statement #12’s schedules…|
|+286ms|║║Executed virtual command wait (1ms)|
|+287ms|║║Waiting for 3000ms|
|+3294ms|║║Executed virtual command setVariable (3ms)|
|+3301ms|║║Comparison (time) 71659000 happens_daily_at (datetime) 1516503052998 = false (0ms)|
|+3303ms|║║Condition #49 evaluated false (5ms)|
|+3304ms|║║Cancelling statement #49’s schedules…|
|+3308ms|║║Requesting time schedule wake up at Sun, Jan 21 2018 @ 7:51:22 PM MST|
|+3310ms|║║Condition group #38 evaluated false (state did not change) (13ms)|
|+3318ms|║║Comparison (integer) 1 is_greater_than (integer) 0 = true (1ms)|
|+3319ms|║║Cancelling condition #65’s schedules…|
|+3320ms|║║Condition #65 evaluated true (7ms)|
|+3321ms|║║Cancelling condition #61’s schedules…|
|+3322ms|║║Condition group #61 evaluated true (state changed) (9ms)|
|+3324ms|║║Cancelling statement #81’s schedules…|
|+3333ms|║║Calculating (string) LOG: The value of i is = + (string) 0 >> (string) LOG: The value of i is = 0|
|+3335ms|║║Calculating (string) LOG: The value of i is = 0 + (string) (line 143) >> (string) LOG: The value of i is = 0 (line 143)|
|+3340ms|║║LOG: The value of i is = 0 (line 143)|
|+3340ms|║║Executed virtual command log (1ms)|
|+3343ms|║║Cancelling statement #52’s schedules…|
|+3558ms|║║Calculating (integer) 7 - (integer) 0 >> (integer) 7|
|+3561ms|║║Calculating (integer) 7 - (integer) 2 >> (integer) 5|
|+3570ms|║║Calculating (string) + (string) and >> (string) and|
|+3575ms|║║Calculating (string) and + (string) eyson >> (string) and eyson|
|+3579ms|║║Calculating (integer) 0 > (integer) 0 >> (boolean) false|
|+3588ms|║║Executed virtual command [Family Room Speaker, Lannouncer S8+].setVariable (3ms)|
|+3598ms|║║Calculating (string) LOG: The value of whoI is = + (string) 1 >> (string) LOG: The value of whoI is = 1|
|+3601ms|║║Calculating (string) LOG: The value of whoI is = 1 + (string) (Line 150) >> (string) LOG: The value of whoI is = 1 (Line 150)|
|+3607ms|║║LOG: The value of whoI is = 1 (Line 150)|
|+3607ms|║║Executed virtual command [Family Room Speaker, Lannouncer S8+].log (1ms)|
|+3618ms|║║Calculating (string) LOG: The value of who[whoI] is = + (string) Greyson >> (string) LOG: The value of who[whoI] is = Greyson|
|+3622ms|║║Calculating (string) LOG: The value of who[whoI] is = Greyson + (string) (Line 151) >> (string) LOG: The value of who[whoI] is = Greyson (Line 151)|
|+3626ms|║║LOG: The value of who[whoI] is = Greyson (Line 151)|
|+3627ms|║║Executed virtual command [Family Room Speaker, Lannouncer S8+].log (1ms)|
|+3645ms|║║Calculating (decimal) 0.0 - (decimal) 1.0 >> (decimal) -1.0|
|+3651ms|║║Calculating (string) ) : -1) is = + (string) -1 >> (string) ) : -1) is = -1|
|+3655ms|║║Calculating (string) ) : -1) is = -1 + (string) (Line 152) >> (string) ) : -1) is = -1 (Line 152)|
|+3658ms|║║Calculating (string) LOG: The value of (contains(who[whoI], , (string) ) ? lastIndexOf(who[whoI], >> (string) LOG: The value of (contains(who[whoI], ) ? lastIndexOf(who[whoI],|
|+3660ms|║║Calculating (string) LOG: The value of (contains(who[whoI], ) ? lastIndexOf(who[whoI], , (string) ) : -1) is = -1 (Line 152) >> (string) LOG: The value of (contains(who[whoI], ) ? lastIndexOf(who[whoI], ) : -1) is = -1 (Line 152)|
|+3665ms|║║LOG: The value of (contains(who[whoI], ) ? lastIndexOf(who[whoI], ) : -1) is = -1 (Line 152)|
|+3665ms|║║Executed virtual command [Family Room Speaker, Lannouncer S8+].log (1ms)|
|+3679ms|║║Calculating (decimal) 0.0 - (decimal) 1.0 >> (decimal) -1.0|
|+3685ms|║║Executed virtual command [Family Room Speaker, Lannouncer S8+].setVariable (3ms)|
|+3693ms|║║Calculating (string) LOG: The value of i is = + (string) -1 >> (string) LOG: The value of i is = -1|
|+3696ms|║║Calculating (string) LOG: The value of i is = -1 + (string) (Line 154) >> (string) LOG: The value of i is = -1 (Line 154)|
|+3700ms|║║LOG: The value of i is = -1 (Line 154)|
|+3701ms|║║Executed virtual command [Family Room Speaker, Lannouncer S8+].log (1ms)|
|+3721ms|║║Calculating (integer) 7 - (integer) -1 >> (integer) 8|
|+3723ms|║║Calculating (integer) 8 - (integer) 2 >> (integer) 6|
|+3731ms|║║Calculating (integer) 1 == (integer) 1 >> (boolean) true|
|+3741ms|║║Calculating (integer) 1 == (integer) 1 >> (boolean) true|
|+3747ms|║║Calculating (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 + (string) and >> (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and|
|+3751ms|║║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|
|+3755ms|║║Calculating (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and reyson + (string) are >> (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and reyson are|
|+3759ms|║║Calculating (string) Greyson + (string) is >> (string) Greyson is|
|+3763ms|║║Calculating (integer) -1 > (integer) 0 >> (boolean) false|
|+3769ms|║║Executed virtual command [Family Room Speaker, Lannouncer S8+].setVariable (3ms)|
|+3777ms|║║Calculating (integer) 1 == (integer) 1 >> (boolean) true|
|+3781ms|║║Calculating (string) Greyson is + (string) now at home. >> (string) Greyson is now at home.|
|+3786ms|║║Executed virtual command [Family Room Speaker, Lannouncer S8+].setVariable (3ms)|
|+3799ms|║║Calculating (integer) 1 == (integer) 1 >> (boolean) true|
|+3814ms|║║Calculating (integer) 1 == (integer) 2 >> (boolean) false|
|+3820ms|║║Calculating (string) Welcome home + (string) Greyson >> (string) Welcome home Greyson|
|+3823ms|║║Calculating (string) Welcome home Greyson + (string) , >> (string) Welcome home Greyson,|
|+3826ms|║║Calculating (string) Welcome home Greyson, + (string) Greyson is >> (string) Welcome home Greyson, Greyson is|
|+3829ms|║║Calculating (string) Welcome home Greyson, Greyson is + (string) home. >> (string) Welcome home Greyson, Greyson is home.|
|+3833ms|║║Executed virtual command [Family Room Speaker, Lannouncer S8+].setVariable (2ms)|
|+3854ms|║║Executed virtual command [Family Room Speaker, Lannouncer S8+].sendNotificationToContacts (15ms)|
|+3867ms|║║Comparison (time) 71659559 is_between (time) 21600000 … (time) 86340000 = true (7ms)|
|+3868ms|║║Time restriction check passed|
|+3869ms|║║Condition #75 evaluated true (12ms)|
|+3870ms|║║Condition group #74 evaluated true (state did not change) (14ms)|
|+3871ms|║║Cancelling statement #74’s schedules…|
|+4106ms|║║Executed physical command [Family Room Speaker].speak([Welcome home Greyson, Greyson is home.]) (229ms)|
|+4107ms|║║Executed [Family Room Speaker].speak (231ms)|
|+4149ms|║║Executed physical command [Lannouncer S8+].speak([Welcome home Greyson, Greyson is home.]) (40ms)|
|+4150ms|║║Executed [Lannouncer S8+].speak (42ms)|
|+4153ms|║║Cancelling statement #76’s schedules…|
|+4159ms|║║Executed virtual command setVariable (3ms)|
|+4165ms|║║Executed virtual command setVariable (2ms)|
|+4168ms|║║Cancelling statement #84’s schedules…|
|+4176ms|║║Calculating (string) LOG: The value of i is = + (string) -1 >> (string) LOG: The value of i is = -1|
|+4179ms|║║Calculating (string) LOG: The value of i is = -1 + (string) (line 187) >> (string) LOG: The value of i is = -1 (line 187)|
|+4183ms|║║LOG: The value of i is = -1 (line 187)|
|+4184ms|║║Executed virtual command log (1ms)|
|+4188ms|║╚Execution stage complete. (3987ms)|
|+4189ms|║Setting up scheduled job for Sun, Jan 21 2018 @ 7:51:22 PM MST (in 86223.107s)|
|+4203ms|╚Event processed successfully (4202ms)|
`


#162

This piston has been working fairly well with multiple people coming and going. The only problem that it is having is in the speech part. Some weird sentences are happening. For instance when my hubby came home it said “What’s up Tom. Tom is” and this one "Hello Hope you had a good day Tom, Tom is Lets here it for ". I have gone through the random phrases but I can’t find the problem. Some other eyes on this maybe…


#163

The problem in the last part of line 92. There are two issues: 1) It appears as if you have an opening statement in the closing statement random line. You have 'Lets here it for 'as one of the statements and when you look at the other choice that are all closing statements (‘in the house.’, ‘is here.’) You should move the ‘Lets here is for’ to the opening statement random clause earlier in the expression (before the ‘+ Name +’ part).

  1. There is a closing comma right after 'Lets here is for ’ that should not be there. I believe that is interpreted as a blank option in the random clause so the result is when the random selection is the blank clause you get ‘Tom is’ with nothing else. Remove the comma between ‘Lets here it for’ and the closing parenthesis in the Random clause and that should fix it.

Hope that helps.


#164

Thanks! I will look at this tomorrow as the Raptors are going to start soon:grin:


#166

hey @pcgirl65 I tweaked it a bit so its easier for you to change the messages, I also added your extra words as i was looking for other ideas anyway :smile:


#167

Thanks I will try this!


#168

Here is my latest version adapted from all of the good work created by others in this thread. I have added additional ‘random’ phrases as a small contribution to the effort.

I also want to capture the current speaker volume setting (level?) before the announcement is made, set the level for the announcement, speak the announcement, then return the level to its original setting. I attempted this code, but have not been able to test it. I don’t know if this will work as I have four Fabriq speakers defined in my ‘Speaker’ group. Ideally each speaker will do this independently (each setting and then returning to it’s prior volume level setting after the announcement). I want to prevent someone from turning the volume all the way down (or up) on the speaker and therefore affecting the announcement volume level. It you know a better, or proper way, to accomplish this, I would greatly appreciate the advice.

Thanks.