At least 1 person has figured it out
That is amazing. I like that he only had to ask for Smart Things once.
Funny part is I watched this video on my MacBook sitting next to my Echo. My Echo kept trying to respond to his âAlexaâŠâ commands. LOL
Right⊠Because he âopenedâ the SmartThings Echo App. How many such Apps can be open concurrently?
I can not think of any. I tried âOpen I Heart Radioâ and it just started playing my last station.
It appears what they are doing is;
You can âOpenâ an app, then alexa is âin itâ - and she asks you a question, your answer goes to the open app.
If you donât answer, it closes the app - and you are back to talking to the echo and not the app
If you do answer, your answer goes to the app - so if you say something the app doesnât know about, itâll make a sound like âcant help youâ
One app open at a time.
You used to also be able to say âexit appnameâ, but theyâve changed it so a bit of silence will auto exit apps.
yeah, pepbill - thatâs the video I started the thread with⊠I guess the thread is long enough that it needed re-posting
So⊠itâs fairly easy to make an emulated Hue bridge using Node.js, and using that and a smart app that provides a OAuth web interface to your lights, you can fool the Echo into thinking your Smartthings dimmer switches are Hue bulbs. At least thatâs what I hope. Iâve got to test it still with the echo, but if it works I will be able to control my lights with the echo.
The Hue emulator works great. I can turn off/on lights and change their brightness using the Hue API, and my emulator shows up as a Hue Bridge during upnp discovery.
Assuming the Echo is discovering the Hue hub via upnp, and then using the local web api for the hue, of course. If not, then this will just go into the âI learned how to do upnp servers in nodeâ pile of useless knowledge
If it does work, I can post up some code.
[quote=âschettj, post:47, topic:14887â]
If it does work, I can post up some code.
[/quote]It doesnât yet work. Echo doesnât seem to like my upnp response to its discovery
Sorry to rain on your parade, buddy, but but this would be a direct violation of Philips Hue API licensing terms. SmartThings better be careful not to approve any such app or they may end up with a lawsuit on ther hands.
âWe want all your apps to work with our API to form a rich ecosystem of
interoperable applications, so it is a condition of access to our API
documentation that you do not use it to develop or distribute any
bridges or devices which interpret the hue API in order to control
physical devices. Emulators are allowed provided they only control
virtual bulbsâ
So⊠yeah. Thatâs kinda odd - guess I wonât put that code out since thatâs what I had working today.
Turning attention to emulating the WeMo bulbs. Theyâre just upnp devices.
I guess Google and Oracle (Sun Microsystems) are still in court or appealing, to determine whether or not âcopying an APIâ (i.e., the API to various Java libraries) is a copyright violation.
If you donât use the documentation to build an emulator, then youâve not agreed to any license⊠technically. But that would be a difficult task.
Good news, I was able to get my Echo to see an emulated Hue bridge that has access to all my SmartThings devices! Luckily someone over on the Vera forums already had a similar idea and did all the heavy lifting, so I just did a few very minimal tweaks for it to work with SmartThings. This should work with Windows/Mac/or a Pi since itâs using Java.
Hereâs the URL for the forum post:
http://forum.micasaverde.com/index.php/topic,31920.html
These are the steps I took to get it up and running on Windows 7:
Prerequisites
Setup a REST Endpoint Smartapp and select the devices you would like your Echo to be able to turn on/off (endpoint Smartapp from this tutorial)
-
Download and install Java 8
-
Download the JAR file (this is the Hue bridge emulator)
-
Make sure ports 8080, 1900, & 50000 are not in use on your machine. Run each of the following from CMD:
netstat -ano | find â8080â
netstat -ano | find â1900â
netstat -ano | find â50000â
All three of them should come back with no results. If it does come back with any PIDs kill the processes before continuing.
Run the Hue bridge emulator
From CMD, run the following (add the full path of the JAR and edit the IP)
java -jar -Djava.net.preferIPv4Stack=true C:\ENTER\THE]FULL\PATH\HERE\amazon-echo-bridge-0.1.1.jar --upnp.config.address=192.168.X.X
Add a new device to the Hue bridge emulator
-
Next you need to send an HTTP POST. You can either use the POSTMAN Chrome plugin or the Iâm Only RESTing HTTP client (instructions are for the latter)
-
Open the Iâm Only Resting app and set the method as POST
-
In the URL field enter in the following with your IP:
- Copy/paste the following text into the Headers box:
X-Application-Context: application:8080
Transfer-Encoding: chunked
Date: Sat, 09 May 2015 12:14:21 GMT
Server: Apache-Coyote/1.1
Content-Type: application/json; charset=UTF-8
- Edit the name, onURL, & offURL below with the name you would like the Echo to discover the new device as, and the onURL & offURL from the REST Endpoint SmartApp:
{
ânameâ : âcoffee makerâ,
âdeviceTypeâ : âswitchâ,
âonUrlâ : âhttp://graph.api.smartthings.com/api/smartapps/installations/XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX/switches/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/on?access_token=XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXâ,
âoffUrlâ : âhttp://graph.api.smartthings.com/api/smartapps/installations/XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX/switches/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/off?access_token=XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXâ
}
-
Copy/paste the edited text above into the Body section
-
This is what it should look like:
- Hit Submit. You should see a response showing that the new device has been created.
- LAST STEP! - Tell Alexa âAlexa, discover my devicesâ and you should now have the new device controllable by the Echo
Rinse & repeat the POST for any additional devices you want to be discoverable by the Echo.
So⊠digging thru the code, theyâre not emulating HUE, theyâre emulating WeMo - or some odd combo of the two. They respond to the UPNP discovery as a WeMo bridgeâŠ
HTTP/1.1 200 OK\r\n" +
"CACHE-CONTROL: max-age=86400\r\n" +
"EXT:\r\n" +
"LOCATION: http://%s:%s/upnp/amazon-ha-bridge/setup.xml\r\n" +
"OPT: \"http://schemas.upnp.org/upnp/1/0/\"; ns=01\r\n" +
"01-NLS: %s\r\n" +
"ST: urn:Belkin:device:**\r\n" +
"USN: uuid:Socket-1_0-221438K0100073::urn:Belkin:device:**\r\n\r\n"
But the setup.xml they act like a Hue bridge.
"<friendlyName>Amazon-Echo-HA-Bridge (%s)</friendlyName>\n" +
"<manufacturer>Royal Philips Electronics</manufacturer>\n" +
"<manufacturerURL>http://www.armzilla..com</manufacturerURL>\n" +
"<modelDescription>Hue Emulator for Amazon Echo bridge</modelDescription>\n" +
"<modelName>Philips hue bridge 2012</modelName>\n" +
"<modelNumber>929000226503</modelNumber>\n" +
"<modelURL>http://www.armzilla.com/amazon-echo-ha-bridge</modelURL>\n" +
Most unusual.
Nice work, +nelemansc! I was able to get the emulator to work (sort of) with my Echo. The biggest challenge was killing the Windows UPnP services so that port 1900 was available.
After doing a device discover with Echo, I see the devices that I configured in the emulator in the Echo Web UI. Some of them worked for on/off commands and some just didnât. I configured 7 devices to start.
All in all, itâs a great start.
Thereâs a Web UI? I thought Echoâs only GUI was the mobile (iOS and Android) AppsâŠ?
Yeah. I donât think Amazon is doing a very good job of publicizing it, but if you have an Echo try browsing here: http://echo.amazon.com/#cards
I discovered this interface and have to use this to play my preferred itunes stations. I like a few stations from East Coast but Echo doesnât find them because it only looks at local stations for some reason.
I have sent this in as an issue. When I ask for a Station I want to be able to add region the station exists for the search.
Funny part is once I set a east coast stations I can say âAlexa, play iheart radionâ and it says âPlaying last station played and works fine I just canât change stations unless they are localâ
This is awesome!
Unfortunately I screwed it up. Anyone know if itâs possible to delete or modify added devices, I got this working on my iMac server got a few added, but screwed one up and to pile on top of my problems in my poor attempt to troubleshoot added some duplicate devices. If not delete devices, how can I start over? I removed the jar file and redownloaded it, also cleared the Connected Homes setting on the echo but the previously added ones are still showing up.
Obviously there is something silly that Iâm missing here.
I ran into the same issues as you did. I discovered that you can use the Echo Web UI to delete devices that you have configured through the emulator and start over. The connected home devices are listed under Settings->Connected Home. Here are the steps you need to go through to start over. Iâm using Windows, so the steps may vary for another OS:
- Stop the emulator java app.
- The emulator creates a data directory in the same directory as the jar when you start it up. Delete that directory and the associated sub-directories. No need to delete or download the jar again.
- Delete your Connected Home settings from the Echo UI.
4, You are now ready to start over.
Thank you tyuhl! I appreciate the detailed response