[RELEASE] Follow Me - Speaker control with priority messaging, volume controls, voices and sound files!

Hi Barry,
The way that this works is 'What did I say' accepts in the Speech (regardless of how it was sent) and then sends it to 'Follow Me'. FM then tries to see what commands the speaker accepts.

The goal is to:

  • If speaker is Active (ie. room is occupied)
  • set the volume
  • play a sound (optional - google/sonos can, echo's can't)
  • Speak (with optional change voice - google/sonos can, echo's can't)
  • restore the volume

To meet that goal, Follow Me tries the following (in order)...

  • setVolumeSpeakAndRestore (Echo)
  • playTrackAndRestore (Sonos)
  • playTrack (Google/Nest)
  • playTextAndRestore (Sonos)
  • speak (any)

This allows FM to work with just about any speakers and still meet the goal. For echo devices setVolumeSpeakAndRestore gives the most bang for the buck so that's why it is used.

Hope this makes sense!

New version on Github...

V1.3.2 - 08/02/19 - Rewrite of letsTalk and speaker handlers

Bryan -

It makes sense - I totally get what you're doing. But still doesn't support the complete feature set of Echo Speaks.

playAnnouncement() isn't the same as speak() or playTrack() or anything else - it specifically has Echo play the Notification tone ("bee-boop"), followed by the TTS text I specify - and the options allow me to specify what displays on the Echo Show devices, and control the announcement volume and the volume the Echo is reset to.

Your current code doesn't allow for any of that.

Now, of course, I can modify your code to do everything I want, but then I have to maintain your code for myself. If instead you add support for the additional commands that Echo Speaks supports, then your Follow Me will allow me to have playAnnouncement() follow me around the house, while not breaking anything for other users who may not choose to use playAnnouncement()

Further, adding 'Notification' capability and the deviceNotification command would allow ANY app that supports notifications (but not speech/TTS/playTrack) to have spoken notifications follow them around when using Echo and/or other TTS devices.

Alternately, I can make the changes to your code and send them to you for incorporation in your baseline. Or, simply post a fork that does what I want, for other to consider...

I'll probably just make the changes myself anyway. I'll send them to you for consideration...I was just hoping you would want to make your solution support as many use cases as possible - Echo Speaks is far, far more that just an alternative to a Speech Synthesis (or Music Player) device...

TTFN!

With the last update, for some reason sonos just repeats the wrong text. The sound is still being chopped around 1s even though I have it for 10s. The WDIS driver shows the right text though.

Just recreated the child app...now it just says "N"...ignores the text [N]This is a test

no go on google.

Echo Dot from (echo speaks) is also reporting an error now:

Other than the text being cleared (it repeats N, which is from [N2] This is a test) the sound DOES seem to be getting my 4s pause...but I had to change my time from 4 to 4000. In the prior build, the code was scaling it to 4000.

image

Here's my log with a few extra debug of my own (just learning).

image

If i make the below change the speech is correct. So, that along with changing the pause by *1000 seems to be working for me now.

image

After the above change, seems to work but not in every scenario. Sometimes it still just repeats the last message.

Hi ,

I am still having problems with this app.

I have gone to the extent of doing a full reset on the hub and starting from scratch.

I have setup the latest version of your app with a followme child instance that simply announces when the bedroom window is opened. I send the speech message to my virtual 'What Did I Say' device. I get the following error in my log:-

The message is being sent correctly to the 'What Did I Say' device

Any ideas?

Thanks, state.lastSpokenFULL was in two places ... which is why it worked some of the time and not others. I was testing a few things and looks like I forgot to change it back. Also, reworked how the sound length gets calculated.

@CurtisZM, thanks...hopefully this fixes your errors too

@dwspmail, this version has some major problems. sorry.

Will have a new version up shortly.

Thank you for all your hard work and effort..

New version on Github...

V1.3.3 - 08/03/19 - Fixed several typos, reworked how the sound length gets calculated. Also, first attempt at adding playAnnouncement for Echo devices.

@storageanarchy, Please check out the additions for echo devices. The only echo device I have to test with is an original echo (the pringles can looking thing!). I can run the announcement test from Echo Speaks and it works but when I try to use the playAnnouncement command it shows "OOPS... Text to Speech is NOT Supported by this Device!!!" in the logs. Since I'm sure you're a better coder than I, please take a look at the new 'playAnnouncementHandler' section and see what might be wrong.

edit: looks like I broke something with echo completely. The old way is telling me Oops too. I'll have to dig in later.

Thanks

See my PM to you...

Echo Speaks went through a lot of circles around setting the volume before and after all of the various speech/TTS/announcement options. Ultimately, it almost never would work if you tried to setLevel, then speak, the reset the level. This is why Anthony created the variants of the standard calls that include the pre- and post- levels. I provided some suggestions on how you might support those with the WDIS+Follow Me combo in my PM to you...I don't think the current implementation is going to work like you intended.

I really don't think we want to configure a "room" such that EVERY message is an Echo playAnnouncement() - ideally it's an option based on which entry point was called to send the message - think of it as a priority level where certain messages are "announcements" and others are simply "statements". Again, my PM describes how you might implement this.

Related, the desire isn't to show the entire message on an Echo Show, but instead to allow the caller to specify what gets displayed. For example, the spoken message might be "The dishwasher cycle is finished", while the title displayed on the Echo Show would be "Dishwasher finished at 9:12am" - the spoken message doesn't need the date/time info (it happened now), but having the actual time appear on the Show also gets it logged.

We can discuss further via PM, if you'd like...

1 Like

Google Home is not working:

Another new version on Github...

V1.3.4 - 08/03/19 - Trying to fix Google/Nest devices that are not using Priority settings (@CurtisZM) . Fixed sound 10 from playing sound 1, If using sound 10 please re-enter the information (it's now called sound 0).

More changes coming... stay tuned

from V1.3.4 (Google Home Mini)

BTW- Where do you setup sounds?

@CurtisZM, can you take some screenshots of the child app, so I can recreate it here.

Thanks

HOLD ON, I see it...

change line 723 to defaultSpeechHandler(it)

it's missing the it, which holds the speaker info

Thanks

Google is working now

Great to hear! I only use Google/Nest in my house and mine was working just fine so it was hard to see why yours wasn't working until I realized from the screenshots that your not using priority message options.

Hi,

All seems to be working my end now. Thanks for your efforts.

1 Like

Chromecast error:

Echo works with playAnnouncement not setVolumeSpeakandRestore.

:wink: one problem at a time...