[RELEASE] Poor Man's Echo (Ok Google), A cheap way to control the house by voice

Hi, Now you can speech to Alexa and send the audio to speakers in smarthings, You just need an android phone. nothing more,

I´m not a Android User but, I have read somethig about google now, you can speak and google now search in web, but google now do not allow to add a new search engine.

Then I have installed Firefox browser, Firefox allows you to add a new search engine and allows to use the mic to search in the web, eureka!

In this way I have added a new search engine (the smarthings alexa connect url) and firefox allow me to speech (touching the little mic in search box) and send the text to smartthings app.

You can use Google Now with automate and tasker now.

Automate” is free and very easy to config
Tasker Now” is about 1 dollar

I have several cheap android phone with automate and tasker now, I can speak “Ok google, turn on” and smartthings turn on the lights in each location, you can ask for door status or who is in home “Ok google, who is in home?” and alexa respond the name of presence sensors in home

the smartthings app takes the text and use the text to alexa function to send audio to speakers.

V1.1

I have taken the text to control some switches. Now you can control devices on any place of world with your voice.

First you must to select the devices to control ex all lights in house

You can select the language command En and SP have been added but I need help to add some command in other languages

and that is all

in english you can say : turn on the dinning room lamp , set the family room light at 50%, turn off the kitchen lights

in spanish you can say enciende la luz de la cocina , apaga la lámpara de la sala., enciende la luz del comedor al 50%

for now you must to name the devices like you want to speak, in next release I try to find the device with wildcards

Try it

V1.2

Added music selector, ex “play love music on dining room speaker”
It use a radionomy music stations, you can create a natural voice name to every station, I have made a quick name like jazz, If there are more than 1 jazz station, a random jazz station will be selected.

You can change the name in code to your favorite station to be easily found

V 1.3

Added strip junctions and default type in device name, like “play love music on dining room” now you can use just “dining room” when command play is triggered instead “dining room speaker”

The same for lights, if you have a device named “the bedroom lights” the word “the” is removed, this is better for other languages like spanish.

Now you can add more tags to station to find them easily like “kids, disney,french,Disney in french”

I have added some levels, you can say “turn up the kitchen high” to set the volume to 90%

An autoplay in background to hear the message, I suggest first use the html mode and after change to a speaker, the html mode its better to control the house.

V 1.4

New list all available stations, show the station name and the friendly name

Languages

you can add your language in

input “language”, “enum”, title: “Language?”, required: true, defaultValue: “EN”, options: [“EN”,“SP”, “XX”]

/* You can use this example to fill your language commands */

/* s = start , e = ends , a = any , r = regex */

“EN”: [“on”: [“a”:[“turn on”,“switch on”],“e”:[“on”]],“off”:[“a”:[“turn off”,“switch off”],“e”:[“off”]],“setLevel”:[“r”:[“turn on.+\d+%”,“set.+\d+%”,“dim.+\d+%”]],“playTrack”: [“s”:[“play”,“start”]],“stop”: [“s”:[“stop”]]],

Example:

[“EN”,“SP”, “FR”]

“FR”: [“on”: [“a”:[“lumières”,“allumer”]],“off”:[“a”:[“éteindre”,“éteindre”]],“setLevel”:[“r”:[“allumer.+\d+%”,“fixer.+\d+%”,“baisser.+\d+%”]],“playTrack”: [“s”:[“jouer”,“commencer”]],“stop”: [“s”:[“arrêter”]]],

for the stations

“FR”:[“70s 4u”:“Seventies”,“80s 4u”:“eighties”,“A 1 All Disney On Wide Radius”:“enfants”…


the connect alexa have this options.

1.- You can select speakers or html player if you have not a speaker in smartthings.

2.- you can add a redirect url, if you use speakers the redirect its automatic,

Installation

1.- Install the smart-app

2.- You must to OAut the smartapp

3.- Select the switches and speakers you want to contol with voice

4.- Install Firefox in your android, I think all android have google now to speech recognition but if not , install google now.

5.- In the smartapp copy the web url and paste in firefox browser

6.- Add a new search engine in firefox browser link

7.- Set the web url page the default search engine

8.- in firefox, pres the mic in search box and speak “who is the president of usa” and press for search or speak “play music romantic in bedroom speaker”

9.- ready, the audio will be in your speakers or the html player.

I will add more detailed installation instructions, but I have not much time this days,

The web interface is very basic , the next week I will add some styles, but I want to release now.

If you have a better way to send the speech text , let me known.

The next step its a custom alexa settings.

If you like this project, please consider a donation to support it, thanks donation

https://support.cdn.mozilla.net/media/uploads/gallery/images/2015-10-09-21-21-15-7e95db.png

7 Likes

@ule

Thanks for this great app. Nice to see a free way of doing Speech to Alexa.
Now I wonder, can we use this integrating alexa account to our SmartThings environment ?

Like "Alexa, turn off the lights"
For that we need to have a Alexa account and connect it to ST. Am I correct ?
But how do we do that ?

HI @mrmrmrmr , jut wait for the next release.

Any news from the next realease ?

Hi @mrmrmrmr, i have release some changes. may be you can help to translate some commands, I have added a command routine to control devices from text, no to go with Alexa.

Actually only switches are enabled, and you can select the command language in code you can see the structure, I have added English and spanish

Android allow to add several languages, I have set my primary language in Spanish and recognize very fine my commands, and i can speak in English to send question to alexa, really good voice recognition in google voice.

Try it

@ule, would you be willing to share your code for how you are sending text to alexa and receiving an mp3 in response? I’m sure that it is costing you money somehow to run this on your own server. If we had the code, some of us could run it ourselves (with our own Alexa api keys) and save you the trouble. Let me know what you think!

Thanks for this cool idea/service!

You don’t need an Alexa “account” to do that. Just SmartThings, an Echo, and the Alexa app - you pair them and authorize which devices the Echo can access. Then you can control them individually or create custom groups of them to work all at once. You can also create virtual switches that will allow you to control locks and (I think, but haven’t done this) modes.

Unless I’m misunderstanding your question, which is quite possible!

Oh - are you talking about doing using the Amazon speech service without a hardware ECHO? If so, I withdraw my comment!

You can also use one of these - kinda fun, if you have to stuff already:

1 Like

Hi @ule
I’d love to help/contribute.
But I didn’t understand; if only EN and SP is supported, I can’t add any other language , right ?
Would you like me to help with English ?

Hi @Jason_Fay ,

it is a good idea. But I don’t have an example of supported USB sound dongle with mic. Do you know any ?

When I put mine together, I just used a cheapo USB desktop microphone and piped the audio out to my tv through HDMI. I’m sure you could also run the audio out through the 3.5mm jack or bluetooth (if you have an RPi3 or a dongle).

1 Like

thanks. btw, I could not find where I could :
"login at http://developer.amazon.com and Goto Alexa then Alexa Voice Service You need to create a new product type as a Device, for the ID use something like AlexaPi, create a new security profile "

login OK. but then I could not find how to create a new product type as a device…

This video shows the Amazon side of the process a lot more clearly.

I used the instructions from the video, but I used the code from the link I posted above rather than the guy in the video’s branch code. I know the people at Sam Manchin’s github have been improving theirs and have added some sort of music support, but I haven’t tried the new version yet.

2 Likes

thanks. that’s cool.

with that home made Echo, shall I be able to “pair with ST and authorize which devices the Echo can access” ?

just as you suggested for a normal Echo ?

Hi I have release some new improvements,

v 1.3

Added strip junctions and default type in device name, like “play love music on dining room” now you can use just “dining room” when command play is triggered instead “dining room speaker”

The same for lights, if you have a device named “the bedroom lights” the word “the” is removed, this is better for other languages like spanish.

Now you can add more tags to station to find them easily like “kids, disney,french,Disney in french”

An autoplay in background to hear the message, I suggest first use the html mode and after change to a speaker, the html mode its better to control the house.

If you like this project, please consider a donation to support it, thanks donation

Hi @ule

I’ve tried the app using Turkish translations.
It is working as expected.

I have two questions;

  1. Using mozilla browser I am able to search using speech to text. But after the speech to text phase it does not post the search URL automatically. I have to click on the search text. Is there any way to search automatically after STT ?

  2. I prefer using Tasker & AutoVoice for such Speech to text functions. How should I post the text parameter to the search URL ? What is the format to add the text parameter to the URL ?

Thanks.

@ule

I’d appreciate if you could answer…

Hi @mrmrmrmr, 1) no, in firefox there is not other way to send the command.
2) text

text , how ?

like this one :

http://someserver/somepath/service?text=hello

?

hi @mrmrmrmr, Yes, the variable is text.