Thursday, January 24, 2019

And now for something completely DIFFERENT

Gee, what can I do with my Amazon Alexa that is more than just asking for the weather report or what time is it in Butte, Montana.  About a year ago, maybe longer, I decided that I wanted to set up Alexa to turn things on and off without buying a Pre-made switch.  I wanted to do it myself.

So I discovered a nifty device called a WEMOS D1 mini.  This little thing is like a Raspberry Pi's baby cousin.  It is not the most powerful device in the computing world, however, it can follow instructions.
The Wemos D1 mini 

You can buy a Wemos D1 mini all over the place.  Here is one link Click here.

Of course, you will need more than just a D1 mini, you will need a relay such as this:





You will also need to program your WEMOS D1 Mini and enable an Alexa skill called Sinric.

Now if you are unfamiliar with adding Alexa skills, then you must do this research on your own.

I'll wait.  Ok, now that you know how to install Alexa skills, so you will need to program the WEMOS D1 mini.  There is a link on the Alexa skills Sinric page that says you just need to go to Github (a site full of awesome and intimidating programs and genius stuff), and download the program and make a few changes and POOF...you now can command your Alexa to do stuff.

It ain't that simple.  First of all, the program is called a "sketch."  You should practice putting some sketches that are simple on your WEMOS D1 mini via the usb cable and your Arduino programming software that you read about above while I was waiting for you to study up on how to program Alexa skills.  To keep it simple, you need to look on youtube and online to learn how to program the Arduino type computing devices via your computer and a usb cable.  This is your learning curve.  Now once you have succeeded in taking some baby steps and have uploaded some sketches to your Wemos D1 mini, then you can play with that a little.

Next comes the hard part, and that is uploading a complete and working sketch to actually tell you WEMOS D1 mini via your Alexa to "do this" or "do that."  Your Wemos D1 mini will be connected to a relay like the one pictured above, and then this will allow you to wire in any device that is appropriate to the specs of your relay.  Keep in mind the YOU CAN GET SHOCKED IF YOU TOUCH LIVE CONTACTS ON YOUR RELAY.  So take precautions like you would with all exposed wiring.  If  you don't know what you are doing, THEN DON'T DO IT.

Now, if you look over the Github link , you may be scratching your head saying "this makes no sense to me."  If you get that far, then you are on your way.  However, you must upload a working sketch to the Wemos D1 mini and enable the Sinric skill in order for your voice commands to Alexa to actually work.

If you get to this point and can figure it out, then spectacular and you will now have a means of turning things on and off  and can say that YOU DID IT.

If you get to this point and cannot get your sketch to work, then contact me and I will try to figure out what you did wrong in your sketch.

The nice thing about the arduino programming software is that it tells you where to debug (fix) your sketch. 

So what can you do with this?  Well, pretty much anything that requires a switch (within the capabilities of your relay), can be activated by just telling it what to do.  How will this fit into your shack or your life?  That is for you to decide.

In the meantime, get online and if you are interested then you can start writing sketches to do things with your Alexa that you don't have to purchase.

Good luck and 73
Mark 4x1ks

No comments: