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

Hi @bptworld,

thanks for your work - this looks really good. Just a thought:

I have an LG TV that is able to display push notifications (via LG WebOS TV Driver).

While the TV is on, I prefer to receive visual notifications on the TV instead of voice announcements. I do this using Rule Machine rules (if TV is on, send push notification, if TV is off, announce via speaker), but this is not very easy to maintain.

Maybe this is something that you'd be interested to add to Follow me?

Best,
Jan

Interesting idea. Added to the list.

2 Likes

That is a shame. You can see the status of whether it is 'idle' or 'Playing', however when you are in a video call it just shows as 'idle'. Guess I'll have to setup a google mini for notifications in addition to the Google Display. The wife is going to love that! More gadgets around the home.

1 Like

Might I suggest a code change. When you specify 12 hour time, no AM/PM is shown. I've changed the following change to getDateTime

if(hourType == true) newdate=date.format("MM-d hh:mm")

to:
if(hourType == true) newdate=date.format("MM-d hh:mm A")

Also, I don't know if this was on purpose, but I notice you ignore the NumOfLines when building the time. This code fixes that and prevents the tile from overflowing.

    int intNumOfLines = numOfLines
    if (listSize1 > intNumOfLines) state.list1.removeAt(intNumOfLines)

    String result1 = state.list1.join(";")
    def lines1     = result1.split(";")

    if(logEnable) log.debug "In makeList - All - listSize1: ${listSize1}"
    if(logEnable) log.debug "In makeList - All - intNumOfLines: ${intNumOfLines}"

    theData1 = "<table><tr><td align='left'><div style='font-size:${fontSize}px;font-family:Lucida Sans Typewriter'>"
    for (i=0; i<intNumOfLines && i<listSize1 && theData1.length() < 990;i++)
         theData1 += "${lines1[i]}<br>"
    theData1 += "</div></td></tr></table>"
    if(logEnable) log.debug "theData1 - ${theData1.replace("<","!")}"

This is inserted into populateMap replacing original lines 288 (if) -- 312 (close paren). Ping me if you have any questions.

Alan

This was strictly a character count decision. Have to balance between readability and data.

My tile code has been working great for over a year now. :wink: I'll take a look at your modified code though, always a better way of doing things. Thanks.

No problem. Just was playing with the tile and found the (non-)issue. Hope it works out.

Found a minor issue. Exceeded the 1024 limit. Corrected for loop. (this is the real code that does all the work).

    for (i=0; i<intNumOfLines && i<listSize1 && theData1.length() < 990;i++) {
        if ((theData1.length() + lines1[i].length()) > 990) break
        theData1 += "${lines1[i]}<br>"
    }

Bryan,, Error when updating with HPM

Error Occurred During Installation

An error occurred while installing the package: Failed to upgrade app https://raw.githubusercontent.com/bptworld/Hubitat/master/Apps/Follow%20Me/FM-child.groovy.

Thanks, should work now

Following up in here to say I just updated this code to the latest...I was on code from I think a year ago...however...It's been working great...and now seems to have a few more options...and I like the queue! Finally implemented sounds. This is a MUST HAVE app in my opinion if you want to do voice notifications. Thanks Bryan!

2 Likes

Forgive me if this error is in the thread somewhere but I couldn't find it. Getting this one repeatedly but announcements seem to be working fine.

app:1332020-05-10 04:47:45.154 pm errorjava.lang.IllegalArgumentException: Command 'setVolumeSpeakAndRestore' is not supported by device. on line 668 (startHandler)

dev:1292020-05-10 04:47:45.135 pm errorjava.lang.NullPointerException: Cannot invoke method put() on null object on line 365 (sendFollowMeSpeaker)

dev:1292020-05-10 04:47:45.125 pm errorjava.lang.NullPointerException: Cannot invoke method put() on null object on line 365 (sendFollowMeSpeaker)

app:1352020-05-10 04:47:45.109 pm errorjava.lang.IllegalArgumentException: Command 'setVolumeSpeakAndRestore' is not supported by device. on line 668 (startHandler)

app:1342020-05-10 04:47:45.093 pm errorjava.lang.IllegalArgumentException: Command 'setVolumeSpeakAndRestore' is not supported by device. on line 668 (startHandler)

dev:1292020-05-10 04:47:45.090 pm errorjava.lang.NullPointerException: Cannot invoke method put() on null object on line 365 (sendFollowMeSpeaker)

I'll need to see a debug log not just the errors. Thanks

dev:542020-05-10 09:58:04.428 pm infoOffice Lights was turned off

dev:742020-05-10 09:58:04.374 pm inforcvd: OUTPUT,2,1,0.00

dev:1032020-05-10 09:58:03.265 pm infoSonos One Sonos is stopped

dev:1032020-05-10 09:58:02.521 pm infoSonos One Sonos is playing

dev:1032020-05-10 09:58:02.394 pm infoSonos One Sonos audio level is 70%

dev:1032020-05-10 09:58:02.231 pm infoSonos One Sonos playing: lights on by Hubitat from TTS

dev:1032020-05-10 09:58:01.956 pm infoSonos One Sonos audio level is 100%

app:1292020-05-10 09:58:01.921 pm debugIn beforeVolume - Setting volume to 100

app:1292020-05-10 09:58:01.806 pm debugIn beforeVolume (2.1.4)

app:1292020-05-10 09:58:01.800 pm debugIn letsTalk - (speak) playTextAndRestore - Sonos One Sonos - message: lights on

app:1292020-05-10 09:58:01.795 pm debugIn letsTalk - speak - speaker: Sonos One Sonos - Using best case handler

app:1292020-05-10 09:58:01.792 pm debugIn priorityVoicesHandler - Speaker: Sonos One Sonos - priorityVoice: 0 - Voice: null - Message: lights on - uriMessage: http://192.168.50.62/tts/f745c2563e9f5b4de4043e945ea0715a.mp3

app:1292020-05-10 09:58:01.787 pm debugIn priorityVoicesHandler - New uri: http://192.168.50.62/tts/f745c2563e9f5b4de4043e945ea0715a.mp3

app:1292020-05-10 09:58:01.780 pm debugIn priorityVoicesHandler (2.1.4) - priorityVoice: 0, so skipping

dev:1292020-05-10 09:58:01.772 pm errorjava.lang.NullPointerException: Cannot invoke method put() on null object on line 365 (sendFollowMeSpeaker)

app:1292020-05-10 09:58:01.749 pm debugIn letsTalk - continuing

app:1292020-05-10 09:58:01.746 pm debugIn checkPriority - priorityValue: H - Priority volume: 100

app:1292020-05-10 09:58:01.744 pm debugIn checkPriority (2.1.4)

app:1292020-05-10 09:58:01.741 pm debugIn checkVol (2.1.4)

app:1292020-05-10 09:58:01.738 pm debugIn checkTime - timeBetween: true

app:1292020-05-10 09:58:01.736 pm debugIn checkTime (2.1.4) - null - null

dev:1292020-05-10 09:58:01.733 pm errorjava.lang.NullPointerException: Cannot invoke method put() on null object on line 365 (sendFollowMeSpeaker)

app:1292020-05-10 09:58:01.700 pm debugIn alwaysOnHandler (2.1.4) - setting sZone to true

app:1292020-05-10 09:58:01.697 pm debugIn letsTalk - msg: {"method":"speak","message":"lights on","priority":"H:0","speakLevel":null,"returnLevel":null,"title":""}

app:1292020-05-10 09:58:01.694 pm debugIn letsTalkQueue (2.1.4) - Queue not activated, going to letsTalk

app:1292020-05-10 09:58:01.691 pm debugIn startHandler (2.1.4)

app:1292020-05-10 09:58:01.688 pm debug********** Follow Me (2.1.4) - Start Talking **********

app:1322020-05-10 09:58:01.474 pm infoAction: Speak on What Did I Say: '[H:0]lights on'

app:1322020-05-10 09:58:01.451 pm infoLights on Triggered

app:1322020-05-10 09:58:01.439 pm infoLights on: Office Lights switch on

dev:542020-05-10 09:58:01.349 pm infoOffice Lights was set to 100%

dev:742020-05-10 09:58:01.293 pm inforcvd: OUTPUT,2,1,100.00

dev:542020-05-10 09:57:59.483 pm infoOffice Lights was turned off

dev:742020-05-10 09:57:59.431 pm inforcvd: OUTPUT,2,1,0.00

Do me a favor and post a screenshot of your app list showing the Follow Me section.

ie.

FWIW, the current HE Sonos driver is fubar for playTextAndRestore and often causes TTS volume to lower during play. It appears that's whats causing your issues @awagsii.

New Version on GitHub...

Made a few changes to driver and child app. Lets see what happens.

New driver on GitHub...

2.1.4 - 05/12/20 - All tiles now scroll

Thanks works fine anyway though.

I don't know if it is just my screen. But when you open the "What did I say" device. The screen is acting really strange. It will all show, Then you scroll down and some things disappear.

First open the device "What did I say"

Summary

After a few seconds:

Summary