-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anyone tried to use ESP8266HueEmulator with Amazon Alexa? #62
Comments
Sorry, I don't have an Alexa device. |
I've tried, but I have the same problem with the button. First I need to see why the current code is not working fine with hue mobile app and then I will look to Alexa. Now is connecting to mobile app but disconnect are reconnect continue and I can see only white color no matter what I select. |
I am seeing same behavior as @targence and @bcatalin are reporting, but I am using a ReSpeaker (Seeedstudio kickstarter) and not an official Amazon device.
In addition, but not sure if that really is a problem, after registering and logging in on the site meethue.com you can add Hue Bridges. Should this only work for the real Hue's? |
Sorry, but registering and logging in on the site meethue.com is not implemented at all for ESP8266HueEmulator. Not sure if Philips even would allow this for 3rd party devices. |
I've been trying to debug this with a packet sniffer and not cracked it yet. I have the hueUpnp python script running on my laptop and this works perfectly. Strange thing I'm seeing is that the ESP doesn't always seem to see the SSDP broadcast from the echo and when it does and the serial log says it's sending a response, I don't see the response on the network. I'm beginning to think it could be more performance related than code. Has anyone else made any progress? |
Google Home doesn't find either. I think it's a problem in the discovery since I have tried other hue emulators and they are find by Google. |
I've tried two I've found for esp and neither are found by the echo. Not sure I can categorically state it's the esp, but possibly. Ive used wireshark to look at the discovery interaction and it seems that the esp doesn't respond to the echo broadcast. Will have another look this evening |
Made some progress... The echo sends a search looking for devices with a name ending "basic:1" the code seems to be case sensitive looking for "Basic:1" as when I changed to match the echo search the esp responded. Still not registering because a put all lights command hasn't yet been implemented in code, which seems to be the next step. I will look in to that next. So some progress |
I've had a look also, but without luck since now. Here is a simple example of Hue Emulation (simple anc clear) which works with Alexa and Google Home also https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/emulated_hue/upnp.py I have tried to replace the device type and the reply is quite similar with what's there. Maybe you have more luck :) |
A thing which I have just notice, is that the broadcasted UDN by the ESP code is not a proper guid:
I will try to fix this and keep you posted ! |
Check this issue where you have lot of upnp traffic dumps from original hue bridge.
and for broadcast:
both are in python but you can understand very easy what they are sending. These are made to be identical with original hue bridge (timing is also the same). |
I will look into this further over the next few says. I need to set up my raspberry pi 3 as an access point and get it to send all traffic to wireshark first. I'm not seeing everything at the moment. I have downloaded that python emulator and see that works so just need to be able to compare both in full |
LightService_cpp.txt in LightService.cpp add the following: I also changed the following in void sendJson() I did add a couple of functions that changed the format of the json response for /api/xxxxx/lights calls, to be closer to what I've observed with the echo, but they are no longer referenced. I've left them in the attached in case they are needed at some point. This seems to have solved the discovery issues with echo for me so I'll spend a bit of time looking at the control elements... |
Thanks @Quanghoster 👍 Do you want to send a pull request or do you want me to merge the above? |
I can confirm that this works with Google Home also, Thanks for the tip! From what I have seen, the line
has been commented. The message transmission is handled anyway by the SSDP library. However, we may consider in the near future to loop thought 3 item arrays to change the NT and USN like @mariusmotea mentioned in the previous post.
For now it works, and I will create a push request with more additional stuff which I have noticed |
Cool. I have been working on testing turning a strip on and off whist monitoring with wireshark. The state is changing correctly but the echo states something went wrong. The only difference between this and a working emulator is that the http connection header is set to keep-alive on the working one and closed on this. Still needs mire investigation... |
Happy to merge one pull request per issue :-) |
Sure. Go ahead what we have so far and I will investigate further over the next few days. :) |
WireShark is so useful with a Raspberry P set up as a WAP and a sniffer :-) I've changed this function to call a new function addSingleLightJson instead of addLightJson void addSingleLightJson(aJsonObject* root, int numberOfTheLight, LightHandler *lightHandler); The new function is as follows... void addSingleLightJson(aJsonObject* light, int numberOfTheLight, LightHandler *lightHandler) { aJson.addStringToObject(light, "manufacturername", "OpenSource"); // type of lamp (all "Extended colour light" for now) aJson.addStringToObject(light, "swversion", "0.1"); // type of lamp (all "Extended colour light" for now) } Here is the updated cpp. I must figure out how to deal with puah/pull, lol |
Now have the echo turning on an off the EP-12F built in LED by command. Mine is on pin 2 rather than LED_BUILTIN, but works a treat. I've been making some changes to use the WS2812FX library rather than the NeoPixelBus as I find it a lot easier to work with |
Just click the "Edit" button on the GitHub page for that file, make your changes, click the button at the bottom of the page. When asked, create a Pull Request and send it. Should not take longer than a minute to do. This way, your work will receive the proper attribution in the project history. |
Ok, Think I've done that now using GitHub Desktop |
So far I don't see anything - please do a "git commit" and a "git push" in GitHub Desktop. |
permissions? |
Wow guys this is just great! Making work this projekt with echo would be awsome. cheers |
Hi @fighterxxl . We have some changes we are checking in at the moment that sort out discovery with Alexa. I have an ESP-12E here that Alexa sees and can turn on and off the onboard LED, so yes it's pretty well good to go with these changes. Thanks to @probonopd for a great project |
finally have some working code using NeoPixelBus. I've derived a new class from Lighthandler called Echohandler which can be used in place of Pixelhandler. it allows a neopixel strip to be turned on with some very basic animation and turned off with the echo. need contribute access to load the enhancements... :) |
Hi @Quanghoster, I had a bit trouble yesteday building this Project. cheers |
Hi *, cheers |
I'm working on a way to simulate colour changes or animations. We can use the individual light definitions to select animations or colours on a single strip On 6 Oct 2017 22:09, fighterxxl <notifications@github.com> wrote:Hi *,
got it to work. But its too early for me to use. Alexa don't know color commands in my country. Simple on and off works but colors won't -.-
Too bad, maybe in a few month...
cheers
FighterXXL
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.
|
@Quanghoster and @fighterxxl thanks for the progress you are making. Please do send GitHub pull requests. You don't need special permissions for this. |
I've figured out how to do one now I've forked your project. Lol. I hope to look in to Alexa color changes this week. I can turn off and on and dim but pretty sure you can change colours now. But not with what we have here atm |
OK, I've been busy investigating colour change support for alexa and, as I understand it, we will need a different approach. it looks like alexa doesn't do this via the local rest api on the hub. it does it via the smart home skill. So. to be able to do this, and possibly set scenes, we need to use a cloud service as skills can't access the hub. I have created an initial alexa smart home skill to test with and am looking at interfacing with aws iot. From there I can build in mtqq connectibity to this project to support the various calls. aws-iot seems a natural selection for this because you need an oauth provider to Link accounts to a smart home skill. it's more natural to use a smart home skill than a custom skill as you don't need an activation word. I'll post more on this in a few days |
I've just submitted a pull request which includes a fix for Alexa discovery. I have also made some progress with getting a test sketch working to connect to to AWS IoT with an MQTT client to subscript to shadow update messages along with an initial node.js alexa smarthome skill which will eventually connect to IoT aswell. A little early to post anything just yet, but it's now coming along nicely. Hopefully some further updates in a week or so |
I'm getting some wierdness happening since I resynced my repository. Andy. method: PUT url: /api/null/lights/1/state search: |
Strange, The following works ok from another 3rd party Windows 10 app. New client |
Ok, I've figured this out. I'm not sure why the echo is posting with Content-Type of application/x-www-form-urlencoded, but the webserver doesn't behave as expected with this and therefore doesn't fill the plain variable.
This then showed up the json response format for /lights/n/state which I'll shortly post a PR for. Andy. |
Actually I used this with Alexa. As soon as the ESP8266 booted, did a search in Alexa and it found the 2 strips without issues. I think it could be more useful if the library could provide an easier way to define Lamps names, cause I have to edit the other files to do it. Maybe we should build something more like the FauxmoESP library where you define each "device" easily, but it's just an idea of course... I still need to take a deeper look into this code and so far, works fine except when you want to create a Room setup, but Alexa doesn't need that, it just sees the lamps. At least on my Echo Dot v1. |
I tried to use ESP8266HueEmulator with Amazon Alexa, but Alexa can't find new device.
She said: "If you have Philips Hue, press the button on Hue bridge"...
The text was updated successfully, but these errors were encountered: