https://wiki.webcore.co/Expressions#Ternary_operator_.28_c_.3F_t_:f.29
Arrival of people including multiple people at once
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.
Thanks for keeping at this! Much too complicated for me! I will import and give it a go.
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?
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
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 . 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
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.
Yeah, I want the arrival to be triggered by the presence sensors (ie: iphones). How would I do that?
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.
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.
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.
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
You have the motion sensor detecting āinactiveā. I donāt see where it registers for when you are arriving?
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.
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.
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?