Great video, can you tell me if I actually need a echo device to discover the nodemcu. Right now I have a fire tv cube and using the Alexa app on my iPhone and it doesn’t seem to be able to discover it
@fusionermx5 жыл бұрын
Cool video... Say if we had 2 boards say NodeMCU1 and NodeMCU2 how would you control those...
@marlontroy62386 жыл бұрын
Hello, Nice project but I would like to know how Alexa echo is connecting to this device if remote access is needed. Or some other API or MQTT is needed?
@DevangsinghSankhala2 жыл бұрын
Amazing intro! What are your thoughts on how to integrate a temperature and humidity sensor like the HDC2010 to make it turn a swamp cooler on or off? I have been trying to look into it because I do not have a central AC so cannot use the Alexa thermostat.
@Themakersworkbench7 жыл бұрын
Sorry for the late upload everyone. I ran into several technical issues while filming and editing this video. From camera focusing and audio issues to Premiere Pro telling me that my GPU (a Nvidia GTX 970) was not compatible, to days searching for a fix, it is finally out. Again, I apologize for the late posting, but at least its out there now. Hope everyone finds it helpful in some way.
@sandychatterjee74577 жыл бұрын
I am using a 8 Channel Relay but when I turn on the relay with 3v3 output and ground it just turn on the light on the relay but the relay dont turn off or on any solution to this ?
@Themakersworkbench7 жыл бұрын
Hello Sandipan, Yes, the 3.3v is not enough to energize the 5V coil that is inside the relays you are using. You need to power them separately with a 5V 500mAh source.
@sandychatterjee74577 жыл бұрын
I tried it power it from a 5v of arduino but then also it dont work but when I changed the relay pin from node to arduino and uploaded a relay test code it worked.
@Themakersworkbench7 жыл бұрын
Can you send me info on the relay board? Manufacturer, photo, etc?
@sandychatterjee74577 жыл бұрын
Yes how can I contact you ?
@stevensnead48337 жыл бұрын
Did not work for me a newbie at it though. The LiquidCrystal_I2C.h gave an error that it could not be found. I put it in the directory of the program but did not work. Seems like it going to take a bit to get your code going. Thanks for all you did.
@jaynesjunction7 жыл бұрын
Great video - and appears less difficult to try compared to other articles I have read. Couple questions for you... do you know if it is possible to ask Alexa to read a value, and return it... such as if a door is open, motion detected (variable set), etc?
@Themakersworkbench7 жыл бұрын
+Ken Jaynes Thanks for the compliment. At the moment I do not think it's possible to have Alexa read strings back.
@jaynesjunction7 жыл бұрын
I am wondering if via home-assistant would work - home-assistant.io/components/binary_sensor.rpi_gpio/ via Raspberry Pi though, not Arduino or ESP8266
@Themakersworkbench7 жыл бұрын
+Ken Jaynes I'm not yet sure.
@Themakersworkbench7 жыл бұрын
+Ken Jaynes It's possible. I know the esp8266 is quite popular with the home assistant people
@NathanHedin7 жыл бұрын
I used your set up and everything works great! However, I can't seem to get Alexa to respond to anything but ON/OFF commands, even by changing the call backs. I'd like to use this setup to automate my mini-blinds, but it sounds a little awkward to say "Alexa, turn off/on the blinds". It works, but it would be better if "open/close" was an option. I have a genuine WEMO switch and it will turn OFF/ON in response to a verbal command of OPEN/CLOSE, OPEN/SHUT, etc. Is there a way to get the emulation to follow these commands?
@k6tf7 жыл бұрын
GREAT video! How did you get Amazon Dot to read the text?
@consig1iere2947 жыл бұрын
Charles, thank you so much for the code and the tutorial. This works flawlessly! You are awesome!
@WOnken7 жыл бұрын
Great video. I wish you could do a project on an Echo switching those cheap 433 MHz remote power sockets. This would be a great alternative to those expensive Smart Plugs, sold TP-Link and others. There are a couple of videos, where those get switched by a NodeMCU, but none that includes an Echo...
@Themakersworkbench7 жыл бұрын
That is on my list, and I have the hardware to do it, I just need a few days to put it all together, but I have to get my next home networking video out before then. Thanks for following along, and thanks for the kind words!
@tazmaniachill6 жыл бұрын
Brilliant job on the application, have done a few switching projects using this board and they work fine, but I really liked the idea of using the L.C.D screen (geek factor and all that..) I have downloaded the ZIP file but I am unsure with what to do with the 5 other files that are needed - where do I put them and how do I include them - plus where do I get WiFiUDP.h from? - also i am getting an error saying "error compiling for board NodeMCU 1.0 (ESP - 12E Module) - I am assuming this is related to missing files? - any help or advice would be welcome !
@tazmaniachill6 жыл бұрын
Well after a fair bit of head scratching I finally got the main part of the project working and its talking to my echo dot nicely and switching the relays... however, the LCD screen just sits their glowing blue and showing two rows of white squares (as I understand it, its in reset mode?) it does nothing when rebooting the NodeMcu and I have spent most of the day looking if I went wrong anywhere with connection etc, the LCD is the exact same one in the tut here, so am at a bit of a loss, and as their seems to be no activity here I fear this will have to go on the back burner for a while and i'll look for an alternative. Not all lost though at least I think I learnt something :)
@morneleroux90676 жыл бұрын
how did you manage to get the WiFiUdp.h file working? Having the same problem now
@himanshuhanda56086 жыл бұрын
Hi Ray, My Nodemcu is connecting to Wifi fine but echo is not discovering it at all. Can you please tell me what did you exactly do to get this working? I know it would be a thing of past for you but still, will look forward to hearing from you.
@rudranshwithfun51464 жыл бұрын
Hi sir node mcu ki alexa ke liye programming kar ke denge kya
@Holomint20033 жыл бұрын
Is there any update with new code?
@chinchinchin6957 жыл бұрын
hi, thanks for the video. i wonder if this is will works with the v3 NodeMCU ??
@Themakersworkbench7 жыл бұрын
+Julio Cuadros yes it should work fine.
@namocrafts11017 жыл бұрын
Hello sir thank u for ur video and for u sharing ur knowledge with us I have one q Am using the wemos d1 mini and it worked great My q is I built automated bar tender and am trying to use this to trigger drink for me But it's lil awkward to say turn on Vodka Is it possible to change it to Alexa MAKE ME vodka? I tried to change in the code didn't have luck Thanks for ur help sir Dan
@namocrafts11017 жыл бұрын
U have to say turn on
@93Bananaphone937 жыл бұрын
You could use a RF-Outlet so u dont have to have a relay and mess around with mains-voltage. Iam planning to do so. I had something like that but with no voicecontrol. It was just an icon on my smartphone that i clicked on. Worked well but wasnt that cool without voicecontrol.
@andrewsmall65687 жыл бұрын
wow finally a video that is clear enough that i could attempt it myself.
@Themakersworkbench7 жыл бұрын
+Andrew Small Thanks!
@chityuulay6 жыл бұрын
Can you make step by step tutorial for using Alexa/Google dot controlled nodemcu to control relay that can put in computer on/off switch that can make computer shut down or turn on ? should be simple but i am totally new to this field.
@americanpsychosis114 жыл бұрын
Nvrmnd. I figured it out. Just made the extra tabs and pasted the files there. Not done yet, but seems like it might work.
@joaonetocz6 жыл бұрын
Hey, do you have the wallpaper of your desk? so cool!
@Athens4287 жыл бұрын
This may be a weird question but I am trying to wrap my head around the circuit in a house environment. I am planning on using a few of these relays around the house to make some of the wall outlets smart. When these get hooked up, is the circuit parallel or series? I am trying to make sure everything in my house stays to code and nothing will draw more than it should without tripping the breaker.
@Themakersworkbench7 жыл бұрын
If you want to stick to code, you will want to buy something like Sonoff switches and work them into a separate utility box in your mechanical / electrical closet. Using open relays like this inside of a wall is very dangerous, and unless they are UL approved, and in a fire safe box, it will not be up to code.
@Athens4287 жыл бұрын
I was planning on putting them in the attic (with the rest of my wiring) and inside proper electrical junction boxes. I was mostly concerned with load on the circuit breaker and if these would keep the same amount of load as the original outlets that are in parallel. Edit: As a note, i am planning on having an electrician verify my work.
@Themakersworkbench7 жыл бұрын
Benjamin H these particular relays are only capable of 10a of current each and I would not put more that 8.5 amps on each one. Typical wall outlet circuits are on a 15a circuit breaker which is able to handle 15a across that who circuit.
@Athens4287 жыл бұрын
Right, most likely none of my lamps will draw more than 8.5 amps heh but i definitely see your point. Maybe the Sonoffs can pull more or a higher amperage multi-relay might be safer. My main question though is still the circuit type. A typical wall circuit has the outlets in parallel. My concern is that if one of the relays goes out that all of them will stop functioning.
@travismicolichek84387 жыл бұрын
Well thank you very much. I have 10 devices that are running with my echo. one of them is my garage door. There is one problem and that is that I cant figure out how to get the echo to respond to "Open,Close" commands. I can say "Garage door on" and "Garage door off" works fine. If you could help me that would be great.
@Themakersworkbench7 жыл бұрын
+Travis Micolichek this is something I am trying to figure out as well for a new video. When I have it worked out I will share the details.
@travismicolichek84387 жыл бұрын
I have figured it out. I hooked an nodemcu and a relay to my garage door push button. I used a digitalWrite(relayFour, HIGH); delay (500); digitalWrite(relayFour, LOW); delay (500); digitalWrite(relayFour, HIGH); You don't need to change the code for open/close commands. You can use open/close command instead of on/off but alexa is picky about what you name your device. I tried "Alexa, open garage" and it works fine. If you say "Alexa, garage open" it dont work. You can also say activate and deactivate to control devices.
@patrickbarrett2117 жыл бұрын
Is it possible to set the relays to pulse? So on the on command it switches on for 1 second and then switches off again?
@himanshuhanda56086 жыл бұрын
@TheMakersWorkbench My alexa is not discovering my NOdeMCU, i can see in the WIFI that nodemcu successfully logs in? Can you let me know what could I be missing out on?
@nishitpatel68407 жыл бұрын
Is the node mcu suitable for 24x7 application of home automation systems? or would it burn away?
@Themakersworkbench7 жыл бұрын
+nishit patel it's stable for 24/7 usr
@jeremytiempo96392 жыл бұрын
Is it work with alexa app mobile?
@chiranjitkarmakar91587 жыл бұрын
What is Alexa programmed? Or have to program, I'll buy Alexa, I am in India, Alexa can be run in India
@karunesh26march7 жыл бұрын
rather then using the hardcoded SSID and password is there way we can configure it and saved it ?
@roystervi7 жыл бұрын
Hi interesting pic I see you have callbackfunction.h where do you put the additional files. I have larded a sketch before
@dannymartin42257 жыл бұрын
Trying to make this project work. I am having an issue with uploading the sketch. The code compiles ok, but when I upload I am getting and error with the unit not flasing, tried a different board with same problem. Now I am noticing that the light on the relay board for IN2 is on. Not sure if that indicates some sort of error on the relay board. I tried to disconnect the wire for that relay and sketch loads but that does not seem to work. Any suggestions on the light for IN2?
@gioraver7 жыл бұрын
if the internet loss , it keep look your apliances ?
@bhavikpatel58337 жыл бұрын
alexa doesnt work. do i need any configuration in echo dot. pls help
@nareshveda32904 жыл бұрын
Could you Please Elaborate on Discovering and adding a device to Alexa please. My Alexa is not able to detect this ESP8266 device. I am finding it difficult. please help.
@justinpolackal7 жыл бұрын
Hello, Can the echo be used from a remote network to control nodeMCU that is connected to the home wifi ?
@Themakersworkbench7 жыл бұрын
+Justin Jose I am not sure if this is possible and I believe that Amazon has security measures in place to prevent this exact thing. I could be wrong though as I have not spent any time researching it.
@siddhantshah45875 жыл бұрын
Does this need Internet to work ? Or just the WiFi Connectivity (I mean what if i disconnect the CAT6 cable from the Router but keep it Running, so will it work without connecting to the Internet ?)
@Themakersworkbench5 жыл бұрын
Yes it needs an active internet connection.
@siddhantshah45875 жыл бұрын
@@Themakersworkbench Alright! Thanks Mate!
@erikhoffman5 жыл бұрын
I love your project and built it but a couple of months ago it stopped working after trying everything including uploading to a new NodeMCU I rang Amazon, they told me that they do not support this anymore Help me if you can Thanks Erik Hoffman
@shashanka83447 жыл бұрын
can we use any other device like iphone or any other one to control them
@Themakersworkbench7 жыл бұрын
Im not sure if Apple has the Siri API open to the extent it needs to be for this to work on their platform.
@arbbairagi7 жыл бұрын
great video sir..Please make a video on fan control using alexa..
@kstackdev74785 жыл бұрын
do we require internet connection , how can i buid it without internet connection
@redstook7 жыл бұрын
How did you get all devices to turn off? I can't find it in the scripts
@thomasvanlommel7 жыл бұрын
does it also work for google home mini?
@erikhoffman6 жыл бұрын
I have been able to compile but not able to upload see below What ESP2866 do you use please? WARNING: library LiquidCrystal_I2C-1.1.2 claims to run on (avr) architecture(s) and may be incompatible with your current board which runs on (esp8266) architecture(s)
@AnovaFawzi7 жыл бұрын
This is great, I should try this using my several sonoff switches (I'm not sure its compatible or not). But you should try using google home instead of amazon alexa :D
@pianoguy59275 жыл бұрын
How many node mcu can we attach with a single alexa ?
@dannymartin42257 жыл бұрын
Why did you change the relay from the LinkNode R4 to the Sainsmart relay? I made the other project using the LinkNode R4 and have had trouble with the relay going on and off?
@Themakersworkbench7 жыл бұрын
I'm not really sure what you are asking. I made this video to show people how to use the Node MCU to do the same thing that I did with the LinkNode R4.
@dannymartin42257 жыл бұрын
My question was, were you having a problem with the LInkNode R4 and was that why you changed to the Sainsmart relay? I wanted to know since I had built the first version using the LInkNode R4 relay and got everything working great with the Echo. However after the outlet stayed on a little while the power would cycle (on then off then back on again). This happened all the time the outlet was on. I changed to another LinkNode R4 only with the same result. I have contacted the seller and am awaiting a reply. I just was curious if you had a similar experience and changed relays. Thanks
@Themakersworkbench7 жыл бұрын
I have the Linknode running the poweroutlet to my PC right now, and it has been solid for 15+ hours a day of use for the last two weeks with no issues. I am not sure what could be causing it to reset like that.
@jayeshjadhav88637 жыл бұрын
Can you please tell us how to turn on off a 3 phase mains with Alexa?
@malakaperera50247 жыл бұрын
I used Node MCU and "reverb for alexa" app, I dont have echo device.however, it didn't worked with this app. it is exactly same as echo. Please help me with this
@tiwar877 жыл бұрын
I dont know why sometimes Alexa doesnt recognice the NodeMCU.. Sometimes work well but sometimes doesnt work.. Now, nothing work, Can Wemos change something in their servers or way to connect that make the NodeMCU cant connect to wiFi network thoroug intenet?
@Elad6k7 жыл бұрын
This is a great tutorial and I thank you for it!! can you create a tutorial with how to connect NodeMCU to the google home platform?
@sidneyvongshivit63137 жыл бұрын
How do you get all devices to turn on and off? I did not see it on your code. How do you add push button to it?
@tazmaniachill6 жыл бұрын
Would be a nice addition... cant find it listed in the code anywhere.
@tazmaniachill6 жыл бұрын
Just for information it doesn’t need any extra code to get this to happen... you just create groups in the Alexa app.. works very well.
@ManCrafting7 жыл бұрын
This was well done. Great job. I think I could actually do this.
@Themakersworkbench7 жыл бұрын
You should try it! Other than the echo, the parts cost less than $40
@morneleroux90676 жыл бұрын
Hi, im getting an error where the WiFiUDP is missing, where do I get WiFiUDP.h from?
@fiazmr5 жыл бұрын
Time 1:15 I did see a switch right below the LCD display, what is that for. A light turned on by Alexa, can i turn it off using the manual wall switch ?
@MrKWiley9184 жыл бұрын
It appears to be the A/C supply so yes you can... how it affects the low voltage controls if you power it back on is unknown.
@americanpsychosis114 жыл бұрын
Ok, so that didn't work. I guess I still need to get them in the library?
@ExplainingMathematics7 жыл бұрын
lcd.init(); error ...
@laurencebergamo84665 жыл бұрын
Cool intro
@bakarwadi-r4x5 жыл бұрын
can i connect more than one NodeMcu to alexa echo dot
@prasadjadhav44875 жыл бұрын
I have same query?
@teguh612927 жыл бұрын
how can you off all light at same time?
@viktor_vaughn6 жыл бұрын
I keep getting this error "Error compiling for board NodeMCU 1.0 (ESP-12E Module)" Can someone help?
@gabrielguinterherter30875 жыл бұрын
I've been getting the same error, have u u found a solution??
@nicknguyen11187 жыл бұрын
how can I customize my command instead of saying light one and light two can I make it in the way that make sense to my project
@Themakersworkbench7 жыл бұрын
+Nick Nguyen if you watch the code and read the written article linked at the bottom of the video in the description, you will see where the change needs to be made
@nearmitech4 жыл бұрын
It appears to be a well made video. However when I tried it on (after changing the SSID and PW) and choice of LCD header file, I get the following errors. ets Jan 8 2013,rst cause:4, boot mode:(3,6) wdt reset load 0x4010f000, len 1384, room 16 tail 8 chksum 0x2d csum 0x2d v8b899c12 ~ld I cannot understand where on earth that came from. The code compiles alright and yet this. Please help.
@Themakersworkbench4 жыл бұрын
That's because Amazon killed the API that allowed this to work.
@nearmitech4 жыл бұрын
@@Themakersworkbench Thank you for a prompt reply. Do you have an updated video to handle this problem then?
@Themakersworkbench4 жыл бұрын
@@nearmitech not yet but I do have the newest generation Echo Dot and will be making a new video in a few weeks.
@guillermolopez91307 жыл бұрын
can i use two of these at the same time
@Themakersworkbench7 жыл бұрын
+Guillermo Lopez yes you just have to discover the second device.
@guillermolopez91307 жыл бұрын
thank you for letting me know
7 жыл бұрын
how did you get her to read all that can you make a tut onit?
@Themakersworkbench7 жыл бұрын
+Jay Mee "Alexa Simon says "Hello Everyone"
@erikhoffman5 жыл бұрын
Looks like This is giving me an error - LiquisCrystal_I2C, why????
@AryamanVerma4 жыл бұрын
install the library
@deandaiuto7 жыл бұрын
how do you build smart home device groups in Alexa?
@Themakersworkbench7 жыл бұрын
That is done within the Amazon Alexa app on your phone or tablet, or on the webapp found on Amazon.com
@deandaiuto7 жыл бұрын
Ok thank you
@jayjunior60147 жыл бұрын
Why i get this error message Arduino: 1.8.5 (Windows Store 1.8.10.0) (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 115200, 4M (3M SPIFFS)" NODEMCU_ALEXA_wemos\NODEMCU_ALEXA_wemos.ino:31:31: fatal error: LiquidCrystal_I2C.h: No such file or directory #include ^ compilation terminated. exit status 1 Error compiling for board NodeMCU 1.0 (ESP-12E Module). This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.
@reiniercruz7 жыл бұрын
You should use this system to automate your blinds
@deandaiuto7 жыл бұрын
what low voltage device is at each light/receptacle
@Themakersworkbench7 жыл бұрын
Dean D'Aiuto I'm unsure of what you are asking.
@deandaiuto7 жыл бұрын
you have a low voltage wire running to each light/receptacle. what is that connected to to communicate with the arduino?
@Themakersworkbench7 жыл бұрын
No, those are not low voltage. The black wires are the Hot wires from the 120V mains, there is a Neutral wire and Ground wire traveling to each from the main junction box as well, you just can not see them. The Hot wires (Black) travel from each gang box to one side of their respective relays, and then the other side of each relay is connected to the mains 120V hot wire in the main junction box. The only low voltage on this project is the 5V that travels into the NodeMCU from the USB adapter, and then the 5V that powers the coils in each relay. Please, if you do not understand how mains voltage wiring works, do not attempt to build this project. It can and will kill you.
@deandaiuto7 жыл бұрын
Ok I see thank you for taking the time to answer my question.
@Themakersworkbench7 жыл бұрын
You're welcome! Thanks for watching the video and taking the time to comment!
@umairshaikh76517 жыл бұрын
CAN I GET CODE FOR DOING THE SAME PROJECT WITH 4 LED'S?
@Themakersworkbench7 жыл бұрын
Sure can, give me a couple of weeks and I will have a video up for just how to do that. If you want to do it now, all you have to do is reverse the logic going to each pin that is used, and then wire in the LED's Annode to the pin, and its cathode to the NodeMCU's GND pin.
@umairshaikh76517 жыл бұрын
I am a newbie to all this hence I won't be able to do this on my own. A tutorial video will be helpful for me. Thanks for the reply. Waiting for the video
@wenzhengpeng33376 жыл бұрын
中国能用吗?中国有好用的开源的智能音箱吗?
@maxwellmoojw85447 жыл бұрын
Great job
@Themakersworkbench7 жыл бұрын
Maxwell Moojw thanks!
@teguh612927 жыл бұрын
my echo dot cant find any smarthome devices im never change what u've done only ssid and password please help
@VishalSinghmakhla7 жыл бұрын
same for me.
@rantalbott69636 жыл бұрын
If you have one of the new V2 Echo Dots, at least some of the WeMo emulators for ESP8266 stopped working because Amazon changed the discovery protocol. I just got mine, so I haven't found out what the fix is yet. I only found out about the problem when I was looking for examples.
@clarencerulo64936 жыл бұрын
I had the same problem. My wireless network name is Thor, but I was typing thor in the code. it's case sensitive. maybe this will.help
@pccare62826 жыл бұрын
exit status 1 Error compiling for board NodeMCU 0.9 (ESP-12 Module).
@tazmaniachill6 жыл бұрын
Same here... did you find a fix?
@pccare62826 жыл бұрын
No
@gabrielguinterherter30875 жыл бұрын
same here too, have u guys found a solution?
@lennarturban95547 жыл бұрын
But only for my Knowing. It couldn't be wireless, could it?
@Themakersworkbench7 жыл бұрын
As far as networking goes it is wireless. It will never be able to be truly wireless as you have to switch the mains power somehow.
@SonuKumar-vp8xt6 жыл бұрын
Best starting music,
@fredfresnoza19827 жыл бұрын
can you send me the code..
@zwei-p19937 жыл бұрын
How did you let Alexa recite the intro?
@Themakersworkbench7 жыл бұрын
John Chen you use the phrase "simon says"
@harishankarkannan91986 жыл бұрын
My Alexa is not detecting the relays....what Shud I do
@Gyver40005 жыл бұрын
HEllo I have succe'sfully upload code serial log seems to be OK onnecting to WiFi Connected to reseaualamaison IP address: 192.168.0.12 Begin multicast .. Udp multicast server started at 239.255.255.250:1900 WiFi Connected reseaualamaison WebServer started on port: 80 WebServer started on port: 81 WebServer started on port: 82 WebServer started on port: 83 Adding switch : Light O But Alexa discovering device detect anything Do you have an ideas pleases ?
@blaze17015 жыл бұрын
I have the same problem, did you solved the problem?
@Gyver40005 жыл бұрын
@@blaze1701 I have cha,ge the code , i use the code this for 1 Device (D1) up to 10 devices you can set #include #ifdef ARDUINO_ARCH_ESP32 #include #include //if you get an error here please update to ESP32 arduino core 1.0.0 #else #include #include #include #endif String ValText; int count = 0; char line[80]; boolean connectWifi(); // Change this!! const char* ssid = "xxxxx"; const char* password = "xxxxxx"; EspalexaDevice* d1; boolean wifiConnected = false; Espalexa espalexa; #ifdef ARDUINO_ARCH_ESP32 WebServer server(80); #else ESP8266WebServer server(80); #endif void setup() { float temperature; Serial.begin(115200); // Initialise wifi connection wifiConnected = connectWifi(); if(wifiConnected){ server.on("/", HTTP_GET, [](){ server.send(303); }); server.on("/test", HTTP_GET, [](){ server.send(200, "text/plain", "This is a second subpage you may have."); }); server.onNotFound([](){ if (!espalexa.handleAlexaApiCall(server.uri(),server.arg(0))) //if you don't know the URI, ask espalexa whether it is an Alexa control request { //whatever you want to do with 404s server.send(404, "text/plain", "Not found"); } }); d1 = new EspalexaDevice("poulailler", Device1,0); espalexa.addDevice(d1); espalexa.begin(&server); //give espalexa a pointer to your server object so it can use your server instead of creating its own server.on("/Device1_on", Device1OnHttp); server.on("/Device1_off",Device1OffHttp); server.begin(); //omit this since it will be done by espalexa.begin(&server) } else { while (1) { Serial.println("Cannot connect to WiFi. Please check data and reset the ESP."); delay(2500); } } // Force the ESP into client-only mode WiFi.mode(WIFI_STA); } void loop() { server.handleClient(); //server.handleClient() //you can omit this line from your code since it will be called in espalexa.loop() espalexa.loop(); delay(1); } //our callback functions void Device1(uint8_t brightness) { if (brightness == 255) { d1->setValue(255); Serial.println("Device1 ON"); server.send(200,"text/plain","OK"); server.sendHeader("Location","/"); server.send(303); } if (brightness == 0) { d1->setValue(0); Serial.println("Device1 OFF"); server.send(200,"text/plain","OK"); server.sendHeader("Location","/"); server.send(303); } } //our callback functions void Device1OnHttp() { d1->setValue(255); Serial.println("Device1 ON"); server.send(200,"text/plain","OK"); server.sendHeader("Location","/"); server.send(303); } //our callback functions void Device1OffHttp() { d1->setValue(0); Serial.println("Device1 OFF"); server.send(200,"text/plain","OK"); server.sendHeader("Location","/"); server.send(303); } // connect to wifi - returns true if successful or false if not boolean connectWifi(){ boolean state = true; int i = 0; WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); Serial.println(""); Serial.println("Connecting to WiFi"); // Wait for connection Serial.print("Connecting..."); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); if (i > 20){ state = false; break; } i++; } Serial.println(""); if (state){ Serial.print("Connected to "); Serial.println(ssid); Serial.print("IP address: "); Serial.println(WiFi.localIP()); } else { Serial.println("Connection failed."); } delay(100); return state; }
@blaze17015 жыл бұрын
@@Gyver4000 Thanks! :)
@huseyincoskun87527 жыл бұрын
Hello I made the project run. But when I add to the code, the nodeMcu constantly resets itself.I would like to ask you to write code for 8 way relay.
@sahadathossain64365 жыл бұрын
hello alexa not see devices
@blaze17015 жыл бұрын
I have the same problem, did you solved the problem?
@blaze17015 жыл бұрын
I have the same problem, did you solved the problem?
@erikhoffman5 жыл бұрын
Would love to have a reply!!!!!!
@Themakersworkbench4 жыл бұрын
Sorry, YT studio never notified me of your comment. It's super buggy. Amazon changed the way their API worked and it broke this code. I apologize for that, but it's not something I have control over. I'll try to get a new video up soon.
@erikhoffman4 жыл бұрын
@@Themakersworkbench Vert excited to get a reply, almost gave up Please let me know when there is an update so my big project continue to respond to Alexa Kind regards Erik Hoffman
@kamlesh2mail7 жыл бұрын
G8
@jpwoodwork7 жыл бұрын
I HATE YOU ECHO!!!!!!!!! ;) LOL
@Themakersworkbench7 жыл бұрын
LMAO! You just have to be able to speak proper English for it to understand you Jamie!