adds code


* We are going to link Alexa with Node-Red by installing the right skill into the Alexa App and the right nodes into the Node-Red. * We will install Node-Red using Docker ( you have to have Docker client installed). * Then we will create a Node-Red flow that will have a device with the unique name in our case Kitchen Lights. * And finally we will politely ask Alexa to turn the newly created device on and off * Prerequisites: * You will need a working Node-Red installation - For the purpose of this demo I will show you how you can easily install Node-Red from a docker image * Obviously you will need an Alexa device. You can get one from my Affiliate link: https://amzn.to/31MrNZj * You will also need A smart relay that can turn on and off something. I’m using Sonoff basic flashed with Tasmota firmware connected to my local MQTT server, but you can use anything you have and want instead. If you don’t have anything to control yet you can still complete the whole tutorial and use debug nodes to see that your voice commands are reaching the right place. * How-To * Create Account in Node-Red bridge - First you have to create account in the Node-Red bridge from this URL - https://red.cb-net.co.uk/newuser * Alexa Skill - Search for Amazon Alexa in your iOS or Android store and install it. Open the app and click on the menu, then on 'Skill and Games' and search for "node-red" then tap on the result named Node-RED Smart Home Control and click the “enable to use" button. Enter your credentials from the step above. * Define new device into the Node-RED bridge from this URL - https://red.cb-net.co.uk/devices - Don’t forget to type a unique name for your device. And choose a device type, that suits your needs I will chose smart Plug, because what I want is to simply turn on and off the device using my voice and Alexa. Also Leave “Power Interface” and “Report State” enabled * Discover devices - What we want to do next is to discover devices using the "Alexa, discover devices" or we can use the Alexa App. * Node-Red installation - if you already have Node-Red up and running you can skip to the part. First you need to install the docker client from https://www.docker.com. After that go to https://hub.docker.com and search for “node-red”, click on the first result, open command prompt or terminal and then copy and paste the following command:docker run -it -p 1880:1880 --name mynodered nodered/node-red-dockerThis command means run a docker container, attach terminal session to it so we can see the output, expose the internal container port to your local computer port, a name that could be anything you want and the exact path to the node-red image. Now you can see that node-red server is running at http://127.0.0.1:1880 * Install Alexa nodes - Go to manage palette from the Node-Red menu and search for “alexa-smart-“ and install them. * Configure the FLOW - You can import this flow in your Node-Redhttps://github.com/peyanski/Node-Red/blob/master/Alexa_and_Node-Red.json * (Optional) if you want to change the device type from plug to light in Alexa app follow the instructions in the vide Question of the day - what is your favourite software for managing your smart devices? Node-Red, Home-assistant or maybe something else? Let me know in the comments below. Subscribe to my newsletter - https://peyanski.com/newsletter/ Stay safe. See you next time.
Previous Post Next Post