Control WiFi Speaker directly from WebCore


#1

I just discovered that I can send commands directly to my WiFi speaker using a “GET request” from WebCore (without having to install a device handler in SmartThings). I am using a GGMM-E2 speaker, and with its latest firmware update, it became buggy. I was using the device handler and SmartApp by mujica:

However, I have now uninstalled it and can manipulate the speaker directly from WebCore.

The following is a simple piston I created to demonstrate the capability.

For Text-to-Speech to work, register and get your own TTS Key at: http://www.voicerss.org/login.aspx

Once you get your key, replace the variable value for TTS_Key with your own key.

You will also need to determine the IP address of your speaker (mine was visible via the speaker app on my phone). Once you get the IP address, replace the variable value for URL_speaker. The web page name might also be different for different speakers - not sure. Mine is set to:

http://192.168.86.76/httpapi.asp

But your IP address will be different, and the httpapi.asp part might also be different.

This is just a sample piston. For my actual use, I created a piston that accepts an argument of what I want it to speak, then I call it from other pistons and pass values like “Your garage door is open” or “Arming your alarm system”.

Once you configure this piston with your own values, then click Test, it should set the volume to 50, then play a station for 10 seconds, then speak “Hello, this is a test of your speaker”.

I’m not sure why it asks for a URL value when creating the piston from the backup code, just click “Ignore” if you get that prompt.


#2

Today I received a Fabriq speaker, tested it, and can confirm it works the same way. I only had to modify the speaker IP address in the piston. So both GGMM E2 speaker and Fabriq speaker work by making simple web requests.


#3

Thanks for this @ddtex! Any chance you could share the other Piston you created that accepts an argument of what you want it to speak? I feel like I’m not getting this well enough (not a newbie but also not a programmer) to recreate this myself. It would be very much appreciated if you don’t mind.


#4

Where it’s setting the value of SpeakThis, you would change it to accept an argument like this:

Selection_226

You could also do that in the define section when the variable SpeakThis is defined.

To call this piston from a different piston and pass it a phrase to speak, it would look like this:

Selection_227


#5

I just set this up this week, and I’m really excited about it, works great! I also changed the “radio” to an MP3 locally, one is a plain announcement tone, the other is an alert tone. I picked up two of the GGMM-E2 speakers and paired them together, surprisingly I only have to make a GET request to one and the announcements and speech come out on both. Love it, brilliant, great!