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
[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.
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
51
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.
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:
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…
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.
1 Like
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
55
There’s a Web UI? I thought Echo’s only GUI was the mobile (iOS and Android) Apps…?
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”
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.
Wow, so I got my version to work - indeed the Echo discovery is looking for belkin/wemo but once discovered will use the Hue API (bizzarro!) so if your emulator can map your lights/switches to hue lights, the Echo discovers them all and you can do on/off/dimming - sweet.
I hope ST and Amazon don’t consider this a final solution
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
63
Not likely.
But the bigger question is whether or not Amazon and SmartThings want and decide to directly partner up, or if both would rather let the developer community just integrate through the open platform features.
Clearly Philips Hue has a “premiere” status, so some partnership was arranged. Amazon and ST could totally ignore this option for a long time.
That’s perhaps “good news” for independent developers for both fun and a slight possibility of profit, but, not optimal for end-users.
The smoothness of the premier integration is hard to beat. But would be impossible with the V1 hub, assuming the Echo is doing all this in the local network space - we all fool it into working by running servers on the local network that then bridge out to the ST cloud.
Anyway - open is good. I still want to do more than the basic stuff this can do. I want to ask Echo about the status of the house. It’s not able to comply using the current device integration.
I made a mistake the first time and had to delete the data folder.
The problem is the amazon echo now has both sets of devices. Two are offline and two are online.
One is named the same “AC” so when I say “Alexa turn on my AC” it replies "You have two devices named “AC”
How can I clear the device list from the echo and re-discover ?
UPDATE: Never mind, found it. The echo api has a “FORGET” button which clears all settings.
I have one question.
What is this part really doing “Setup a REST Endpoint Smartapp8 and select the devices you would like your Echo to be able to turn on/off”
Are we granting access to our devices to a public website ?
I think we are ?
Is this the echo site or are we using some third parties interface ?
Also I noticed this creates something called “Endpoint Example” but can not figure out how to rename that, edit it, or look at it’s config. Where is this in the IDE ?