Home » Blog » Save Energy and Costs with Home Assistant! 5 Tips!

Save Energy and Costs with Home Assistant! 5 Tips!

Hi! Energy prices are going through the roof these days. I heard from some people that they have to pay 900 euros per month for gas and electricity these days. Luckily we have Home Assistant that can help us lower our energy costs by creating smart automations. I will show you five ways to save energy costs in this Home Assistant Tutorial! Home Assistant to the rescue!

⭐⭐⭐ NOTE: ⭐⭐⭐

This article accompanies a YouTube video. I wrote it for people who would rather read than watch a video. To keep doing this, I would like to ask you to check out the video, leave a comment under the video, give the video a thumbs up, and subscribe to my YouTube channel. This means that the video is offered more often to new visitors so that they also stay informed of the latest Home Assistant tutorials.

Thank you for your support!


You can watch the video here

I was shocked when I saw the new proposal from my energy company for the next year. Prices for energy are much higher and costs for heating your house and using electricity are excessively high nowadays. Luckily, I use Home Assistant. Home Assistant turns out to be the perfect tool to keep your energy bill as low as possible. I went through my automations to see if I could make them even smarter to save on energy costs.

Let’s go through five automation tips that can help you to cut down on your energy costs.

Save Energy Tip 1: Turn the heating off automatically if a Window is Open.

For this tip, you’ll need a Thermostatic Radiator Valve such as the Plugwise, Tado, Honeywell Evohome, Netatmo, or any other brand thermostatic radiator valve. I use the Honeywell Evohome for 4 years now and I am very satisfied with it. The downside is that it needs a cloud service to work, but it does the job well.

This automation checks if a door or a window in a certain room is open for a couple of minutes. In that case, the heating for the room will be turned off until the door or window closes again. This can save you quite some money, especially if you have kids that open their windows and forget to turn down the radiator valve when they do so.

This automation looks like so:

This automation has two triggers. One that checks if the garden door left is opened and one that checks if the garden door left is closed. If I open this trigger, you see that the device is garden door left and the trigger is garden door left contact opened and you see that I set the duration to 5 minutes. So that means that this trigger will only trigger when the garden door is open for 5 minutes or longer. You see that I gave the trigger the trigger-id Door Opened. You can add a trigger ID by clicking on the three dots here and selecting Edit ID. I already did that. If you don’t know how trigger ids work, please check my video on trigger ids to understand how they work.
The next trigger checks if the door is closed. So, again Garden Door Left. The trigger is Garden Door Left contact closed and the duration is 5 minutes. Now, we go to the actions and what I did here is that I use an if-then action. And in the If I’m going to check if the trigger is Door Opened. So, if Door Opened, the Trigger ID Door Opened, Then Climate Turn Off Livingroom. So, what we’re doing here is we’re calling a service.

The service is called climate turn-off, and the entity is called living room. So you can choose entities here. Else we want to turn on the living room again. So, here we do again a call service climate turn on and the entity is again Livingroom. So, if you read this If the Trigger is Door Opened Then turn off the climate else turn on the climate.

You can also choose to turn down the temperature instead of turning the heater off of course.

Energy saving Tip 2: Do not turn on Lights if Lux is higher than a certain value

This automation checks if there is enough light in a room when a motion sensor is triggered. If so, the lights will not turn on, even when there is motion in that room. This might save you some energy costs, especially in rooms that are rooms that you visit often, like a hallway or a kitchen.

The automation looks like so:

This automation also has two triggers. One trigger is that it starts detecting motion and the other trigger is that it stops detecting motion. So if we’re going to the starts detecting motion you see that I have a device. In my case Motion Sensor in my hall downstairs. I’m checking if it’s starting detecting motion and I gave it also a trigger ID Motion Detected.

Then we go to the other trigger. My device is again my motion sensor in the hall downstairs and now we are detecting that it stopped detecting motion. And the duration is set to 5 minutes. So, if there’s no motion detected for 5 minutes then this trigger will do something. Now we go to actions, and again I created an If-Then action. In the If action I have this trigger When Triggered by Motion Detected, so I’m checking here on the trigger id Motion Detected, but I’m also having another condition that is the Lux value within the hall. What this condition is doing is that it has an entity.

The entity is Hall Downstairs Motion Sensor Illuminance Lux which returns the Lux value within my hall downstairs and I’m saying if that lux value is below 50 then you may do something. What these two If conditions are saying is that if there’s motion detected and if the lux is below 50 then turn on hall downstairs. So, what you’re seeing here is again device hall downstairs, which is my light, and the action Turn On Hall Downstairs. Else, Turn off Hall Downstairs. So basically what it’s saying is that if there’s no motion detected for 5 minutes then turn off the hall downstairs.

Save Energy Tip 3: Turn the heating and lights off automatically when everybody left the house

This tip is a no-brainer! If nobody is at home, it’s in most cases logical to turn your heating off or lower the temperature of your heating. With lights, it might be a little bit different, because some of you might like to keep the lights on while you are away from the house for security reasons. But, in that last case, you probably only want some lights to stay on and not all!

This automation does exactly that. It checks if the last person left the house and turns off the heating and the lights. You can alter the automation to your taste to leave some lights on or just lower the temperature of the heating. The automation will also turn the heating again as soon as someone enters the house. I believe that this automation can save you a lot on your energy costs. Leaving appliances on that use energy while you are not at home is a waste of money.

I created THIS video before that show how you can turn on the heating already when you are approaching your house. You might want to check that one out too.

This automation looks like this:

For automation 3 I have two triggers again. The first one is when Home changes to zero and the second one is when Home is above zero. This trigger, the first trigger is a state trigger and it checks the state of the entity Home, which is the Zone in my Home Assistant. The state of the Zone has a value of zero or higher than zero. If it’s zero then nobody is at home and if it’s higher than zero there are people at home and based on the number of that state we know how many people are at home. So, if the state of our zone home gets the value zero, then we want to do something and I gave it the trigger ID Nobody Home.

Then the second one is a numeric value trigger. So what we’re doing here is again the entity is our zone Home and we’re saying if the value gets to above zero, then do something. I’ve chosen for a numeric value trigger because sometimes more than one person comes home at the same time. So it’s then above zero. Now, we go to actions. Action is again If Then.

The first If is When triggered by Nobody Home. Again I’m checking on the Trigger ID Nobody Home. So, If nobody is home then I want to turn off the lights and I want to turn off the climate. And you see here that it’s saying unknown entity and that’s because I applied a little trick here. So if I open this, you see that I use the service Light Turn Off and in targets, I’m not choosing an entity, but I’m typing in “all”. And that just works. So, that is the trick here. You type in “All”. So, when nobody is home then turn off all the lights. And we’re adding another action here and that is to turn off our heating. So again I use the service climate turn-off in this case and for the entity, I’m typing in “All” here.

Okay, let’s close this. Else we want to turn on our heating. So, when somebody enters the house we have the service climate turn on and again at entity, we’re typing in “All”.

I need your help!

You will be doing me a huge favor if you subscribe to my channel if you haven’t already. And, you help me a lot if you also give this video a thumbs up and leave a comment. This way, YouTube will present this video to new people and that will make the channel grow! In the description of the video, you will also find information about how you can sponsor me so that I can continue to make these tutorials for you.

Thank you!

Energy saving Tip 4: If the temperature outside is warmer than inside, turn off the heating and send a message

This automation might be debatable for some of you, but I came to the idea because one of you asked me how to set this up. At first, it sounded not logical to me, especially during the winter, but in the fall and spring, it might happen that the temperature outside gets warmer than the temperature inside your house. Especially when your house is very well isolated. This automation checks the outside temperature and turns off the heating if the temperature outside is higher than the temperature inside. It also sends a message to your phone to suggest that you might want to open a window to warm up your house.

I guess this might save some energy costs, but maybe not a lot. Anyway, all bits help, so that’s why I added it to the list.

This automation looks like this:

For automation 4, we have two triggers and we are going to use a little bit of YAML in these triggers because we want to compare two entities with each other. We want to compare the entity of the inside room temperature of the living room and the outside temperature. For the inside temperature, I have a temperature sensor and for the outside temperature, I am using OpenWeatherMap.

So, you need to have OpenWeatherMap as an integration installed in Home Assistant and then you can retrieve the outside temperature. Of course, it works better if you have an outside temperature sensor in your garden. I don’t have that so I use OpenWeatherMap. What we’re doing here is that we are checking but you see nothing really here. You only see that I have the entity Livinroom temperature. And that is because I’m using YAML for this.

For that, you go to the three dots over here and then you click on Edit in YAML and what you see here is that I have a platform numeric state that is my trigger type. I have the entity id sensor.livingroom_temperature, so that’s my indoor temperature. And I’m saying it must be below sensor.openweathermap_temperature. It must be below the outside temperature. And I gave it the trigger id Outside temperature is higher.

Now, we go to the next one. the next one is sort of the same. I think you can already guess that. So we go again to Edit in YAML and now we’re saying it’s the other way around. So we’re saying the platform is again numeric state. The entity id is sensor.livingroom_temperature, so my inside temperature and now I’m saying if it is above the outside temperature, so above OpenWeatherMap temperature. Then do something. And I gave it the trigger id Outside temperature is lower.

As you can see I created a trigger ID on the second trigger too, but that’s not really needed if you use an If-Then action because with an If-Then action you’re only checking on the If and otherwise, you do something else. So that’s the Else and for the Else, you do not need a Trigger ID.
Now we go to actions and in actions you see Perform an action If Then. So again If Then, If is When triggered by Outside temperature is higher. So, the trigger ID Outsidetemperature is higher. What should we do? We are going to turn off the heating and we’re going to send a message to my phone that the outside temperature is higher. So, if I open this, you see that I have a service climate turn off, and again the target is “all”. So again I typed in “all” here. Then we go to the next action. It’s a notification action and what you see is that the service is Notifications: Send a notification via mobile_app_iphone. That is my iPhone. You can choose notifications in the dropdown. Okay.
Then the message is: The temperature outside is higher than inside. You might want to open a window. And I gave the title Temperature Warning. So I will get a message on my phone that the outside temperature is higher and the climate is turned off. So, the heating is turned off. Else I’m going to turn on the heating again. So, again we have a service climate turn on and the target is again “all”. So type in “all” here.

Save Energy Tip 5: If Solar Panels generate more than x Watt, then turn on appliances

For this automation, you need solar panels that can communicate with Home Assistant. I use SolarEdge which I connected to Home Assistant through the cloud. Unfortunately, my inverter does not support local API, so I need to use the cloud service for this for now.

Next to Solar Panels, you need to have a Smart Washing Machine, Smart Dryer, or Smart Dishwasher for this automation. You can also use a smart plug for this automation depending on your use case. To keep things simple, this automation will switch a Smart Plug. If you are a lucky person and do have a Smart Washing Machine, Smart Dryer, or Smart Dishwasher, you can switch that specific device.

This automation specifically works well for appliances that use high current values, but you might want to use it for other appliances as well. You might even let Home Assistant send a message to your phone when a lot of power is generated by your Solar Panels. so that you know when to turn on an appliance yourself. This is semi-smart, but it still helps.

This automation can save you a lot of money if you cannot store the power yourself in a battery. Batteries for storing power generated by your Solar panels are still expensive at the moment, so I think a lot of you can benefit from this automation.

The automation looks like so:

Automation number 5 has only one trigger and that only checks the current power. So, what this does is that this is a numeric state trigger. The entity is my Solar Edge current Power. That shows the power that my solar panels are producing and I’m saying if it is above 1000 watts and you can of course change that to another value then do something. So, now we go to actions and I made this pretty simple.

The only thing that this action does is that it turns on a plug. So, in my case, that is a device SW-PLUG_5 and the action is Turn on SW-Plug_5. Of course, you can do it also the other way around, so create another trigger that checks if the power is below 1000 Watts and then turn off that plug. I think you can do that yourself now based on what I’ve shown here.

You can download all the code that I created in this video via this download link. Downloading is free, but you can also choose to make a donation just before you download the code. Please consider sponsoring me, if my work saves you time. This way you support me so that I can keep making these videos for you.

You can download the code here

I hope I gave you some ideas on how you can cut down on your energy costs and I am curious about your ideas and use cases. Let me know in the comments what clever automations you’ve created to save money on your energy bill!

I want to thank everyone who has supported me in making these videos and tutorials so far. I could never have done this without you. Thank you! You can support me through Patreon, Ko-Fi, or by joining my channel. If you also want to support me, look in the description of this video for the links. With that, you make it possible that I can continue to make these videos for you.

Oh, don’t forget to give this video a thumbs up, subscribe to my channel, and hit the notification bell.

I will see you soon!

Bye bye!


Back to all articles