Controlling everything with Node-RED dashboard via MQTT

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
yet another home automation project but this time we are using mqtt protocol on a node red dashboard that means using the single node dashboard we will be able to control multiple devices maybe it's esp32 node mcu board via mqtt protocol so if you're interested in learning this stick around let's get started okay so before starting this video let's just thank the sponsor of this video which is the ltm okay so ltv is a pcb designer based software company and if i tell you one very interesting very unique and very very useful feature of this software then this software allows you to make any angle routing now what does that mean and how it will be useful so in some electronic components which have uneven and closely packed pin spacing it's not possible to make a 45 degree path angle of the route all the time so ltm allows you to make any angle routing paths and between the pins and in the end just make them smooth to look like one single route isn't that the most useful and interesting and handy feature provided by the software i think it is and well you can also try this and many other features of the ldmpc designer software but it's clicking on the link in the description yes by clicking that link you will be able to access the free trial version of the software and if you find it interesting and useful well you can make the purchase of the software later on so go ahead and try the free trial version of the ltmpc designer software so we are gathered here to make our own home automation projects using an mqtt protocol wire node thread dashboard and in that we will be able to send and receive the data from multiple devices on a single dashboard okay so that's the agenda so we will start with the hardware introduction okay so for this project i am going to use two of my previous project one is this uh node uh mcu base like multiple sensors and multiple appliances project whose link is mentioned in this i button just go check it out this is one of the project which i'll be able to control for appliances and i will also be able to monitor temperature humidity sensors data the dst sensors data okay this is one of them and the second project is the internet and manual home automation based on esp32 board uh whose link is also in the eye button so do check it out so that's the second project in which i will be able to control four appliances for release onto that esp32 board okay so these two projects i'm going to use and if you want the exact same pcb which i'm using for these projects and you can definitely get it for free by just purchasing the techies merchandise yes go ahead click the link in the description and purchase the case must merchandise select the favorite pcb or that you want and you'll get those pcbs for free okay so that was all about the hardware part uh uh hardware introduction you can say uh we won't be i didn't put much time in it because that was already covered in some other videos rather i will put more time in explaining you how the software things work how the coding and how the node red web interface how to make that okay for this particular project i'll put more time on that particular thing first of all let's start with the node red web interface okay so here is the node.web interface and here is the complete flow that will be utilized for this uh particular video for the project that we are going to make right now okay well you don't need to make this complete flow from scratch rather i will provide you this what you can say the json formatted file which looks something like this okay you just need to copy this particular file okay after that just click here click on import just paste this file click on import and you'll get this complete flow onto your node.web interface and this json file is attached into the github repository whose link you can find in the description okay so you don't need to make this completely from scratch don't put the efforts on that okay so i will explain you what changes you need to make in order to use this particular project first of all we need to configure the mqtt node hey before that let me guide you that you'll require two external node panels to be installed for using this particular flow first is the node red dashboard okay now to get those node palette you just need to click here click on manage palettes click on install and here just search for node hyphen red hyphen dashboard and just click here on the install button and this will be installed on your system after that you also need to have the dht one one uh note palette just type dst one one and you just need to install this okay so these two node palettes are necessary to make this project or to yeah make this project work on your system as well great after installing these two you are ready to configure this particular flow okay just double click on it first of all you need to provide your uh mqtt broker it can be a cloud mqtt broker but in this project as i'm using my raspberry pi board as mqt broker on which i've installed the mqtt or the mosquito impurity broker hey if you don't know how to install amputee muscular ambiguity mosquito mosquito mqtt broker on your raspberry pi board do watch out one video in which i have guided in like step-by-step manner about how to install the mosquito i'm m3 broker on your raspberry pi board its link is also in the i button as a description okay so do watch that video out so once you install that mqtt broker your uh ipad is the local ip address of your raspberry pi board will act as the broker okay so how to add that local ipad address for that you just need to click on add new mqtt broker and click on this pencil icon here you can name your uh employee broker according to your just i will name it as mosquito okay now here you have to type the local ip address assigned to your raspberry pi board okay in my case it is 192.168.15.95 after that in the security you have to provide the username and password this is optional in some of the cases see in mosquito enquiry broker we have a choice we can either provide these credentials or we can't we if we don't want we we we don't provide those credentials okay so in case you have provided the credentials you to type those credentials here okay in my case the credentials are sachin and password is techy sms so i provided this that's it just click on the add button and that broker is successfully added onto your node red dashboard okay or note.web interface after that select that server now you need to define the topic on which you want to send the data okay so in my case as i'm using two different uh boards like one is the esp32 board another is the nodemcu board what i did is every appliances connected with this esp32 board i just put it under device one topic and every appliances and sensor connected to the esp8266 board i put it under device two topic okay so the first device is esp32 so to control the relay one attached to the esp32 board i have made a topic called as device one slash relay one similarly for relay 2 i have provided a device once let's relate to slash relay threes let's reload four and so on okay so four devices four wheels connected to the esp32 board the addresses are this and the four devices the four wheel is connected to the esp8266 and nodemcu both the addresses have this like device two slash relay two okay so this air topic is defined by me and the same topic is defined inside the arduino code as well so i will suggest you to keep this addresses same in both the cases don't change it out okay so yeah that's pretty much it this is all about the how to send the data using the mqtt broker on uh using node.run dashboard and yes uh inside this switch node i'm just sending the data one on on and zero for off that's the simple thing i'm using okay uh that was i don't i don't think i need to explain it in much detailed manner okay now we are left with how to receive the data coming from the esp8266 mode like the dst census data for that what you to do is uh you have to uh like define the topic or rather you don't need to change anything i have defined the topic just keep it as it is the topic is device to slash temp because the node mcu board is attached to the uh sorry the dsd sensor attached to the nodemcu board which is the device two in our case so i just put the address of temperature is device to slash temperature and the humidity is uh the address of the topic of the humidity is device to slice humidity okay and here i put two watch to display that you know sensors data so that's pretty much it this is the whole complete flow for our project you just need to click on the deploy button and when i go to the dashboard as you can see we got a lovely dashboard so this is for the esp32 tab the four switches and we also have the esp8266 tab in which we have four switches along with the two sensor calls so we are done with the node red configuration like everything about the node red now we are left with the coding part right the coding part of the nodemc bought the coding part of the esp32 board as well so in this i won't be explaining you in detailed manner like rather i didn't explain that note red part also in detail similarly i won't be explaining that a coding part in detail it's because i have explained this code as well as i have explained how to make that complete flow from scratch in detail in very simplistic manner uh for my members only so in case you want to understand this whole code and how i made that complete flow like node by node how i made the connections if you want to learn everything from scratch in detailed manner i suggest you to join tech sms membership in which i'm running a series of making complete home automation system from scratch in there and those videos i'm explaining all the topics in very very detailed man and simplistic manner as well so go ahead and click on the join button and join the decision membership if you want to understand everything in detail and as this is a project video i will keep it very short clear cut to the point i will let you know what changes you need to make inside the code to make this project work on your site great so this is the code for the esp32 board which is the device one if you remember okay so first of all the relay pins are defined which are the pins i have defined according to the pcb design okay so those are the pins you can change it if you are not using the pcb and making your own project you can just change the numbers according to your choice okay after that here are the five things that you need to change for your project first is that say name and password now remember you need to provide the study name and password of your wi-fi router in which the raspberry pi board is connected with as this particular this whole project is working in a local area connection you need to provide the credentials of the same wi-fi router okay after that you deploy the local ip address assigned to your raspberry pi board which will be acting as the mqtt server okay after that in case you have provided the credentials to your mqtt broker make sure you provide the credentials here okay in case you haven't brought it just delete this and leave it as it is okay that's pretty much it i suggested to not to change this uh topic just keep it as it is because otherwise it will become complicated if you don't understand like logic okay just keep these addresses as it is don't change it if you're using the same flow which i have used that's pretty much it this code will be straight away uploaded to the esp32 board and let's observe the code for the esp8266 board okay the previously was esp32 now your speed 266 first of all the relay pins are defined according to this pcb design the dst pin is defined accordingly again according to the specific design after that these five credentials are same that we have ordered in the previous code and the addresses will remain the same as i already said now these addresses are for sending or that like controlling the relays but what about the addresses for sending the sensor's data those addresses are defined at the end of the code which is this for temperature it is device to slash stem for humidity it is device tools like humidity okay so that's pretty much it about the nodemc code as well and i will straight up upload both the codes onto the different different boards and after that what i will do i will connect the appliances with the pcb project and in the end i will let you know this project and i will let you know how this project worked in action see you on the other side [Music] so as you can see i'm able to control the appliances connected to the esp32 board project using the node red dashboard along with that i'm also able to control the appliances connected to the nodemcu board uh from this node red dashboard onto the esp8266 step not only that i'm also able to monitor the sensors data live on my smartphone onto the node-red dashboard so this was the complete home automation project that we made using the amputated protocol using the node-red using the mosquito mqtt broker on a raspberry pi board remember this project is working in local area connection only it won't be able to you won't be able to access this from outside the local air network it won't be able to control y internet in short okay so yeah that was the project i hope you find it interesting i hope you got to learn couple of new things from this video if is it so consider liking this video also let me know in the comments which was the one thing that you learned new from this video which you were not at all going in before do let me know your suggestion your comments your feedback in the comments comments are very very important yeah do comment do comment below the last video was a big disaster like i didn't get even thousand views till now okay so so do comment this video uh comment below the video because the youtube algorithms understand the likes and comments only so if there are more likes and more comments youtube will promote it way more far to other people's out there on the internet okay so do comment below your suggestion one more thing as i already said it before if you want to understand everything in detailed manner do joint access membership it will not only help me by like paying the bills of the studio but it also help you to understand everything in much detailed manner that's being said ending this video here and now just wait for myself to explore learn share with me thank you sms [Music]
Info
Channel: techiesms
Views: 77,792
Rating: undefined out of 5
Keywords: home automation, node-red, nodered, node red smart home, creating automation flows with node-red, getting started with home automation, esp8266 projects, esp32 projects, mosquitto mqtt, raspberry pi automation
Id: srFQBM8qY_Q
Channel Id: undefined
Length: 13min 36sec (816 seconds)
Published: Sat Jan 23 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.