[Deprecated] Welcome Home

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! :grin:

1 Like

Awesome app btw!

So I created the child app and it does not seem to do any other message besides #10.

Section in child app for random:

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.

I did do this. Unfortunately it continues to only okay one message and it is the #10 message each time.

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 have reinstalled. And I am using your latest on GitHub.

Just did a quick test and as you can see in the picture, everything is working fine with the app...
welcome%20home%20example

Can you post some screenshots of your advanced section of the parent app and then of the child app?

thanks

Giving it a try since you have added Echo Speaks compatibility. Are there plans for a companion 'Farewell Home' app (announce departures)?

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.

Nicely done.

2 Likes

What would the purpose of this be? You wouldn't be home to hear it!?

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.

2 Likes

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.

1 Like

Nice job! I'll add it in to the next release.

Will start working on this soon. :grin:

1 Like

brilliant this is more like my original WC piston that me and bangali did and he put in his app :slight_smile: it makes it much more of a nicer phase :smile:

Great! What you will need though is a restriction of when in away mode don't speak otherwise only the trees will here it :wink:. 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?

2019-02-03 02:46:11.450 pm infoSandi has arrived
_________________

2019-02-03 02:47:21.235 pm debugBoth Home - Wait 6 seconds to Speak and canSpeak = no
2019-02-03 02:47:21.232 pm debugBoth Home - timeDiff: 1
2019-02-03 02:47:21.228 pm debugBoth Home - lastActivity: 2019-02-03 14:46:11.434
2019-02-03 02:47:21.222 pm debugBoth Home - Been Here: yes
2019-02-03 02:47:21.219 pm debugBoth Home - Presence Sensor Status - 2: present
2019-02-03 02:47:21.214 pm debugBoth Home - In getTimeDiff2...
2019-02-03 02:47:21.212 pm debugBoth Home - timeDiff: 1
2019-02-03 02:47:21.211 pm debugBoth Home - lastActivity: 2019-02-03 14:46:11.46
2019-02-03 02:47:21.209 pm debugBoth Home - Been Here: yes
2019-02-03 02:47:21.189 pm debugBoth Home - Presence Sensor Status - 1: present
2019-02-03 02:47:21.169 pm debugBoth Home - In getTimeDiff1...
2019-02-03 02:47:21.168 pm debugBoth Home - In contactSensorHandler...canSpeak: no
2019-02-03 02:47:21.160 pm debugBoth Home - In contactSensorHandler...Pause: false
2019-02-03 02:47:21.158 pm debugBoth Home - Continue - App NOT paused
2019-02-03 02:47:21.157 pm debugBoth Home - contact Status: = open
2019-02-03 02:47:07.212 pm debugBoth Home - Wow, that's it!
2019-02-03 02:47:06.871 pm debugBoth Home - between2 = true - state.volume = 40 - Speaker = [Echo - FR Echo, Echo - Bathroom Dot, Echo - Kitchen Dot, Echo - Back Porch Dot] - Echo Speakes = true
2019-02-03 02:47:06.869 pm debugBoth Home - Quiet Time = Yes - Setting Quiet time volume
2019-02-03 02:47:06.867 pm debugBoth Home - In setVolume...
2019-02-03 02:47:06.866 pm debugBoth Home - Music Player
2019-02-03 02:47:06.864 pm debugBoth Home - Speaker(s) in use: [Echo - FR Echo, Echo - Bathroom Dot, Echo - Kitchen Dot, Echo - Back Porch Dot]
2019-02-03 02:47:06.858 pm debugBoth Home - AGAIN...Name = Sandi and Charles !
2019-02-03 02:47:06.857 pm debugBoth Home - *********** In nameCount=2: myCount = 1
2019-02-03 02:47:06.855 pm debugBoth Home - *********** In nameCount=2: myCount = 0
2019-02-03 02:47:06.853 pm debugBoth Home - In getName...Number of Names: 2 - Names: [Sandi, Charles]
2019-02-03 02:47:06.851 pm debugBoth Home - In getName...
2019-02-03 02:47:06.850 pm debugBoth Home - Greeting = Good Afternoon
2019-02-03 02:47:06.848 pm debugBoth Home - timeampm = pm - timehh = 2
2019-02-03 02:47:06.846 pm debugBoth Home - timeHH = 2
2019-02-03 02:47:06.839 pm debugBoth Home - In getGreeting...
2019-02-03 02:47:06.837 pm debugBoth Home - getGroup1 - randomKey1 = 1
2019-02-03 02:47:06.784 pm debugBoth Home - In getGroup1...
2019-02-03 02:47:06.783 pm debugBoth Home - Changed msgComp to lowercase = %random%
2019-02-03 02:47:06.781 pm debugBoth Home - In compileMsg...message1 = %random%
2019-02-03 02:47:06.780 pm debugBoth Home - Time is ok so can continue
2019-02-03 02:47:06.763 pm debugBoth Home - In checkTime...
2019-02-03 02:47:06.761 pm debugBoth Home - In talkNow1...
2019-02-03 02:47:04.524 pm debugBoth Home - contact Status: = closed
2019-02-03 02:47:00.733 pm debugBoth Home - Wait 6 seconds to Speak and canSpeak = yes
2019-02-03 02:47:00.732 pm infoBoth Home - Charles just got here! Time Diff = 1
2019-02-03 02:47:00.730 pm debugBoth Home - timeDiff: 1
2019-02-03 02:47:00.728 pm debugBoth Home - lastActivity: 2019-02-03 14:46:11.434
2019-02-03 02:47:00.707 pm debugBoth Home - Been Here: no
2019-02-03 02:47:00.705 pm debugBoth Home - Presence Sensor Status - 2: present
2019-02-03 02:47:00.698 pm debugBoth Home - In getTimeDiff2...
2019-02-03 02:47:00.696 pm infoBoth Home - Sandi just got here! Time Diff = 1
2019-02-03 02:47:00.695 pm debugBoth Home - timeDiff: 1
2019-02-03 02:47:00.654 pm debugBoth Home - lastActivity: 2019-02-03 14:46:11.46
2019-02-03 02:47:00.653 pm debugBoth Home - Been Here: no
2019-02-03 02:47:00.651 pm debugBoth Home - Presence Sensor Status - 1: present
2019-02-03 02:47:00.597 pm debugBoth Home - In getTimeDiff1...
2019-02-03 02:47:00.596 pm debugBoth Home - In contactSensorHandler...canSpeak: no
2019-02-03 02:47:00.594 pm debugBoth Home - In contactSensorHandler...Pause: false
2019-02-03 02:47:00.592 pm debugBoth Home - Continue - App NOT paused
2019-02-03 02:47:00.591 pm debugBoth Home - contact Status: = open

Looking at that log, both presence sensors came home at the same time...

2019-02-03 02:47:00.696 pm infoBoth Home - Sandi just got here! Time Diff = 1
2019-02-03 02:47:00.695 pm debugBoth Home - timeDiff: 1
2019-02-03 02:47:00.654 pm debugBoth Home - lastActivity: 2019-02-03 14:46:11.46

2019-02-03 02:47:00.732 pm infoBoth Home - Charles just got here! Time Diff = 1
2019-02-03 02:47:00.730 pm debugBoth Home - timeDiff: 1
2019-02-03 02:47:00.728 pm debugBoth Home - lastActivity: 2019-02-03 14:46:11.434

You can take a look at the events page for each sensor to see if anything funny was going on around that time.

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.