I'm in London this week, but went to Pizza Hut for dinner for the 4th. McDonald's is probably more American, but oh well.
There’s a Wendy’s there somewhere
Burger King on every other corner, too.
Maybe I don't understand how this app works.
I'm not interested in TTS, I just want to use the push notification. It looks like the speaker setup is required, so I went ahead and did it, but left the Speak toggles turned off
I was still required to enter a speaker type, a speaker and the volumes and quiet times.
I then configured the Push
But I'm not receiving any push.
And finally a suggestion.
Instead of providing an input for a restore point for volume level, I'd like to see the app query the speaker and restore the previously set volume. I do this in Envisalink Integration.
def prevVolume = it.currentValue("volume")
if (it.hasCommand('setVolumeSpeakAndRestore')){
it.setVolumeSpeakAndRestore(defaultVol, str, prevVolume)
} else {
it.speak(str)
}
if setVolumenAndRestore is not supported you can also go ahead and manually implement the level changes, before and after the speak command.
Thanks for your contributions!
Thanks, I've fixed the push so it can be sent with or without speech.
The volume thing has come up a few times. The problem always come back to the number of different speakers out there and what does and doesn't support different commands.
I just tried a variation of your code with Nest Hub and immediately got an error.
if(speaker.hasCommand('setVolumeSpeakAndRestore')) {
java.lang.IllegalArgumentException: Command 'hasCommand' is not supported by device. on line 152 (pageConfig)
I would have thought that the 'hasCommand' would work on all devices to be able to see if it 'has command' but apperently not! lol
Here's the stats for that speaker...
UPDATE: I got something cooking.... hang on!
New version Github...
V1.0.4 - 07/05/19 - Complete rewrite of how the app speaks
Need some testers for this one! Thanks to @doug for showing me the 'hasCommand', I've completely rewritten how the app speaks (much cleaner). Now I need to know if it works with your speakers. If you could reply with what type of speakers you have and a screenshot of the 'report' I would really appreciate it! Thanks
I only have Google/Nest so here's what mine look like...Just need to choose 1 of each Type of Speaker for the test to keep the list small.
Bathroom speaker = Google mini
Kitchen display = Nest Hub
What Did I Say = speaker proxy
Thanks
@bptworld Here is what I get from the test. I have 4 speakers that are all the same. Mini's
Here are my results. 1 GH and 2 GH minis:
Scott
@bptworld I was just curious, does the child device also report them leaving a place? I see this in the child device and wondered.
Random Message to be spoken when 'has arrived' at a place - Separate each message with ; (semicolon)*
Kinda, it'll speak when 'on the move'. I'm still working on a better way of knowing why someone leaves a place.
Really?! I would've thought that's implemented by the platform.
I've updated and will report how it goes.
In my testing it wouldn't work on a single device, it would throw that error. But it does work when using a list. Weird.
Didn't work:
if(livingRoomSpeaker.hasCommand('setVolumeSpeakAndRestore')) {
java.lang.IllegalArgumentException: Command 'hasCommand' is not supported by device. on line 152 (pageConfig)
Does work:
state.speakers.each {
if(it.hasCommand('setVolumeSpeakAndRestore')) {
That is weird.
@bravenel @mike.maxwell @chuck.schwer
Is that by design?
Anybody using Echo or Sonos devices that can test?
Thanks
I can test echos when I get home.
No, it's not by design, and it's also working fine.
definition(
name: "Speaker Test",
namespace: "test",
author: "test",
description: "",
category: "My Apps",
iconUrl: "",
iconX2Url: "")
preferences {
section {
input "musicPlayer1", "capability.musicPlayer", title:"Select music player", multiple:false, required:false
input "musicPlayer2", "capability.musicPlayer", title:"Select music player", multiple:false, required:false
}
}
def installed() {
updated()
}
def updated() {
log.debug "updated"
if(musicPlayer1.hasCommand('setVolumeSpeakAndRestore')) {
log.debug "musicPlayer1 has command setVolumeSpeakAndRestore"
} else {
log.debug "musicPlayer1 does NOT have command setVolumeSpeakAndRestore"
}
if(musicPlayer2.hasCommand('setVolumeSpeakAndRestore')) {
log.debug "musicPlayer2 has command setVolumeSpeakAndRestore"
} else {
log.debug "musicPlayer2 does NOT have command setVolumeSpeakAndRestore"
}
}
Hmmm. I wonder what's going on with @bptworld's situation? I've never personally encountered a problem with hasCommand
Like I said, I'm good. I got it to work. No need to dig into this.
Thanks.
Speaker Test Results
Bedroom speaker - needs all volume fields filled in -google
Cjs bedroom speaker - needs all volume fields filled in - google mini
AlexaTTS chris echo 2 - needs all volume fields filled in - ogiewons alextts
Bedroom speaker - uses playTextAndRestore - google
Echo - chris echo 2 - uses setVolumeSpeakAndRestore - echo speaks
Bedroom speaker - uses playTextAndRestore - cast web api insignia google
Echo - chris's Echo - uses setVolumeSpeakAndRestore - echo speaks
Push is working fine now. Thanks