In this video I'm going to show you how to create a heating boost automation.
Make sure you stick around, and if you like what you see hit subscribe below so you
don't miss out on future videos.
Hi I'm Will from Will Surridge Tech and today we're going to create a simple
heating boost automation using node-red. We can then create a card in Lovelace to
go with it. So let's get going! So this automation
does what it says on the tin - when you trigger it, it'll boost the heating to a
predefined temperature for a certain duration, and after that duration it will
refer back to the schedule. To make this work we're going to need a few inputs.
We're going to need an input boolean, an input select, and an input number. As you
can see mine are all referenced in separate files so we're going to add
these entities in those files now. The input boolean is used to trigger the
heating boost - we'll call it heating boost (imaginative, I know). We're going to
set the initial to off so we don't accidentally trigger the boost
automation when we restart home assistant, and then we're going to add an
icon as a radiator. For the input number it's the same principle. We're going to
use it to select how long we want to boost for. We'll call it hour, set the
initial to zero, set the range between 0 and 5, and the step is 0.25. You can, of
course, change these numbers if you want - but I think it's unlikely that you're
going to want to boost your heating for more than five hours or have more finer
control than 15 minute intervals. Lastly we use the input select this is going to
choose which room we activate the boost in. So we name it, and we add all the
options, i.e. all the rooms. I'm going to set the initial to dining room as this
is where I'm most likely going to need my heating boost. We're also going to add a
sensor. This is going to tell us what time the boost is due to finish - again
mine are referenced in a separate folder so we'll go to the sensors file now. This
is going to be a platform of a template sensor, and then we input this is our
value template. Don't ask me where I got it from - it took a lot of googling and a
lot of confusing working out, but you can just copy mine from the github. Basically
it gets the current time and adds the delay time to it to create the end time.
One problem with this sensor is it doesn't work with BST.
I'm sure there's a simple workaround, probably involving a binary sensor
telling you whether it's British summer time or not, and if it is you just add an
hour into this template sensor equally I haven't figured it out now and put it in
and I know if I'm boosting for two hours the end time is not going to be an hour
away, so I just leave it as it is. We can save, check our config and restart Home
Assistant. All these new entities should appear in our developers tab. Now we can
head over to node-red. Of course I'll add this flow to my
github so you can copy it and download it later.
In fact I suggest you download it and import it now into your node read so you
can follow the rest of this video with the flow in front of you. We're going to
need a number of nodes to do this. We start off with an event state node, then we
have a couple of call service nodes, a merge node and a switch node. After that
we have a change node another call service node, a calculator node, a delay
node and then the final call service node. The event state node is to trigger
the boost if our input boolean is on. Oh I also forgot we need another delay node
and a call service node to turn the input boolean off after a short period
of time. That means it's reusable, ready for next time we want it. The two call service
nodes are to get the room from the input select and the delay from the input
number and we can then merge them into the switch node. As far as I can tell
merging is the only way to get multiple bits of information through a switch
node only, switching on one of the bits of information. So then in our switch
node we're going to switch based on the value of message payload[0].payload.
Payload[0] is the room information because it's the first thing that went
into the merge payload, [1] would be the delay information but we don't want to
switch on that, we're only switching on the room information. We then add as all
our conditions the separate rooms, making them equals and giving them the name
that we used in the input select. Next we move on to the change node. This change
node will set our delay from the message payload[1] to message delay, and then it
can be read by a delay node later on. The first call service node is going to be
to set our temperature of our climate to 21 degrees. So we use the service set
temperature, and enter our climate to the entity ID, and then in data we set the
temperature to be 21 degrees. Next up is the calculator node. We use this to
convert from hours which we set in our input number, to milliseconds for the
delay node to understand. So we multiply our delay by 3.6 million. Next we have
the delay node - we set this to be variable based on message delay, and
lastly we have our final call service node. This is used to return the heating
back to the schedule. With the evohome setup that I use there's actually a
service to remove the override from the heating system, so I'm going to use that
service here. It's called clear zone override and now obviously you to set
the entity to the climate that is going to be clearing. If you don't have that
option in your heating system, then you can just turn the heating off at this
point, or just set the temperature to a lower value. We can shimmy them around to
take them a bit less space, and then we can copy and paste it for all the rooms.
We connect each one to a separate output of the switch node, and then we need to
make sure we change the entity in our call service nodes so it matches the
outputs of the switch node. Once that's done we can deploy and move on to
Lovelace. My Lovelace for this is very simple it's just an entity's card. So
we're going to add that new entities card now. In here we're going to give it
a title and turn off the header toggle. We can then add our entities. We're going
to add the input boolean to command the boost to happen, the sensor for the end
time, the select for the rooms, and the number for the delay time. Once that is
happy we can save it and check out our Lovelace. If you've enjoyed this video
then please consider giving it a thumbs up or leave me a comment below so the
wizards at YouTube HQ will recommend my video to you and others much more often.
So there we have it - a very simple heating boost automation. Make sure you
hit subscribe below and click the bell icon to find out more about my smart app
and how you can build yourself the ultimate smart home!