Thanks for this, Bryan. Question about how to use this for two people. Likely, it's overkill, but I have set up three child apps: one for each person and one for both. Is that necessary, or should I just have one child app that includes both?
A problem I've seen (may be related to the above) is when one presence arrives, I get greetings for both. Here's a log for just the child app of the presence sensor (Charles) that did not arrive. If I'm reading the log correctly, it's showing that sensor was not previously present, when it actually did not change.
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:29.010 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - Wow, that's it!
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:28.250 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - between2 = false - state.volume = 75 - Speaker = [Echo - FR Echo, Echo - Bathroom Dot, Echo - Kitchen Dot] - Echo Speakes = true
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:28.246 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - Quiet Time = No - Setting Normal time volume
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:28.234 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - In setVolume...
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:28.232 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - Music Player
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:28.230 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - Speaker(s) in use: [Echo - FR Echo, Echo - Bathroom Dot, Echo - Kitchen Dot]
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:28.218 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - AGAIN...Name = Charles
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:28.216 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - *********** In nameCount=1: myCount = 0
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:28.190 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - In getName...Number of Names: 1 - Names: [Charles]
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:28.189 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - In getName...
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:28.175 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - getGroup1 - randomKey1 = 6
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:28.056 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - In getGroup1...
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:28.047 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - Changed msgComp to lowercase = %random%
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:27.307 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - In compileMsg...message1 = %random%
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:27.226 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - Time is ok so can continue
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:27.178 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - In checkTime...
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:27.173 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - In talkNow1...
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:24.126 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - contact Status: = closed
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:21.310 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - Wait 6 seconds to Speak and canSpeak = yes
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:21.285 pm [info](http://192.168.1.140/installedapp/configure/1634)Charles Home - Charles just got here! Time Diff = 1
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:21.282 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - timeDiff: 1
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:21.254 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - lastActivity: 2019-01-27 13:11:18.354
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:21.232 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - Been Here: no
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:21.212 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - Presence Sensor Status - 1: present
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:21.175 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - In getTimeDiff1...
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:21.173 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - In contactSensorHandler...canSpeak: no
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:21.135 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - In contactSensorHandler...Pause: false
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:21.133 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - Continue - App NOT paused
[app:1634](http://192.168.1.140/logs#app1634)2019-01-27 01:12:21.131 pm [debug](http://192.168.1.140/installedapp/configure/1634)Charles Home - contact Status: = open
Hi, you should only need the one child app for both people. I have mine set up for 3 people using just one child app. That way it will greet the different number of people correctly using only one phrase.
ie.
if only 1 person comes home it would say 'greetings, welcome home Bryan'
if two people come home at the same time it would say, 'greetings, welcome home Bryan and Amy'
and if three people come home at the same time it would say, 'greetings, welcome home Bryan, Amy and Emma'
All from one child app!
Try it with the one child app and let me know how it goes. If you still have an issue please take a screenshot of the child app so I can see how you have it setup.
Note, multiple child apps can be used but usually its for different doors or the timing needs to be different.
thanks
edit: just noticed you're not on the latest version either... please be sure to update!
Thanks, if you select 10 it should randomize message 1 through 10. If you change it to 5, it'll randomize 1 through 5. All the messages are in the 'Advanced Section' of the parent app, be sure to take a look at them and hit the 'done' button for them to be usable.
That is a weird one. I would uninstall the app completely (all child and parent) and then reinstall. Also, make sure you are using the latest version of the app.
I would like to say, this is one of the more novel implementations of this functionality I've seen. My family really likes the randomized messaging and the concatenation of multiple arrivals.
There are five residents in our house. We do not all move as a group. Just as hearing who has arrived is useful, hearing who has departed is also very useful for those that remain in the house.
For a little more message variability I added four lines of code. I have added to the bottom of the getNames() routine:
is_are = (name.contains(' and ') ? 'are' : 'is')
has_have = (name.contains(' and ') ? 'have' : 'has')
And then I added this
if (msgComp.toLowerCase().contains("%is_are%")) {msgComp = msgComp.toLowerCase().replace('%is_are%', "${is_are}" )}
if (msgComp.toLowerCase().contains("%has_have%")) {msgComp = msgComp.toLowerCase().replace('%has_have%', "${has_have}" )}
to the compileMsg1() routine:
Now I can use the placeholders of %is_are% and %has_have% in the messages just like %greeting% and %name%. They provide either the singular or plural verb depending if there is a single presence change or multiple presence changes. for example:
Hello %name%. %name% %is_are% home.
would say:
Hello Matthew. Matthew is home. OR
Hello Matthew and Karin. Matthew and Karin are home.
Hello %name%. %name% %has_have% arrived.
would say:
Hello Matthew. Matthew has arrived. OR
Hello Matthew and Karin. Matthew and Karin have arrived.
Great! What you will need though is a restriction of when in away mode don't speak otherwise only the trees will here it . This can be a problem though as the restriction needs to be at the send to speaker command otherwise when you come home it may not evaluate because everything evaluated at the same time, was in away changed to home because someone arrived at the same time the app is booting up?
I have one child app for two people, named "Both Home". The app is shown below. And further down is the log for an instance where one is home long-term ("Charles") and one had just arrived ("Sandi"). The announcement that results was for both and the log indicated to me that each of the two was evaluated to be newly arrived. Your thoughts please?
Thanks, Bryan. Presence sensor "Charles" shows no log entries, either in the device events history or in system logs. The app log I copied above was a subset (just the WH child app) of a complete log page during the time; and nowhere in that log is any entry for the second presence sensor. It was home and never changed.