Home Assistant Automations versus Node-RED

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video we're going to talk about home assistant automations and comparing them to node-red is one better than the other or is there more to it than that I started out my journey with no dread about four to five years ago and that was because I was starting to reach the limitations of Home assistant automations but that's not quite the case anymore if you need to do something with home assistant entities then it's very likely you can use a home assistant automation to do the job but just because you can does it mean it's the right way to do it or the easiest way to do it well that's what we're going to look at in the video today foreign [Music] automations is the way you create the automations rather than what they do themselves so in home assistant it's broken down into three fairly clear sections so you've got triggers conditions and actions whereas in node red you've got a drag and drop approach where you drag nodes onto the page and then connect them together in a certain sequence due to some of the improvements in home assistant automations I've started transitioning some of my simpler node-red automations back into home assistant that's because it's easier to manage some of them in home assistant because if you've ever tried modifying a flow in node-red from your phone it's not very easy at all whereas High resistant automations you can easily manage from your phone another thing to consider is that what's easy for one person isn't necessarily easy for another person I had an interesting conversation a couple of years ago with the guys over at home assistant podcast film Rohan so Rohan was somewhat open to the idea of using node-red whereas Phil wasn't really that interested his his view was Why move a bunch of boxes around when you can do something with a couple of lines of yaml so I thought that was quite interesting and if you want to check out the podcast and I'll leave it in the description below so I've created the same Automation in both node-red and home assistant I would say this automation is a medium complexity so we can have a look at some of the intricacies and then you can decide which one you prefer so what the automation does is it tries to open the blinds as early as possible in the morning but whilst ensuring that we're not still in bed so if it's 11 30 in the morning then it will open the blinds by default because we should be out of bed if it's 8 16 in the morning then it will check to see if there's been motion upstairs in the last 15 minutes or not and if that hasn't then it will open the blinds or if away mode is on then it will open the blinds at that time as well otherwise it will check between 8 AM and 11 30 am to see if there's been motion upstairs for 15 minutes or not and as soon as there hasn't been motion upstairs for those 15 minutes then the blinds will open so let's have a look at the home assistant automation you can see there's three triggers here there's one for 11 30 am there's 146 for 8 16 am and you can see I've got trigger IDs here and then there's one for the 15 minute motion so if it goes from on to off for 15 minutes upstairs and that will trigger and let's have a look at the conditions so between 8 AM and 11 31 so it has to be between those times and then these are the conditions that relate to the triggers so we've got this one which checks if it was triggered by the second floor motion after 15 minutes this one which checks to see if it was triggered by the 11 30 trigger and then let's skip to this last one this checks where the remote away mode is on or not and then this one here has two checks within it so basically if it's 11 16 in the morning it has to check to ensure that there's been no motion for 15 minutes and then if any of those four conditions are met then it triggers the actions so opens the lines for the guest room blinds it also does a check in here to ensure that guest mode is off so now looking at the node red automation let's start at the top so at 11 30 in the morning each day this will fire and then it goes into here this is not really required but it just makes it simpler because there's four nodes over here it will go straight into these and open the blinds you can see that for the gas blind it's got this condition here to ensure that guest mode is turned off next one down so second floor motion let's click into this so if there's been no motion for 15 minutes on the second floor motion sensors which are set up as a group then move to the next step which is checking the time range to ensure it's between 8 AM and 11 30 A.M and then likewise it triggers the blinds to open so the last section is the 816 trigger so 816 each day it checks to see if away mode is on or not if away mode is on then it automatically goes to here and opens the blind otherwise if away mode is not on then it checks again to see if there's been Motion in the last 15 minutes once there hasn't been Motion in the last 15 minutes then it will open the blind I'd be interested to know which version of these you find the easiest in this example I find node red a bit easier but there are certainly a lot of automations where I find the Home assistant version easier to do now let's talk about some of the strengths and weaknesses between no dread and home resistant automations so no drag that's got access to all of the entities and services within home assistant so you could argue that node-red is the better of the two and can do everything that home assistant can and more however you've got to consider that node-red is a separate system it's either a separate system altogether or it's running as an add-on within home assistant so you can get communication issues between the add-on and between home assistant or it could just stop working the benefit of having everything inside home assistant is that it's likely to work and if it doesn't work it means that everything altogether has stopped working in home system so it's easier to troubleshoot and easier to maintain the ability to update just single nodes or single Flows In node-red is really nice and I like that however home assistant made some changes a few releases ago which means that when you update a Automation in home assistant it only affects our automation whereas previously it would impact other automations as well so if any other automations were running or waiting for some State changes then that would get impacted whereas that's not the case anymore so I would say they're fairly even on this front I would also say that home system automations are fairly intuitive and easy to create and also for power users you can still go into yaml mode which is quite handy as well so there's a lot of flexibility within the UI so now let's talk about where node-red potentially has the upper hand although home assistant has thousands and thousands of Integrations node-red also has a lot they've got palettes that are created by the community and you can use them to communicate with different apis and also if there isn't an integration you can generally build it yourself within node-red I particularly like that node-red can actually link to more than one home system instance so say if you've got an RV or a second home you could actually have one node-red instance running and communicating with both instances of Home assistant and automations that combine the two you can do something similar in home assistant using the mqtt state stream or mqtt bridging but I would say that's a bit more complicated to set up whereas in node-red you just set up your connections and you point it to whatever you want to point it to one of the nodes I use quite a lot in node-red is a HTTP request node in home assistant you can make API calls but it's fairly limited and pretty much limited to basic authentication whereas in node-red you can use the function node to do a lot of complex calculations that are needed for some API connections an example of an API I connect to is the blue iris API so I use that to change profiles so that when we're not in the house then it changes the profile to start recording on more cameras a couple of the other apis I connect to a nice hash and switch part so do home resistant automations make node redundant or does node-red still have its place let me know what you think in the comments down below and if you want to know more about node-red so some of the other nodes like the function nodes and the switch node then please let me know as well I hope you found digging into the differences between node-red and home resistant automations somewhat useful or interesting and if you did or got any ideas then please leave them in the comments below and whilst you're there consider subscribing and liking the video well that's it for today so thanks until next time [Applause] [Music]
Info
Channel: Let's Automate
Views: 10,964
Rating: undefined out of 5
Keywords: NodeRed, node red, Homeassistant, node red automations, Home assistant automations
Id: SVbyc9AseqA
Channel Id: undefined
Length: 9min 36sec (576 seconds)
Published: Thu Mar 30 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.