Arrival of people including multiple people at once


#101

Thanks to @bangali this was what I was using:

format(random(“http://192.168.1.100:5005/sayall/Well look who is home! Hello big fella!/50”, “http://192.168.1.100:5005/sayall/Long time no see %s! Nice to have you back/50”, “http://192.168.1.100:5005/sayall/Well what a nice surprise %s! Nice to have you home/50”, “http://192.168.1.100:5005/sayall/Hey if it isn’t %s! How’s it goin?/50”, “http://192.168.1.100:5005/sayall/The Big Guy has arrived! Let’s hear it for %s!/50”), whoCameHome)

But that is putting it all in the GET expression. There has to be a way to do a GET request and incorporate the “announce” variable.


#102

ok so try putting this in the expression “http://192.168.1.100:5005/sayall/announce/50” or “http://192.168.1.100:5005/sayall/{announce}/50” try both also try it without the " "

its probably http://192.168.1.100:5005/sayall/{announce}/50

basically if the announce part changes colour when you put it in, it should work as its picking up the variable.

Edit:

just tested it you need to put this in as a expression

http://192.168.1.100:5005/sayall/{announce}/50


#103

instead of putting that in the get expression you could also set a variable to that expression and then use the variable as part of the get statement.

incorporating the announce variable will be the same as the way the whocamehome variable is used in the formatting.


#104

Did it work @pcgirl65?


#105

Sorry, I didn’t get notified that you had replied. I think it will work. I tested it on a test piston but haven’t yet had it fire with this piston. But it worked in the test piston. Thanks for all the help!


#106

So nothing worked. I didn’t get a push notification or any speach. Not sure why.


1/8/2018, 7:13:35 PM +273ms
+0ms ╔Received event [Home].time = 1515456816424 with a delay of -1152ms
+159ms ║RunTime Analysis CS > 13ms > PS > 42ms > PE > 105ms > CE
+163ms ║Runtime (56408 bytes) successfully initialized in 42ms (v0.2.101.20171227) (162ms)
+164ms ║╔Execution stage started
+177ms ║║Calculating (datetime) 1515456815446 - (datetime) 1515456786424 >> (datetime) 29022
+181ms ║║Comparison (datetime) 29022 is_greater_than (integer) 300000 = false (2ms)
+182ms ║║Cancelling condition #27’s schedules…
+183ms ║║Condition #27 evaluated false (12ms)
+184ms ║║Cancelling condition #24’s schedules…
+185ms ║║Condition group #24 evaluated false (state changed) (14ms)
+199ms ║║Condition #71 evaluated false (7ms)
+200ms ║║Condition group #11 evaluated false (state did not change) (9ms)
+211ms ║║Comparison (time) 69215476 happens_daily_at (datetime) 1515456786424 = true (5ms)
+212ms ║║Time restriction check passed
+213ms ║║Cancelling condition #49’s schedules…
+214ms ║║Condition #49 evaluated true (11ms)
+215ms ║║Cancelling statement #49’s schedules…
+220ms ║║Requesting time schedule wake up at Tue, Jan 9 2018 @ 7:13:36 PM EST
+234ms ║║Comparison (boolean) true is (boolean) false = false (1ms)
+235ms ║║Condition #48 evaluated false (13ms)
+236ms ║║Condition group #38 evaluated false (state did not change) (34ms)
+243ms ║║Comparison (integer) 0 is_greater_than (integer) 0 = false (1ms)
+245ms ║║Condition #65 evaluated false (5ms)
+246ms ║║Condition group #61 evaluated false (state did not change) (6ms)
+249ms ║╚Execution stage complete. (84ms)
+250ms ║Setting up scheduled job for Tue, Jan 9 2018 @ 7:13:36 PM EST (in 86400.902s)
+259ms ╚Event processed successfully (259ms)
1/8/2018, 7:13:06 PM +164ms
+2ms ╔Received event [Tom].presence = present with a delay of 111ms
+177ms ║RunTime Analysis CS > 25ms > PS > 55ms > PE > 97ms > CE
+181ms ║Runtime (56402 bytes) successfully initialized in 55ms (v0.2.101.20171227) (178ms)
+182ms ║╔Execution stage started
+188ms ║║Calculating (datetime) 1515456786350 - (datetime) 1515419213372 >> (datetime) 37572978
+191ms ║║Comparison (datetime) 37572978 is_greater_than (integer) 300000 = true (0ms)
+192ms ║║Condition #27 evaluated true (6ms)
+192ms ║║Condition group #24 evaluated true (state did not change) (7ms)
+194ms ║║Cancelling statement #25’s schedules…
+199ms ║║Executed virtual command setVariable (3ms)
+204ms ║║Executed virtual command setVariable (4ms)
+208ms ║║Cancelling statement #3’s schedules…
+217ms ║║Executed virtual command setVariable (3ms)
+226ms ║║Calculating (integer) 3 - (integer) 1 >> (integer) 2
+228ms ║║Comparison (integer) 2 is_inside_of_range (integer) 0 … (integer) 2 = true (1ms)
+229ms ║║Cancelling condition #8’s schedules…
+230ms ║║Condition #8 evaluated true (11ms)
+231ms ║║Cancelling condition #2’s schedules…
+231ms ║║Condition group #2 evaluated true (state changed) (12ms)
+233ms ║║Cancelling statement #34’s schedules…
+236ms ║║Calculating (dynamic) present == (dynamic) present >> (boolean) true
+241ms ║║Executed virtual command setVariable (3ms)
+252ms ║║Calculating (string) + (string) >> (string)
+254ms ║║Calculating (string) + (string) Tom >> (string) Tom
+259ms ║║Executed virtual command setVariable (3ms)
+263ms ║║Executed virtual command setVariable (2ms)
+273ms ║║Condition #71 evaluated false (7ms)
+274ms ║║Condition group #11 evaluated false (state did not change) (8ms)
+278ms ║║Comparison (time) 69186440 happens_daily_at (datetime) 1515456786424 = false (1ms)
+279ms ║║Condition #49 evaluated false (3ms)

+280ms ║║Cancelling statement #49’s schedules…
+282ms ║║Requesting time schedule wake up at Mon, Jan 8 2018 @ 7:13:36 PM EST
+283ms ║║Condition group #38 evaluated false (state did not change) (7ms)
+287ms ║║Comparison (integer) 0 is_greater_than (integer) 0 = false (1ms)
+288ms ║║Condition #65 evaluated false (3ms)
+289ms ║║Condition group #61 evaluated false (state did not change) (3ms)
+290ms ║╚Execution stage complete. (109ms)
+292ms ║Setting up scheduled job for Mon, Jan 8 2018 @ 7:13:36 PM EST (in 29.969s)
+302ms ╚Event processed successfully (302ms)

#107

Actually, it gave me the push notification when someone leaves. But the arrival doesn’t seem to be working. Any ideas?


#108

@borristhecat can you look at this piston and see if anything jumps out at you? Seems that the departures are working but not the arrivals.


#109

In your piston you have “Select the device you want to use to trigger the arrive message. It can be a contact sensor (on closed) or a motion sensor (on inactive).”

I am not sure I understand why you want the motion sensor to be inactive instead of active?


#110

Hi @pcgirl65, sorry only just seen your message. Yes I know what the problem is, you need to move the get up 2 steps before it clears the variables. It needs to be after the push or before.

It will work with active or inactive but inactive for me works better, my sensor is outside my door so I don’t want it to trigger untill I left that area. IE I’m though my door and it stops detecting.


#111

OK I moved the GET up. That makes sense. However, I am not getting any push notifications when people arrive at home also.


#112

@pcgirl65 the only other thing you changed to the actual piston was the active bit, correct? If you add a group in there like I had before so it says changes to active or changes to closed you can then add your virtual switch back in and use this as a test trigger (that’s why it was in there to cover people having sensors or contacts but also people could uses a virtual switch as a tester). Then you can use this to prove the piston and you can work out what the issue is.

I believe it’s because your using active then have the 10 second wait. So because active is only active for a short period it changes back to inactive before the timer has elapsed which then cancels the statement (another reason why I used inactive and why you use closed instead of open).

There are a few way to get over this if that is the case.

  1. If using active remove the wait under it.
  2. We can change the condition statement to never cancel.
  3. Use inactive

#113

OK, thanks I will play around with it.


#114

let me know how you get on.

Do you know how to do this?


#115

Grrr! I am still having issues. I wanted to put a condition on the GET so that it wouldn’t yell out at 6 am that someone had left:grin: So I moved that line and everything below to a new IF with conditions of time. However, it did not notify me when I left. I am noticing that ST Routines are not kicking in sometimes. I have a Routine to set mode to Away when everyone leaves and then things happen but lately it doesn’t always change the mode when we have all left. I am on my phone right now but I will play around with this when I get home.


#116

your have to post it so I can check but that’s what I used the modes as it seems to work better. shame the modes are not working, ill post below how to do it with times.

I was having the same issue for a while but think I have got my arive leave piston correct now, the only issue I now have is when the wife has stopped ST and it doesnt change from present to away.

This is how you would have to do it swap the speaker to location and add in your GET.


#117

So this is what I have right now. It gave me a push notification twice that Lauren was home. But it didn’t give me the speech. I am going to try and test it with a virtual switch.

1/10/2018, 5:54:18 PM +356ms
+0ms ╔Received event [Home].time = 1515624859567 with a delay of -1212ms
+168ms ║RunTime Analysis CS > 13ms > PS > 47ms > PE > 108ms > CE
+171ms ║Runtime (57354 bytes) successfully initialized in 47ms (v0.2.101.20171227) (170ms)
+172ms ║╔Execution stage started
+200ms ║║Executed virtual command setVariable (3ms)
+206ms ║║Comparison (time) 64458559 happens_daily_at (datetime) 1515624820287 = false (0ms)
+208ms ║║Condition #49 evaluated false (5ms)
+209ms ║║Cancelling statement #49’s schedules…
+212ms ║║Requesting time schedule wake up at Thu, Jan 11 2018 @ 5:54:10 PM EST
+215ms ║║Condition group #38 evaluated false (state did not change) (11ms)
+221ms ║║Comparison (integer) 1 is_greater_than (integer) 0 = true (2ms)
+222ms ║║Condition #65 evaluated true (5ms)
+223ms ║║Condition group #61 evaluated true (state did not change) (6ms)
+225ms ║║Cancelling statement #52’s schedules…
+243ms ║║Executed virtual command setVariable (4ms)
+261ms ║║Calculating (integer) 6 - (integer) -1 >> (integer) 7
+263ms ║║Calculating (integer) 7 - (integer) 2 >> (integer) 5
+269ms ║║Calculating (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 + (string) and >> (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and
+272ms ║║Calculating (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and + (string) auren >> (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and auren
+276ms ║║Calculating (integer) -1 > (integer) 0 >> (boolean) false
+281ms ║║Executed virtual command setVariable (2ms)
+298ms ║║Calculating (integer) 6 - (integer) -1 >> (integer) 7
+300ms ║║Calculating (integer) 7 - (integer) 2 >> (integer) 5
+307ms ║║Calculating (integer) 1 == (integer) 1 >> (boolean) true
+316ms ║║Calculating (integer) 1 == (integer) 1 >> (boolean) true
+322ms ║║Calculating (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 + (string) and >> (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and
+325ms ║║Calculating (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and + (string) auren >> (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and auren
+329ms ║║Calculating (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and auren + (string) are >> (string) java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and auren are
+332ms ║║Calculating (string) Lauren + (string) is >> (string) Lauren is
+335ms ║║Calculating (integer) -1 > (integer) 0 >> (boolean) false
+342ms ║║Executed virtual command setVariable (4ms)
+350ms ║║Calculating (integer) 1 == (integer) 1 >> (boolean) true
+354ms ║║Calculating (string) Lauren is + (string) now entering paradise! >> (string) Lauren is now entering paradise!
+358ms ║║Executed virtual command setVariable (3ms)
+369ms ║║Calculating (integer) 1 == (integer) 1 >> (boolean) true
+383ms ║║Calculating (integer) 1 == (integer) 2 >> (boolean) false
+388ms ║║Calculating (string) Look whos home, its + (string) Lauren >> (string) Look whos home, its Lauren
+391ms ║║Calculating (string) Look whos home, its Lauren + (string) , >> (string) Look whos home, its Lauren,
+393ms ║║Calculating (string) Look whos home, its Lauren, + (string) Lauren is >> (string) Look whos home, its Lauren, Lauren is
+396ms ║║Calculating (string) Look whos home, its Lauren, Lauren is + (string) home. >> (string) Look whos home, its Lauren, Lauren is home.
+401ms ║║Executed virtual command setVariable (3ms)
+427ms ║║Executed virtual command sendPushNotification (22ms)
+430ms ║╚Execution stage complete. (258ms)
+431ms ║Setting up scheduled job for Thu, Jan 11 2018 @ 5:54:10 PM EST (in 86391.5s)
+526ms ╚Event processed successfully (526ms)


#118

@pcgirl65 that won’t work you have the order wrong. Us the back up bin code from my piston on my last post and add your bits in again.

At the moment when it goes true it will push the message but then it won’t clear the variables. Then instead when it’s false it will speak the text and clear the variables but as you are not cleaning the variables it’s never going to run.

You are also putting the conditions on the last bit which you also don’t want you only want the time conditions on the speaker.

Use back up bin of kj7a that’s got the get in


#119

OK, I changed those lines at the bottom. In your piston I notice that on line 98 you have with “Speaker” and then you Do the variables for the push and speak notifications but actually nothing is being spoken until the next section which is between certain times. Is this a problem for me? Here is what I have now.


#120

Your getting there but it’s still positioned in the wrong place. Take another look at my piston above. Then look at your line 91 and your see the issue.

Yes I’ve just noticed you have also removed the speaker variable so this may also cause a issue. As your using the get it wouldn’t have mattered if you still had the speaker in the piston, it just would have sat there but because you have removed it it may cause issues.

You have also got the group again but only one thing in it your best bet is to start again. Use bin code

kj7a

that’s all set up for you, don’t change anything at 1st. Just add both your sensor and your virtual contact and your speaker if you don’t want the light don’t add anything to it. Then once it’s created click the light and change it to nothing selected. Then add your get string and test. Then we can tweak.

Also add your people and names