Amazon Echo ESP8266 control, with natural speech commands


If you’re using the WemoManager version of the code, update to the Espalexa version from my August 8 post.


I am using Espalexa version. Connected to WiFi and Blynk but no devices found. Is there a bill that needs to be activated for this to work?

I think I may be using a version from April? When I get home from work I will try the August 8th version. Not sure if that is the one I used, but the version I used did use the Expalexa libraries.


Nope. No Alexa skill necessary. I don’t know if it will make a difference, but try discovering through the Alexa app on your phone or tablet rather than by asking Alexa verbally. That’s what works for me.


Have tried discovery by phone app, website and verbally. Nothing works.


I just got home and checked and I am using the code from Aug. 8th. Connects to wifi and Blynk but Alexa cannot find the devices. I do not know what else to try to make this work.


I’m stumped. I just programmed a Wemos D1 Mini to test if anything had changed. I used the Alexa app on my iPhone (Smart Home > Add Device) to discover it, and was controlling the device with my 2nd gen Echo Dot in seconds.

I’m just spitballing here, but if you attempted to discover the device right after the WiFi provisioning, your phone may not yet have switched back from the WiFiManager access point to your home network. Check that all 3 devices (phone, ESP, and Echo) are connected to the same wifi before attempting to discover. Also, make sure that SSDP, UPnP, and Multicast / mDNS are all enabled in your router’s settings.


I left it running for hours and redid the discover many, many times during that time. Phone was on the same network. I also tried on my computer and by voice with Alexa. Nothing can be found. I verified the device was on my WiFi network and the Blynk app showed that it was online also. Alexa finds nothing.

Alexa app quirky behavior with light switch

Hi @chrome1000 , just flashed another Sonoff using August 8th code, latest Arduino IDE 1.8.7, latest Blynk library V0.5.4, latest ESP8266 core 2.4.2, latest Espalexa library, DOUT flash mode 115200 baud rate.
The problem i have, is the alexa app button is off to begin with, voice and blynk buttons work initially to switch ON but then is always ON and voice will not turn OFF, manually switches OFF and immediately back ON, as a consequence there is NO sync with blynk app button (always ON). Any ideas? Everything is exactly the same as all other 8 sonoffs except for the IDE, Blynk library and local blynk server 0.40.0 was 0.39.13 yesterday (same outcome).


@jasperdog The Alexa app is constantly changing, and is responsible for some very quirky behaviors, one of which is turning all devices on when you enter the Smart Home section. You need the app to discover devices, and to set up groups and routines, but it’s best to avoid the app for direct device control. Use your Echo for voice commands and Blynk for app control of your devices.

I don’t use a local Blynk server, but considering that every hardware state change is followed by a blynk.virtualWrite statement, I don’t know how your Blynk app would ever be out of sync with your device.


Yeah i hear you, i wasn’t actually using the alexa app after discovering the new device, i only noticed the new device button was ON in the Blynk app without the device being in the ON state, i then developed the issue by asking Alexa to turn off the device, it replied OK but the blynk button was still ON. by pressing it in blynk it turned off but then when repeated stayed lit up as ON, so the sync was not working. The alexa app was another issue with the button always ON, even after toggling OFF , it came back on Immediately. The strange thing about it all, is that the sketch is exactly the same as the other 8 sonoffs, just a separate Blynk token. All other 8 devices work normally, so i’m leaning towards the Blynk library update or the 2.4.2 core. Because the sketches are identical?


Just as an update, i tested this extensively and it transpired that by downgrading the Blynk Library to V0.5.3 worked as it should. So i don’t know as to Why, i’m running Windows 7 x64 bit, hope this helps anyone encountering the same issue as me.


Strange. I also had to downgrade the Blynk library, but for a different reason. I couldn’t get it to compile code for another project.


That’s what happened to begin with, i needed to upgrade the core to 2.4.2 to be able to use the 5.4 library. After which it then compiled and flashed but with the mentioned issue i was having reference the no blynk syncing of buttons due to the button being always ON. That is what lead me to downgrade the library to 5.3. Very strange indeed.


So, I’ve just gotten an Echo Dot and am interested in this. I actually have a Sonoff S26 that I am doing my testing with.
That is compatible with Alexa through the Ewelink Skill, but why do that when I can make it directly connect? :stuck_out_tongue:

My main question is, I want to retain the use of the physical button on the device, how does the library handle pushing the new “state” back to Alexa if you change it with a different process (either blynk or a manual button/switch).

eg, if I open the Alexa App on the my phone and look at the switch, it tells me if it’s on/off. How is that information stored/read/changed?

Thanks :slight_smile:


Hello, chrome1000 again thank you very much for your ideas and codes.
I want to use this code (August 8), but I need to modify it, and I do not know how.

I need to send the order from Alexa but only activate the relay 1 sec. It’s possible? I have searched but I can only get code that does not work.


@emi2 It would help if you explained more about what you’re trying to do. Should the Blynk button appear ON or OFF after the one second ON state? What do you want to happen when you ask Alexa to turn the device OFF? Anyway, assuming the one second toggle is all you need it to do, here’s how I’d go about it:

First, set up a timer at the beginning of the code (where variables are decleared) with the following.

 Blynktimer timer;

In the main loop, add;

Then, replace the SetNewLevel function with these two functions:

void SetNewLevel(uint8_t * pLevel){
    digitalWrite(OutputPin, HIGH);
    timer.setTimeout(1000, ResetRelay);      // Call the turn off function in one second

void ResetRelay(){
  digitalWrite(OutputPin, LOW);

Good luck.


Thanks, I need a pulse to start and another pulse to stop it.
It is to raise or lower the blinds.
I believe that it will be worth to me, I will prove it.


@chrome1000 Hi, today alexa responds with "more than one item shares that name, which device do you mean? ", i tried deleting a device and rediscovering it , but still the same outcome, there was an alexa app update yesterday so may be it’s that, just wondered if anyone else has the same issue. issue is for all device names.

UPDATE…resolved, issue was relating to the 4th echo dot i added which shared the same name “Alexa”, not related to this topic.