[(OBSOLETE See 1.1.10 or later) 1.1.8 10/11/16] Big Talker - Talk when events occur

Can you install a separate instance using the development version and see if it works for you?

The latest development version can be found here:
https://raw.githubusercontent.com/rayzurbock/SmartThings-BigTalker/development/smartapps/rayzurbock/big-talker-dev.src/big-talker-dev.groovy

Please don’t overwrite your current version with this version as this is for development and testing, you can install this version as a separate instance.

Some have asked for the ability to disable resume when using BigTalker in musicPlayer mode with devices such as Sonos, VLC-Thing, etc…

If you do not mind testing code that is in development, please check this thread for the the latest update regarding this specific feature request https://github.com/rayzurbock/SmartThings-BigTalker/issues/2

This development version is intended for users that wish to assist in testing and providing feedback/troubleshooting. This is scoped to be the next release (yes, 2.0 is still in the works; I am sorry for the delay. I’ve been pretty busy at home as well as work and for a while each time I went to program SmartThings platform had some issue come up that discouraged further development).

Other updates from the current 1.1.8 standard release include but are not limited to (this list is still being compiled and these are somewhat in order of commits (code saves) to this development branch which started at 1.1.9a1 on 10/17/2016 and as of 3/6/2017 is at 1.1.9a3.6):

  • Additional Talk() debug logging
  • Test variables for null with safe navigation operator (?) in more places within Talk().
  • Attempt to resolve musicPlayer playing text and resuming/restoring.
  • Clear state.polledDevices on initialize
  • In musicPlayer mode, def Talk() now gives currentTrack.status precedence over currentStatus if it exists as it seems more accurate in testing based on feedback.
  • If default speech volume was not set, speech may not have occurred due to a null variable issue. Resolved with groovy safe navigation operator
  • Partnered with @MichaelS; Added AskAlexa support (send phrase to AskAlexa queue) with %askalexa% in the phrase.
  • Removed requirement to set a speechDevice for users that only wish to use another supported SmartApp to offload/handle the speech - (currently only AskAlexa)
  • Added Smart Home Monitor (Dashboard) status events (speak on Arm-Away, Arm-Stay, Disarm)
  • Device/SmartApp output detection logging (did we send to a device? did we only send to a SmartApp (AskAlexa), did we send a phrase but didn’t send to a device or another SmartApp?)
  • Option to disable resume globally and/or per event.

Caution, Development Version ahead (rapidly changing; What’s posted today may not be the same tomorrow!):

Code Link: https://raw.githubusercontent.com/rayzurbock/SmartThings-BigTalker/development/smartapps/rayzurbock/big-talker-dev.src/big-talker-dev.groovy

Report Issues: https://github.com/rayzurbock/SmartThings-BigTalker/issues
When reporting issues, please include the version of BigTalker that you are using. This can be found in the IDE logs with each BigTalker posted event or in the SmartThings App > Automation > BigTalker-Dev (or BigTalker for the general release) > Scroll down to the last line on the main menu under About.
If you do not have a GitHub account and do not wish to create one, you can PM me here in the community. I’d rather have one of these two methods for troubleshooting bugs and such (preferably GitHub) rather than have to scan through and try to mentally organize this thread into various issues/subjects.

If you use this version, please do enable debug logging within BigTalker. SmartThings > Automation > SmartApps > BigTalker-Dev > Configure Defaults > Enable debug logging. Then when reporting issues, please submit any relevant logs which can be seen in realtime at https://graph.api.smartthings.com/ide/logs

2 Likes

Good to be working with you!!!

Since this is going to updated often, is it possible to use the GitHub update integration? If yes is it the same as release version?

For some strange reason DEV version will not speak, smae settings as Regular version. I removed regular and installed DEV doesn’t talk. Removed DEV installed Regular and it talks. When DEV version is installed I choose VLC-Remote and toggle off for speech. When I turn on a switch the play button in VLC should turn green it doesn’t. In Regular version it does and speaks.

DEV Version 1.1.9.a3.6 Here is my log showing errors.

Yes, you should be able to use the GitHub integration in the IDE.
Owner: Rayzurbock
Name: SmartThings-BigTalker
Branch: development

As to the error you posted, I’ll check it out after work and thanks for the screenshot of the log.

Thanks, I will wait for a fix. Now a question, I know it has been mentioned before, but is there a way to add a delay before a sentence is spoken? What I find is the name of the device is cut off and the status such as On you hear. But if I turn it off in a few minutes I hear the device name and status. So what my thought is the clipping is because the computer isn’t fast enough to wake or respond. Does that make sense?

I’ve been in the code all evening troubleshooting and correcting issues within the Talk() function. I pulled the code out into another development environment that made it much easier to see mistakes/bugs. I’ll need a bit more time to go through some more code and testing before I upload the next development version.

I have been asked this before and I do not know of a way in code to add a delay prefixing the phrase. Perhaps you could try to prefix the phrase with punctuation a couple of times to see if that will add delay. Typically TTS engines will pause briefly on a dot or exclamation point; I am not sure that they will if there are no words/letters before it though. In an attempt to combat this, I request a slightly longer duration for the audio file that the SmartThings TTS engine returns, but I suspect this just gives a couple of seconds of silence on the end that may not even be noticeable.

Thanks for the quick answer. Once I get the fix for the developer version I will try your idea. Did you look at my screenshot of the Logging of errors?

Yes. It led me directly to what I needed to fix. Thanks for that. Unfortunately I came across other issues that needed to be resolved as well before I post the update. I’ll get the new development version out hopefully in a day or two.

OK Standing by.

I am having same problem, sent you liv log in message. But here it is again.

Development code version 1.1.9a3.6 was bad. I’m sorry. Please update to 1.1.9a4.1 if you are running the development branch and let me know how it goes.

This development version is intended for users that wish to assist in testing and providing feedback/troubleshooting. This is scoped to be the next release if no further issues are discovered.

Caution, Development Version ahead (rapidly changing; What’s posted today may not be the same tomorrow!):


Release notes from 1.1.9a3.7 to 1.1.9a4.1:
(See post #65 above for the other changes since the 1.1.8 release up to 1.1.9a3.6)

  • 1.1.9a3.7
    • A lot of work on Talk() and others
    • Pulled the code into Notepad++ where I could work with it better, collapse conditions, etc.
    • Found several bugs in the Talk() function that I didn’t see otherwise. Squashed.
    • Added a “Poll Now” toggle to the BT main screen, when in Debug and musicPlayer mode.
    • Corrected my very bad implementation of the Resume/Don’t Resume option for musicPlayer mode. That was bad code, sorry!
    • SmartThings IDE logs are randomly showing logs. I don’t think this is BigTalker related. It just randomly skips showing logs which I rely on for development and debugging. It’s broken. I hope that the code works properly though, either way this is a better development release than that last poor excuse for one!
  • 1.1.9a3.8
    • Added option to disable periodic polling for musicPlayer mode (some users were concerned with BigTalker showing up in the “Activity” feed so often. If music starts playing after speech when it wasn’t before, please make sure that polling is enabled)
    • When resume is enabled and in musicPlayer mode and in Debug mode, main menu now has an option to cause an instant poll “DEBUG: Poll Now (simply toggle)”.
  • 1.1.9a3.9
    • Corrected a missed null check in Talk() regarding an empty phrase.
    • Added a null check in Talk() for resume var.
    • Added logging and in-app notification if Talk() is called on an empty phrase.
  • 1.1.9a4.0
    • Added Button Held event. (needs testing. I do not have a zwave button)
    • Renamed SHM Stay to SHM Hold to match the language in the SmartApp Dashboard.
    • Additional null checks in Talk() (specifically addressed if the desired phrase only had %askalexa%; throw an error in the logs and notify via push that there is a configuration error due to a missing phrase)
  • 1.1.9a4.1
    • When I renamed the SHM status from Stay to Home to match the language in the App, triggers were not occurring when SHM changed to Home/Stay mode because I was looking for “home” now instead of “stay”. Corrected the event monitor.

Report Issues: https://github.com/rayzurbock/SmartThings-BigTalker/issues
When reporting issues, please include the version of BigTalker that you are using. This can be found in the IDE logs with each BigTalker posted event or in the SmartThings App > Automation > BigTalker-Dev (or BigTalker for the general release) > Scroll down to the last line on the main menu under About.
If you do not have a GitHub account and do not wish to create one, you can PM me here in the community. I’d rather have one of these two methods for troubleshooting bugs and such (preferably GitHub) rather than have to scan through and try to mentally organize this thread into various issues/subjects.

If you use this version, please do enable debug logging within BigTalker. SmartThings > Automation > SmartApps > BigTalker-Dev > Configure Defaults > Enable debug logging. Then when reporting issues, please submit any relevant logs which can be seen in realtime at https://graph.api.smartthings.com/ide/logs1

1 Like

OK got it installed. I am testing with DNLA Fabriq speaker. First thing I noticed and don’t think anything can be done is that there is a 15 second delay before speech. In a way it prevents the clipping problem. I will have to make some changes to my groups as I need to pick ones I use a lot so that will take a little time. Not to change to think about what is important.

Mine is pretty quick, within 2 - 5 seconds.
There are a few things at play here in musicPlayer mode.
In a very simplistic overview

  1. Event happens (Switch On) & Big Talker receives notice of it.
  2. Big Talker converts your phrase, looking for %askalexa% and other tokens/variables that it needs to replace/remove
  3. Big Talker checks your resume desire and any other relevant settings and tries to determine if your musicPlayer is playing music or not based on information returned from SmartThings.
  4. Big Talker then either sends a request to play the phrase and restore your musicPlayer’s playlist or to resume it. (not all devices support both of these, but they typically will at minimal, stop playback and play the phrase; This is out of Big Talker’s control so long as the proper command need is evaluated/called. It is dependent on the device and SmartThings device type handler (DTH)).
  5. At this point, Big Talker is done. The phrase is now in the hands of SmartThings Text-to-Speech (TTS) API/engine. If the phrase has been used anywhere in the SmartThings TTS system, then they match that and pull the already cached file url and send that with whatever commands your device needs to go fetch the mp3. If it’s not already cached, then the phrase has to be converted to audio, an mp3 saved and the url sent in a command to your device to go fetch the mp3.
  6. Your device processes the mp3, adjusts volume if it supports it, plays the mp3, reverts your volume if it supports it.

Delays can definitely happen in steps 5 & 6. SmartThings processing text to speech, creating an audio file then your device downloading the audio file (ie: network/Internet connection speed/stability).

I have it setup for speak mode as I don’t play much music. Should I have it in Music mode for speech also?

No, speech mode follows a different path. Basically 1 & 2 above and then the desired phrase text is sent to the device. The device itself then processes these phrase, converting it from text to audible speech and then plays it. The delay could happen between SmartThings pushing the text to your device, the device processing it into audio and then finally playing it.

OK switched back to speech mode. As soon as it is 9:00 AM EST I will test so I don’t wake anyone up.

OK so far so good, but what happens if I want to play music, can I do both Music and speech?

Ran into first problem Speech is duplicated, so if it says Family Room is now off it repeats it again. So for each on and off there are two replies.

Can I run an instance of release version of Big Talker as I need more slots for switches?

You can run both or multiple of the same release, however having a switch for example in both instances will cause both to output speech for that switch causing the duplicate speech.