Networked Speaker Driver

I am very interested in your work here and look forward to your progress. I actually gave this a shot about two months ago and did not come even close to the progress you have made. So you don't have to worry about talking to your self ... I am listening. Would be interested in helping to test things when you have something. Thanks.

I did take your clues and tried again. It did recognize and create a device for all five of my speakers, which is farther than I have been able to make it before. I am getting the same error your screenshot shows (may be off a line or two as I added some comments at the top when I copied the code over)

For all five speakers I get these driver errors:

No signature of method: java.lang.String.encodeAsHTML() is applicable for argument types: () values: on line 408

and

Cannot invoke method encodeAsMD5() on null object on line 426

I get this error in the App:

Cannot invoke method leftShift() on null object on line 251

I get the same two errors, and after adding some debug log output, can see it's a pretty serious problem.

I believe the Media Renderer devices that the parent app creates need to be subscribed to... LAN Events (???) but they aren't, and the messages requested from the devices doesn't contain expected data.

Either way, either as a result of my workaround in the parent app, or something else, the Media Renderer devices aren't getting fully set up correctly.

At this point, I am totally lost due to lack of knowledge, and may have to give up.

You made it further than I did. Hopefully a Networked Speaker integration will come along soon.

Thanks.

It's likely going to be a while on this, I've been traumatized by the sonos integration, in any event, they both use the same interface (ssdp for discovery and upnp subscriptions to the devices services)

2 Likes

So ... This morning's firmware update now has TTS. So I commented out the section of the driver that were causing the errors. and entered some text in the 'Play Text and Restore' driver
image

I got an error on line 644 that it did not like 'integerValue'. I commented just that part out
def currentVolume = device.currentState("level") // ?.integerValue

AND MY SPEAKER SPOKE THE TEST STRING!:grinning:

Now I will try my webCoRE piston that announces arrival/departures to see if that works.

UPDATE: webCoRE pistons are now able to send text to my speakers! I just have to figure out how to change the voice. It was a female voice with ST and the voice being sent now is male, and the wife does NOT like being told things from males, so that has to change. :smiley:

3 Likes

We did not implement this currently, we were kicking around being able to change this globally, probably in location settings. For now you have Hubitat Harry as we call him.

1 Like

So at my house is was ....

ST Polly: "Matthew is home now"
Wife/Daughter: "Thank you!"

Now if will be:

Hubitat Harry: "Matthew is home now"
Wife/Daughter: "I already knew that!"
:crazy_face:

I have the opposite issue, my wife and girls yell at Alexa... But they love when Hubitat speaks, "Alarm is Set" or "Alarm is disabled" or any of the other phrases I now have set up...

However, I never get to hear their reactions to "Patrick has left the building" when I leave my geofence.

1 Like

Mike,

Is the app / driver call for native TTS the same as SmartThings; i.e.,

	def sound = textToSpeech(text)
	def trackUrl = sound.uri
	def duration = sound.duration

BTW. I am single, so no wife. However, my Amazon Echo has requested that we go into couples counseling. I am suspicious she is having an affair with the thermostat! Way too cozy around here!

3 Likes

I'm testing with.

speaker.speak(message)
speaker.playTextAndRestore(message)
speaker.playText(message)

They all seem to work to play the message

Andy

1 Like

Mike
any chance we can get this via a variable (even %female% , %male% - not necessarily a specific voice)
That way we can select for each message

I was using voice mp3s while waiting for tts and have normal announcements by a femail voice and alerts (leaks etc) with a male voice
Easy to distinguish between the two then.

If it's set globally we could only have one voice

Just a wish from me :slight_smile:

Thanks for all your hard work on this.
It's one of the last things to sort out for me

Andy

Understand. I am developing a speaker driver. I need to know the command there to convert the text to sound (as is done with the previous message in SmartThings).

Yes, same, same...

Probably not any time soon, however once you have the generated uri you can use it directly without calling textToSpeach, so change global setting, build a few, switch back ect, so similar to what you were doing with your mp3s.
We allow 5MB of these on your hub before we start pruning the least used ones.
The file name is an md5 hash of the text and the voice name.

1 Like

@mike.maxwell
Brilliant idea!
Thanks... now.. silly question... when does the global setting arrive? :sunny:

Andy

Lol, now that I've had something to eat and thinking a bit clearer, I'll probably do both.
A global setting, and an optional param to select the actor.

3 Likes

This is AWESOME! I have my Bose speaker doing text to speech now, so easy :grinning:

Is there a way to put some silence at the beginning of the generated file? Sometimes there is no problem, other times the first word gets cut off when played back.

Try adding a couple of commas to the beginning of your message.

,,, start of message

A comma usually adds a slight pause with aws polly

1 Like

@mike.maxwell

This is even better!!
Thanks SO much for considering this Mike

Andy