How To: DIY Home Automation With ESP8266 and Amazon Alexa!
HTML-код
- Опубликовано: 4 окт 2024
- *****************NOTE******** The code contained in this video no longer works after an update to the Amazon Alexa API. ****************************
Welcome back to another installment of The Workbench. In this video, I describe how I control a LinkNode R4 ESP8266 4-Channel Relay Board With Amazon Alexa, and demo the final results.
The written tutorial that accompanies this video can be found here: bit.ly/2hbIO8u
Link to GitHub - bit.ly/2hd5l7E
Buy The Linknode R4 on Amazon.com: amzn.to/2kMD5IC
Link to LinkNode R4 User Manual - bit.ly/2hdchSA
LinkNode R4 Android APK - bit.ly/2heSoYx
LInkNode R4 IOS App - apple.co/2htKppF
If you like this video, please consider becoming out patron on Patreon. - bit.ly/1FWfVqT
Additionally you can follow us on:
Facebook - on. 1dwf8AE|
Instagram - @MakerofThingz
Twitter - bit.ly/1F9wjhc
The Web - www.themakerswo...
Element14 - bit.ly/2dKow9d
Pick up everything you need to build this project at Amazon.com by using the links below. This helps support our channel!
Amazon Echo Dot - amzn.to/2h55l6Q
LinkNode R4 - amzn.to/2gDKR4z
5V Power Supply - amzn.to/2h7RDDf
FTDI Cable - amzn.to/2h7PdEz
what amazes is me is how the shape of the board looks different as it rotates
Yes, I am very interested in tutorials on how to get Alexa/Dot up and running. I have a fully computerized house control network, but right now it's all wired. I have, and was planning on eventually figuring it out, ports available for external inputs via other modules. Alexa and ESP8266 (several in my parts box) seems the way to go.
Check back on 2/10/2017 for a Node MCU and 4-channel Relay Board tutorial.
Made it and it's running. Thanks very much.
After days of failure finally got it programmed as a "WeMos D1(Retired)" board at upload speed 115200. Also for any other total noobs like me the RX and TX connections are crossed between R4 side and USB side. So hook up RX on usb serial board to TX on linknode r4 board and vise versa.
awesome work, man! i used your code to build one on my own. but instead of relais, i used a 433mhz transmitter to control rc electrical outlet switches. thanks for sharing the code!
Nice video.
Could you do one for all the newbies out here?
From how to get the libraries to how to install them and setting up the LinkNode?
Would be very helpful.
i was looking for a tutorial to do this exact thing. thank you very much! excellent walk through!
Jody Cochran thank! glad I could help
This is great! I have to try this out! Just got a couple echo’s in the house
WiFi Connection problem? If you have a problem getting WiFi to connect (as I did) change the amount of time it waits for a connection to something larger. It was just 10 in the version I used, and that wasn't long enough. In the ConnectWFi() routine I changed the conditional from 10 to 20 and that worked.
Thanks for the Tut, Easy to understand and now I must put it to use.
Thanks!
I am just getting started in to this world of fun stuff.
You did a great job
Thanks Darrin!
I like it very much, just ordered LinkNode R4. If you can show the step by step it will be perfer. Because it is new to me.
Awesome video. I'll definitely use this with my Sonoff devices... Thanks
I have not been able to get past memory error. I'm only seeing transmit light flash 3 sets of 3 on usb. Then espcomm_upload_mem failed.
I love that you made this video, just hope I can overcome.
I get this error too on both the Linknode and Node MCUs. I usually have to unplug the serial cable, and the power from the unit, plug it back in and all seems to work fine. Make sure the programming jumper is in the right configuration.
Awesome job Charles!
Thanks!
Any way you could explain the wiring (or point me in the right direction to learn it myself). I am very new to this and am not sure how it all connects together. Other than that, awesome tutorial I can wait to try it out
Thanks for sharing this project. Could you please elaborate on how to make Alexa discover this device.
The first thing that work for me after months and countless late-night hours and frustration. Thank you very much. Amaizing work. At the same time would like to ask askyou you how to assign a pin for a led Wi-Fi status and pins to control the relays individually with push buttons. Just like Sonoff 4ch works. Thank you.
Go it working. Thanks.
Initially it did not work though Alexa recognized the unit. But after short circuiting CH_PD to Vcc in Linksprite and again asking the discovery to alexa it worked perfect for all the four relays
SSID and the PW are hard coded. Can a method be developed to make those changeable by software or application or a mobile phone?
Thank you from Germany. It´s works!!
+Terra-Ignition thanks!
Nice. How you learn Alexa to send TCP/IP commands to your ESP8266 ?
Perfect JOB! Please , i need full code video ? Thanks!
Is there the video to show how to set up the light and other devices for this video?
Great video - Thx for that. One point. is it possible to ask Alexa about the status of the light "Alexa Is light 1 on?" not sure about that.
Hi, I really like this tutorial. I ordered the Linknode R8. However, I am trying to figure out how to use the FTDI cable. I am using the recommended FTDI cable, however that 6 pin cable does not line up directly with the Linknode's 3 pin setup. The TX and RX pins are in different locations. Can you please shed some light on how the cable needs to be hooked up?
Owsome how simple this is, I won´t need my raspberry pi to be the middle man! thanks!
Good deal! Or you could still include your Raspberry Pi, MQTT, and Home Assistant to have multiple ways to control this!
Yeah can you make a video explaining your code!! I really want to learn how to code in Arduino. Thanks
Unfortunately,, the LinkNode R4 doesn't appear to available in Europe, well not through any Amazon outlet. I have used a NodeMCU and successfully compiled and uploaded the code. However, Echo/Alexa cant discover the device so I've got to find out why. Awesome project with very straight forward code - now subscribed and a patron.
Thanks for becoming a Patron Alan! If the Echo can not find the Node MCU make sure it is connected to your WiFi and that both devices are on the same SSID. If the Echo is on a 5GHz and the Node MCU is on the 2.4GHz SSID, they will not find each other.
In the past two weeks I have seen some reports of people having to enable the WeMo skill, on their Echo first, but it was already enabled by default for me. I am not sure if it comes disabled in the latest update or something.
liked! please do some code tutorial awesome work there
I will see what I can do over the next couple of weeks.
subbed, look foward to that video...
Could you please share on how you got alexa to discover the devices and so on
Hey.. Great stuff! But Alexa doesnt seem to to discover the device. I can ping the ESP though.
Great Video! Used a NodeMCU with a single relay and just removed the code referencing to the other relays and outlets. Currently uploading the sketch to an ESP8266-01 to see if I can get that to work too.
Thanks again!
Worked great on the 8266-01!
Awesome!
after you upload the code what do you have to do on the alexa side to get it up and running?
I simply had to ask "Alexa discover devices" and it worked fine, but some people are having to enable the WeMo skill first. It use to be enabled by default, but it appears that is no longer the case.
dear sir i would really appreciate how do i change name instead of light i want fan what should i do ?? which part in code should i change ?
I have tried to set up my EchoPi with this and I can't get the devices discovered. Does all the connections need to be made in order for the Echo to discover all these devices?
I am not sure if this will work with EchoPi. I have yet to try.
Two things... 1) I can't figure out what to do with the "Arduino Core for LinkNode 4" that the LinkNode website told me to download but never tells me to install/configure/setup... and 2) I get a 4 part warning stating "warning: espcomm_sync failed" and 3 other associated messages. I thought I burned it up by having my FTDI set to 5v. Bought another one and only have tried 3.3v. No Joy. :( I have followed the LinkNode tutorial (half way down for Arduino Programming) step-by-step. No Joy.
Hi can you please make a tutorial for NodeMCU and a relay setup?
I will have it ready in a few weeks. A few other things to finish up before I can get around to it.
I flashed your sketch to LinkNode R4 and all seems to work.
However if I try Alexa to search for devices it does not find any, although the NodeLink is broadcasting.
Yhe WeMo skill is unusable as it requires a Belkin MAC address, others wil not accept.
Can you please explain how you pair the LinkNode with Alexa?
Can you tell me what is upnp broadcast. I'm kinda beginner so don't know these kind of stuff
Great Job, Im gonna try that, Just ordered the linknode r4 and and a amazon echo v2. Is there anything else i need?
HI, I wanna try the Node R4 to control with Iphone Siri, what possible changes do I have to make in the codes to achieve that?
Great Tutorial! Thanks for this and supplying to source code. I am running into an issue where my NODEMCU ESP8266 WiFi Connection will drop out after a short period of time. I then have to unplug the device from power and let it sit for a minute. before plugging it back in, reprogramming it before it will reconnect. Any ideas? I am using this to control WS2812B RGB LED strip with external 5V power source. Thanks for any advice you can provide.
hey i wanted to link it with my DIY alexa will it work? its done with a raspberry PI 3 please help me
is there like a $5 version that has 2 relays?
i bought a broadlink pro with 433mhz to use with alexa but it would not learn a few of my remotes including the garage door opener no i have to get 433 mhz relay boards to control and hop the broadlink will be able to learn the a remote, good thing about them is that they can learn any remote 433mhz and they are cheap you can buy 1,2, or 4 relay versions ,this is a much more direct solution,but i thought the broadlink would learn all my remotes this may have been the better way to go, and just have bought the much cheaper IR only broadlink RM for my IR devices
thank bro
I have a interesting question
How can we connect node mcu with Alexa amazon to control servo to make lock door
please
i made alexa using raspberry pi , can i use it in house automation ...?
In theory, yes.
do we need to code alexa too?
i mean what does esp there for ?
how is the wiring connected? to the lights...
Is anyone else having an issue where the linknode just flashes LED D3 once the code is uploaded?
It looks like the R4 is no longer available. Is there an alternative?
I have updated the link to the R4 that appears to be back in stock at $10
Awesome work dude!!!
Thanks!
Could this be use to tigger transistors?
CAn i use arduino output pins for relay? i want to connect 11 outputs..??
nice work!
Thanks Becky!
Super cool :). Awesome work..
I got this board and was wondering if gpio16 goes high and stays on for yours also. It turns on one relay when turning on. Which is quite annoying since I want it all off when booting.
Id rather not have to write the program to turn 16 off every time after starting. I am working on loading micropython on mine also
+Stuff With Kirby from what I can recall, GPIO16 does not stay high.
By the way good video. Thanks
How do you make Alexa to speak your intro script?
Any alternatives to linknode? Out of stock
Hi,
Does this switch support interlocking mode ??
how can i buy this EPS 8266 and how to program?
good info after my nausia from the board spinning for the first 2 minutes subsided
When is the FTDI Serial TTL-232 USB Cable used and is it required for this project?
Could you use this instead? www.amazon.com/Blue3D-Ft232rl-Serial-Adapter-Arduino/dp/B012YUANZK/ref=sr_1_8?s=electronics&ie=UTF8&qid=1490558089&sr=1-8&keywords=FTDI+Serial+TTL-232+USB+Cable
Hello,
Is there a way to get the Linknode R4 to connect to OpenHabian2?
I uploaded the code then how do i enable with alexa skills? please help me
Is it currently unavailable, is still on sale?
How do you make Alexa speak the introduction?
Thank you! Thank you! worked great for me the first time.
However the second time its giving me this- fatal error: switch.h: No such file or directory......
I've made sure the files you supplied from git hub are in the same file as the sketch. I can even see the tabs behind the main sketch tab on the IDE.
But am so stumped. Ive tried deleting and re downloading arduino IDE, and all else i can think of.
Thanks for any help :)
Make sure that none of the sentax has changed. I just downloaded my code from github and it's working fine for me. I am not sure what could be causing that error.
Thanks for the reply. After some time looking into it, i found that the compiling error was caused by the main library folder needed to be renamed and simplified to where it does not contain any characters other than letters and numbers.
I keep getting this error: "warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed" any ideas? I'm using a FTDI drive to connect it but this is supposed to work.
I get this error too on both the Linknode and Node MCUs. I usually have to unplug the serial cable, and the power from the unit, plug it back in and all seems to work fine.
I finally fixed it, but I basically just kept moving around the jumpers and doing things to reset it. It just seemed to randomly work once every 20ish times. Anyways I have it set up now and it works amazingly thanks so much!
I'm assuming the same can be achieved with an ESP8266-12 and a separate relay board module (just more work with the iron)
Yes ...no problem
Yes, in fact that is how I came to find the Linknode R4. I was looking for a pre-built ESP8266 4-channel relay board. I had previously built a DIY relay and ESP8266 solution.
awesome work!!! congrats..
hi when trying to add a device, i chose to carry on the port sequence so port "84" and "85" but it doesnt work for some reason? can anyone help on this? in the serial monitor it says this "ets Jan 8 2013,rst cause:2, boot mode:(1,7)" "wdt reset" and loads of other commands! if this helps the problem. thanks :)
Great video
Super cool!
Thanks!
Do full code video!!!
I will see what I can do over the next few weeks.
Hey there, do you think there would be any issue with setting up sereval Linknode R4s to be controlled by Alexa?
In the switch.cpp file you should be able to change the device serial number to something unique to each device, and that will allow multiple units. I am not sure if the WeMo skill is limited to 14 switches total or if it is limited to 14 switches per device though.
Can you show us how to this with a seperate relay and nodemcu
That video will be out tomorrow! Thanks for watching!
Thanks for that I will subscribe and wait for it.
So any updates about that tomorrows video?
Amazing dude, i am trying to do it with bluetooth, if you have any advice i would appreciate it
thanks (:
Hey Luis,
Are you trying to control relays with bluetooth? Give me a little more info, and I will see what I can do.
Could u give me ur mail to send you more info?
Sure shoot me an email at themakersworkbench at gmail
1.) Hi,is that posibble to make ESP8266 to hangle max 14 single device name in one chip?
if it's work,whick port is better to uesd? [80-90]/TCP、[91-100]/TCP ?
thanks a lot =)
+韋凡陳 I'm not sure. Sorry.
Does this still require the LinkNode Cloud to use this. Or is it self contained? This is a huge deal for me if its self contained.
Nicholas Lenzo its self contained.
Fan Freaking Tastic. Awesome. You made my day!
Nicholas Lenzo awesome! can you give a hint about your project?
Its most likely going to be a Base station that uses esp8266 or ethernet to listen for Alexa, then send out to cheaper units that control outlets using the nrf24l01. I have several lamps in my house that are very annoying to turn on/off. Probably going to make a Website to control it as well.
look into the home assistant project. I'm working on a tutorial now on how to use those cheap remote controlled outlets from Amazon using an esp8266 and alexa
amazing. nice try.
hello .. i want to do the same but instated of doing it using echo dot can i use this using alexa in raspberry pi ? will it be the same ??
Technically it should still work as long as the WeMo skill works on the Pi. That may be a future video if there is interest!
yes plz, when you will upload the same video
Hi I've just ordered a board after seeing your great video, I already have an echo dot which works well with my existing wemo switch. With my wemo I can control it locally via alexa and remotely via the wemo app from anywhere. Can I do this with the Linknode or am I restricted to local use via Alexa?
+Raymond Bradshaw Unfortunately not. The Wemo app will not recognize the device running the Fauxmo code.
I didn't necessarily mean the wemo app, I notice you linked to the LinkNode R4 Android APK for remote control, is it possible to retain this code and control it from this remotely as well as by Alexa? That would be the icing on the Cake!
I'm sorry I guess I misread your original question. Technically the two pieces of code could be merged, but as it sits right now, it is one or the other.
If you check out my github, a few people have forked the code, and are working on a better solution for the WiFi, so maybe once their fork is finished, we can fork their code to include the Linknode R4 App code.
That would be great its a long time since I did any coding etc (Z80 machine code in the 80s). Have been quoted 20 to 40 days for delivery from ali-express as they don't seem to be available in the UK. So I have plenty of time to brush up my skills.
The LinkNode R4 can be bought on Amazon and has Prime too! amzn.to/2iB9C1P
Awesome video man!
Thanks Nolan!
Do I need to have a specific "skill" enabled to make this work?
On my echo I did not, but I have seen a few people say that they had to enable the WeMo skill on their echo dot that was purchased within the last month. So I am not sure if a software update disabled the WeMo skill or not.
Yes - i got that far this afternoon. The Wemo skill used to be one of the available skill selections but apparently it is now built in to the Echo Dot so it cant be selected and I think the assumption is made that these devices will work by default. Unfortunately, while it might work for genuine Wemo device, I have no way of knowing, it doesn't for this project. That is a shame. Where do I go from here?
Alan Powell, Were you able to make it work?
I didn't have to enable anything on my Echo (about a year old) or a new dot. Just had Alexa search.
how can i upload the code into esp8266
Hi there
Do you have a list over words we can trigger Alexa with ?
As far as this project goes, you can set the trigger words in the code, and they can be anything you want them to be. If you are talking about Alexa trigger words in general, a quick google search will come up with dozens of different words, phrases, and skills you can use to do many different things with Alexa.
Ok as long as I say "Alexa, turn xxxxxx" on or off right ? Because if I say "Alexa, T.V. on" She can't understand it.
What if I what to use "Alexa, turn channel up" ....
what would be needed to do, for recognize the "up" word ?
+Tim M is your TV compatible with alexa? Im not sure what you are asking. Do you have the linknode connected to your tv? If so, all it can do is turn on the power going to your tv, not the tv itself. This tutorial is more so for things like lights, fans and other on/off type things
Ok sorry for the crypto question :) My goal is to use Alexa to turn on my infrared things, such as TV, amplifier aso. It's a expansion of yours and 3 other project ...Heres a bit of my sketch :
/* Declare Samsung TV callbacks (on-off) */
void SamsungTVOn(); //Samsung TV toggle ON/OFF
void SamsungTVOff(); //Samsung TV toggle ON/OFF
void SamsungMuteOn(); //Samsung TV Mute
void SamsungChannelUp(); //Samsung TV Channal up
void SamsungChannelDown(); //Samsung TV Channal Down
void SamsungVolumeUp(); //Samsung TV Volume up
void SamsungVolumeDown(); //Samsung TV Volume down
void SamsungCH1On(); //Samsung TV Ch 1
void SamsungCH2On(); //Samsung TV Ch 2
void SamsungCH3On(); //Samsung TV Ch 3
/* Declare Marantz callbacks (on-off) */
void AmplifierOn(); //Amplifier ON
void AmplifierOff(); //Amplifier OFF
void AmplifierVolumeUp(); //Amplifier volume up
void AmplifierVolumeDown(); //Amplifier volume down
void AmplifierAuxOn(); //Amplifier Aux input
void AmplifierTunerOn(); //Amplifier Tuner input
void AmplifierTvOn(); //Amplifier TV input
void AmplifierDVDOn(); //Amplifier DVD input
void AmplifierScourceUp(); //Amplifier Source up
void AmplifierScourceDown(); //Amplifier Source down
void AmplifierMuteOn(); //Amplifier Mute toggle
void AmplifierMuteOff(); //Amplifier Mute toggle
/* Declare Mile callbacks (on-off) */
void VacuumCleanerOn(); //Vaccum Cleaner toggle ON
void VacuumCleanerCornerOn(); //Corners ON
void VacuumCleanerGoOn(); //Go Go Go
void VacuumCleanerBaseOn(); //Return to home
But I'm having troubles getting Alexa to understand the UP/Down commands. Probably because she don't know them. I think I will have to create a Skill for her to understand UP/Down commands. (Or find a skill who will match) I'm also planning to use dimmers for the light, but it will come later.
You can see some of my project here: github.com/tvixen/Wemo-for-Alexa
I just thought that you might have a list over words we can trigger Alexa with, In this context?
+Tim M try the words tee vee instead of TV
nice
One big fucking question, do i have to upload this program on ESP8266 or on the Arduino board??
Can we set timer ?
Not in this version of the code, and I am not sure if anyone has successfully modified the fauxMo code to set a timer on WeMo switches yet.
hi. hello great video...
i got mine woking fine. istrate away.. i used a esp-12E .
and a seperate 8way relay board.... ( sorted all woks 5star)
is it possible if you could tell me how to add to the code so that im using the esp-12e ( 8) gpio pins to switch 8 individual outlets.. on the relay board please...
im not to sure about the port area numbers... 81/82/ ..... then to add another 6
thank you.
i
hey bro
Getting dizzy
ok