xoseperez / espurna

Home automation firmware for ESP8266-based devices
http://tinkerman.cat
GNU General Public License v3.0
3k stars 638 forks source link

Alexa discovers AiLight twice and confuses itself #340

Open xoseperez opened 6 years ago

xoseperez commented 6 years ago

Originally reported by: Scott Wilson (Bitbucket: Scotty86, GitHub: Scotty86)


On version Espurna AiLight v1.10.1 and previous versions, Alexa discovers my AiLights as a Wemo Plug and then at the same time as a WeMo Switch.

I can see the two entries for the same bulb in alexa.amazon.com under the devices tab. When I ask alexa to turn on/off the bulb it may or may not say "Sorry, Bar Light isn't responding" for example. If I delete the extra WeMo Switch entry for Bar Light, Alexa will work correctly. If instead I delete the entry for Bar Light as a Wemo Plug and leave the entry for Bar Light as a WeMo Switch alexa will fail.

The problem seems to be when I scan for devices the double entry situation comes up again and alexa again says the device is not responding. I can duplicate this issue repeatedly.

xoseperez commented 6 years ago

I'm testing it with v1 Amazon Dot and it works just fine. There are some issues with v2 devices but this has not been reported before.

It is strange, ESPurna uses the fauxmoESP library which only emulates WeMo switches... I know it's naive, but could it be that you have another device with the same name?

xoseperez commented 6 years ago

@Scotty86 Can we recap where we are with this issue?

scotty86 commented 6 years ago

@xoseperez I never heard of ESPurna nor have I ever worked with an Arduino, maybe you got the wrong scotty :)

xoseperez commented 6 years ago

Sorry @scotty86, I have recently migrated this repo from Bitbucket and the migration script matched the scotty86 there with the scotty86 here.

swilson86 commented 6 years ago

Hi Xose. Update: The issue still exists, even with Espurna 1.12.3 All my Sonoff products (basic switch, POW, and light) as of today are recognized by Alexa twice. Alexa always chooses 2 of the following 3 options "Belkin International Inc. smart device", "WeMo Switch", and "WeMo Plug". To be clear, Alexa lists every device such as "Bar Light" twice assigning one the 3 options just mentioned. I have no duplicate devices named the same, but today 100% of my Espurna based devices have failed to respond to Alexa voice commands with Alexa saying "I'm not quite sure what went wrong."

If I delete all the entries in alexa.amazon.com and ask Alexa to scan for new devices, she will again make a double entry for each one. Usually deleting the Belkin entry fixes it temporarily until the next discover device command which again places the duplicates in the list.

I suspect the problem is a recent update to Alexa. I have not tried "discover new devices" on every echo device I have. Rumors say to try an original Echo Dot but I have not tried it yet. Too many variables at this point to isolate the problem.

swilson86 commented 6 years ago

A few more clues: I have to discover devices many times and then clean up the duplicates. While cleaning up here are the correct types:

If Alexa declares any Espurna device to be a Belkin it will not work and Alexa will give you "I don't know what went wrong" message.

Sonoff Basic can be a Wemo Plug or WeMo Switch Sonoff POW must be a WeMo Switch Itead light must be a WeMo Switch

It makes no difference whether I discover devices on an Echo 1, Echo version 2, Alexa with a screen, Echo Dot version 1, or using the Amazon web page. All of them consistently discover ALL Espurna devices twice, and only Espurna devices. To speed up discovery, once Alexa has found the correct device and I delete the other duplicate I then shut off that device so it doesn't get duplicated during the next discover command.

swilson86 commented 6 years ago

Hello Xose... The problem of Alexa duplicate entries still exists with Espurna. I can consistently duplicate the error. Am I the only one having this problem?

swilson86 commented 6 years ago

There is another glitch in that Alexa discovers Itead LED lights running Espurna but NEVER declares them to be a light. Thus I cannot directly use something like "Alex, set Bar Light to Blue" as she will respond with "Bar Light doesn't support that."

swilson86 commented 6 years ago

More clues: I had to reflash an Espurna AiLight today (it locked up after sliding the CSS slider to On position and hitting save and rebooting - I will see if I can duplicate that bug again but that's a separate issue). This time instead of using ESP Download Flash tool I used esptool.py --port COM6 write_flash -fs 1MB -fm dout 0x0 espurna-1.12.4-aithinker-ai-light.bin and of course erased the flash first. Results: identical with the download flash tool... still get a duplicate entry after Alexa discovers the device.

Next clue: Last night I setup a Sonoff Basic using tasmota firmware. After connecting via WiFi, Tasmota configuration asks what kind of device it is. I selected Belkin WeMo. It was at this point that I asked Alexa to discover devices. Alexa found it and declared it to be a Wemo Plug. It worked successfully and Alexa discovered the single device. Conclusion... the bug is within Espurna. Hmmm... perhaps Espurna needs also to ask the type of device for Alexa to get it setup correctly? I notice that Alexa-Home-Skill also asks the device type and Alexa always gets it correct.

swilson86 commented 6 years ago

Xose... just to update you... the problem still exists. I dread every time I have a new device and have to ask Alexa to scan for them. I have about 40 IoT devices and only the 10 or so Espurna devices that keep coming up twice as I mention above. I can live with it... not a critical issue. I know you are busy on the S31 and other projects. I'd rather have new capabilities and expanded products than minor annoyance fixes :)

xoseperez commented 6 years ago

Thanks @swilson86. I have not been able to reproduce the problem so it's hard to know what's going on. I'm sorry I don't have much time at the moment.

swilson86 commented 6 years ago

Xose... no problem. May I leave the issue open in hopes that someone else reports the problem and can provide more clues. It is not critical. Thanks!