Arrival of people including multiple people at once


#76

https://wiki.webcore.co/Expressions#Ternary_operator_.28_c_.3F_t_:f.29


#77

BOOOM thank you @bangali ! After more playing I have got it working perfectly. I have added another variable to make it easier to right the text you want, as well as a push variable so you can say something different on the messages to the speaker. @pcgirl65 if you import this instead and change the words and add your GET this should fix your issue.

I have the speaker set to only play during certain modes as well so that it doesnā€™t shout after 10pm and before 8 am (my night mode) but still pushes a notification. It also doesnā€™t speak if noone is there to hear it ie in away mode. So just add the modes you want it to speak in.

Only thing left to do now is to take it one step further and announce where the people have gone using the webCore presence sensor. :grin:


#78

Thanks for keeping at this! Much too complicated for me! I will import and give it a go.


#79

So is the ā€œannounceā€ variable for the text you want to speak? If so, could I set it as a GET request with a random statement?


#80

Yes and yes the names variable is who came home or left so if there is one it just says there name, if there is 2 it say X and y and more than 3 X, y and z. So just add that too your string or random comments.

Then if you want the correct grammar after the name the nameIsAre does that, so on arrive it will say X is or X and y are or X, Y and Z are ( in the house) and on depart it will say X has or X and Y have or X, Y and Z have ( left the house). That make sense?

Iā€™ll work on a random part to it later when I get it ready to make it easier to import, then it will do it all for you and you just put the variable anounce in the your GET


#81

All done @pcgirl65 the announce variable now has random phases and as it has two sets of random for the 1st and 2nd part it is truly random what it come up with :smile:. Iā€™ve tested it a few times and it works great. you should just need to put that variable in your GET string.


Announcement Piston help
#82

Awesome! I will get it setup and test it out! Thanks for working on it!


#83

great let me know how it goes :grinning:


#84

I donā€™t have a contact sensor so do I need to have that in the piston?


#85

No, I donā€™t have one yet as well, but think like me you have a PIR by your door? Thatā€™s what Iā€™m using, you need something to trigger the speech but you could have the presence arrival trigger it like it is for departure but just increase the time so that your in the house before it trigger.


#86

Yeah, I want the arrival to be triggered by the presence sensors (ie: iphones). How would I do that?


#87

Change line 67-69 to time happens daily at say 2 minutes past {lastnow}

Your need to play around with the minutes and increase it untill itā€™s correct for you. Thatā€™s why itā€™s better to use a contact sensor or motion sensor as then itā€™s sure your in the house.


#88

Ok I could use a virtual sensor and have it turned on and then off at the end of the piston. My hubbie just came home and it didnā€™t send me a push notification. But ST seems to be having a delay on updating the status of presence. The logs recognized that he was home though.


#89

Post a traced green stapshot of the piston on here so I can check whatā€™s happening.

In reference to the pressence sensor, Iā€™m using @ady624 WebCoRE sensor, itā€™s still in beta and still needs a bit of work to it to make it perfect but for me itā€™s better than the standard ST one.


#90

part of the log:

1/7/2018, 11:27:28 AM +340ms
+1ms ā•”Starting pistonā€¦ (v0.2.101.20171227)
+456ms ā•‘ā•”Subscribing to devicesā€¦
+500ms ā•‘ā•‘Subscribing to Jane.presenceā€¦
+524ms ā•‘ā•‘Subscribing to Lauren.presenceā€¦
+543ms ā•‘ā•‘Subscribing to Tom.presenceā€¦
+568ms ā•‘ā•‘Subscribing to Home/Away Button.contactā€¦
+715ms ā•‘ā•‘Subscribing to Kitchen Sonosā€¦
+716ms ā•‘ā•šFinished subscribing (288ms)
+749ms ā•‘Calculating (datetime) 1515342449085 - (datetime) 1515340330790 >> (datetime) 2118295
+754ms ā•‘Comparison (datetime) 2118295 is_greater_than (integer) 300000 = true (1ms)
+755ms ā•‘Cancelling condition #27ā€™s schedulesā€¦
+756ms ā•‘Cancelling condition #24ā€™s schedulesā€¦
+778ms ā•‘Calculating (integer) 3 - (integer) 1 >> (integer) 2
+786ms ā•‘Comparison (integer) 2 is_inside_of_range (integer) 0 ā€¦ (integer) 2 = true (5ms)
+809ms ā•‘Comparison (boolean) false is (boolean) false = true (1ms)
+812ms ā•‘Cancelling condition #29ā€™s schedulesā€¦
+822ms ā•‘Comparison (time) 41249158 happens_daily_at (datetime) 1515340330790 = false (1ms)
+823ms ā•‘Cancelling condition #49ā€™s schedulesā€¦
+828ms ā•‘Cancelling statement #49ā€™s schedulesā€¦
+831ms ā•‘Requesting time schedule wake up at Mon, Jan 8 2018 @ 10:52:40 AM EST
+854ms ā•‘Comparison (boolean) true is (boolean) false = false (1ms)
+862ms ā•‘Comparison (integer) 0 is_greater_than (integer) 0 = false (1ms)
+877ms ā•‘Setting up scheduled job for Mon, Jan 8 2018 @ 10:52:40 AM EST (in 84311.575s)
+1027ms ā•šPiston successfully started (1026ms)
1/7/2018, 10:52:39 AM +284ms
+1ms ā•”Received event [Home].time = 1515340360790 with a delay of -1506ms
+144ms ā•‘RunTime Analysis CS > 17ms > PS > 58ms > PE > 69ms > CE
+148ms ā•‘Runtime (56509 bytes) successfully initialized in 58ms (v0.2.101.20171227) (146ms)
+149ms ā•‘ā•”Execution stage started
+161ms ā•‘ā•‘Calculating (datetime) 1515340359441 - (datetime) 1515340330790 >> (datetime) 28651
+166ms ā•‘ā•‘Comparison (datetime) 28651 is_greater_than (integer) 300000 = false (2ms)
+168ms ā•‘ā•‘Cancelling condition #27ā€™s schedulesā€¦
+168ms ā•‘ā•‘Condition #27 evaluated false (13ms)
+170ms ā•‘ā•‘Cancelling condition #24ā€™s schedulesā€¦
+170ms ā•‘ā•‘Condition group #24 evaluated false (state changed) (15ms)
+186ms ā•‘ā•‘Condition #20 evaluated false (8ms)
+186ms ā•‘ā•‘Condition group #55 evaluated false (state did not change) (10ms)
+187ms ā•‘ā•‘Condition group #11 evaluated false (state did not change) (11ms)
+194ms ā•‘ā•‘Comparison (time) 39159475 happens_daily_at (datetime) 1515340330790 = true (1ms)
+195ms ā•‘ā•‘Time restriction check passed
+196ms ā•‘ā•‘Cancelling condition #49ā€™s schedulesā€¦
+197ms ā•‘ā•‘Condition #49 evaluated true (7ms)
+203ms ā•‘ā•‘Cancelling statement #49ā€™s schedulesā€¦
+207ms ā•‘ā•‘Requesting time schedule wake up at Mon, Jan 8 2018 @ 10:52:40 AM EST
+222ms ā•‘ā•‘Comparison (boolean) true is (boolean) false = false (1ms)
+223ms ā•‘ā•‘Condition #48 evaluated false (14ms)
+224ms ā•‘ā•‘Condition group #38 evaluated false (state did not change) (34ms)
+231ms ā•‘ā•‘Comparison (integer) 0 is_greater_than (integer) 0 = false (1ms)
+232ms ā•‘ā•‘Condition #65 evaluated false (5ms)
+233ms ā•‘ā•‘Condition group #61 evaluated false (state did not change) (7ms)
+236ms ā•‘ā•šExecution stage complete. (87ms)
+237ms ā•‘Setting up scheduled job for Mon, Jan 8 2018 @ 10:52:40 AM EST (in 86401.269s)
+246ms ā•šEvent processed successfully (245ms)
1/7/2018, 10:52:10 AM +506ms
+2ms ā•”Received event [Tom].presence = present with a delay of 96ms
+159ms ā•‘RunTime Analysis CS > 17ms > PS > 62ms > PE > 79ms > CE
+162ms ā•‘Runtime (56499 bytes) successfully initialized in 62ms (v0.2.101.20171227) (159ms)
+163ms ā•‘ā•”Execution stage started


#91

Is this for iphones?


#92

You have the motion sensor detecting ā€œinactiveā€. I donā€™t see where it registers for when you are arriving?


#93

Both android and IOS.

You can change it to active if you want but most become active when your there then inactive once you pass. For me as the sensor is outside, once it becomes inactive Iā€™m in the building and can hear the speaker, I donā€™t want it to speak when I walking up to the door.


#94

Is contact sensor 1 a virtual device? triggered by your presence, hence why the 3 min wait? If it is there is a easier way to do it, let me know and iā€™ll show you.

On line 65 you removed the inactive but didnā€™t remove the group, donā€™t know why as I canā€™t see why it would, but i did that on another piston and it caused a issue. your need to click on the ( then delete and re add the contact sensor changed to closed (or copy it and past it) back in the right place.


#95

Yes contact sensor is a virtual switch. I donā€™t need it though if I use my motion sensor in the front hall that will catch us when we enter the house. I had put the 3 minutes wait in to make time for us to get into the house before speaking but actually using the motion sensor is a better way. What do you think?