Estimated reading time: 8 minutes

Welcome to a new project that will revolutionize your morning shower experience! Today I'm going to show you how you can use Home Assistant to automatically heat your bathroom before your shower. No more shivering before your morning shower - instead, you'll step into a pleasantly preheated bathroom. Let's get started!

What you need

Before we start, make sure you have the following components to hand:

  • Home Assistant: A home automation platform that runs on a Raspberry Pi or similar device.
  • Smart thermostat: A thermostat that is compatible with Home Assistant.
  • Temperature sensor (optional): A sensor that measures the current temperature in the bathroom.
  • Motion sensor (optional): A sensor that recognizes when you enter the bathroom.

For detailed instructions and an explanation of all configuration options, I recommend the YouTube video linked below. In this video, every single setting is explained in detail so that you receive comprehensive instructions for the exact setup. You can find any code from the video in this article so that you can use it directly without having to type it in.

What is Home Assistant?

Home Assistant is an open source platform for home automation that aims to connect and centrally control all devices in the home. It is designed to provide a unified user interface and simple, flexible control for a variety of smart home devices from different ecosystems. Here are some points in favor of Home Assistant:

  1. CompatibilityHome Assistant supports thousands of devices and services from various manufacturers, including lighting, air conditioning, heating, cameras, weather sensors, voice assistants and more.
  2. Local controlUnlike many commercial smart home platforms that rely on cloud services, Home Assistant runs locally on your network. This means increased privacy and reliability, as your smart home devices work even without an active internet connection.
  3. Automation and scenesOne of the main features of Home Assistant is the ability to create complex automations and scenarios. For example, you can have lights switch on automatically when it gets dark or turn on the heating when the temperature falls below a certain level.
  4. Simple user interfaceHome Assistant offers a user-friendly interface that makes it easy to monitor and control devices. This interface is fully customizable.
  5. Integration with voice assistantsHome Assistant can be integrated with voice assistants such as Amazon Alexa or Google Assistant to enable voice-controlled control of your smart home devices.
  6. Open source and community-drivenSince Home Assistant is open source, it is supported by an active community that is constantly developing new integrations and improving existing ones.
  7. Data protection and securityAs a locally running platform, Home Assistant has the advantage that the data remains within its own network. This protects privacy and increases security compared to cloud-based solutions.

In summary, Home Assistant is a powerful and flexible solution for those who want to design their own smart home and control their devices centrally, regardless of the manufacturer or ecosystem.

Furnishings

Step 1: Installing and configuring Home Assistant

First, install Home Assistant on your device, such as a Raspberry Pi. Follow the official instructions on the Home Assistant website to install the software. Once the installation is complete, set up Home Assistant and connect it to your network.

Step 2: Setting up the devices in Home Assistant

Once you have installed Home Assistant, integrate your smart devices. Go to the settings and add your smart thermostat, and optionally the temperature sensor and motion sensor. If you are using an electric radiator, use a smart socket and add it.

Step 3: Create zones in Home Assistant

For your Home Assistant automation to work, it's important to create zones for places like your gym. This guide will help you set up zones in Home Assistant to make your automations even more precise.

Step 1: Accessing Home Assistant

Open your Home Assistant Dashboard and log in.

Step 2: Navigate to the zones
  1. Go to the settings: Click on the menu (three dashes at the top left) and select "Settings".
  2. Select "Zones" from the menu under "Areas, Labels & Zones".
Step 3: Create new zone
  1. Click on "Add zone" (the plus sign at the bottom right).
  2. Give the zone a name, for example "Fitness studio".
  3. Add the GPS coordinates of the gym. You can either use the map to set the location or enter the exact coordinates.
  4. Set the radius of the zone. This defines the area around the gym that is recognized as a zone. A radius of 100 to 300 meters is often useful.
  5. Choose a color and a symbol for the zone to make it easy to identify.
Step 4: Save zone

Click on "Save" to create the zone. Your new zone should now appear in the zone list.

Step 5: Add more zones

Repeat the above steps to create additional zones such as "Work", "School" or "Supermarket". These zones can also be used in your automations.

Use of the zones in automations

Once you have created your zones, you can use them in your automations. For example, you can set up an automation that switches on the light when you come home or activates the heating when you leave the gym and come home.

Step 4: Create outdoor temperature sensor

Step 1: Navigate to the helpers
  1. Go to the settings: Click on the menu (three dashes at the top left) and select "Settings".
  2. Select "Helpers" from the menu under "Devices & Services".
Step 2: Create the sensor
  1. Now click on "Create helper" at the bottom right.
  2. Now select "Template" from the menu and then "Create template for a sensor".
  3. The status template is then {{ state_attr('weather.duisburg', 'temperature') }}
    • Match the name of the weather entity to your system and region.
  4. Select "°C" as the unit of measurement.
  5. Select "Temperature" as the device class.
  6. Select "Measurement" as the status class.
  7. For example, you can assign the name "Outdoor temperature".

Step 5: Create automation

Now comes the exciting part: the automation. You will configure Home Assistant so that it automatically heats the bathroom as soon as you come home from the gym and it's cold enough outside.

alias: Heating the bathroom after a visit to the gym
description: ""
trigger:
  - platform: state
    entity_id: person.sascha
    to: home
condition:
  - condition: template
    value_template: >
      {{ state_attr('person.cptdaydreamer', 'previous_state') == 'gym'
      and
         (now() - as_timestamp(state_attr('person.sascha', 'last_changed'))) > timedelta(minutes=20) }}
    alias: Was Sascha at the gym for at least 20 minutes before he got home?
  - condition: numeric_state
    entity_id: sensor.outdoor_temperature
    below: 10
action:
  - service: climate.set_temperature
    data:
      temperature: 21
    target:
      device_id: 088daa9eeb846822d919ef54f24f1b66
  - service: climate.turn_on
    metadata: {}
    data: {}
    target:
      device_id: 088daa9eeb846822d919ef54f24f1b66
  - wait_template: "{{ states('binary_sensor.badezimmer_open_window') == 'on' }}"
    continue_on_timeout: true
    alias: Wait until open bathroom window is detected
  - service: climate.turn_off
    metadata: {}
    data: {}
    target:
      device_id: 088daa9eeb846822d919ef54f24f1b66
mode: single

Trigger: The automation starts when the entity person.sascha (that's you) the state home reaches home.

Conditions:

  1. The automation checks whether your previous status gym and whether you were there for at least 20 minutes before you came home. This is achieved by comparing the current time with the time when your status was last changed.
  2. It also checks whether the outside temperature is below 10 degrees Celsius. The bathroom is only heated when it is cold outside.

Actions:

  1. The automation sets the temperature of the thermostat to 21 degrees Celsius.
  2. It switches the heater (thermostat) on.
  3. It waits for the binary sensor binary_sensor.bathroom_open_window the condition on (open window) is reached. The automation continues even if the timeout is reached (wait until the window is open or timeout).
  4. Finally, it switches the heater off again to save energy.

Mode: The mode single means that the automation will not be restarted if it is already running.

Summary

This automation ensures that your bathroom is pleasantly warm after a visit to the gym, provided the outside temperature is low and you have been in the gym for at least 20 minutes. It switches the heating on, waits for an open window to be detected and then switches the heating off again to save energy. Ideally, this can be achieved by a fe

I use a Tado thermostat for this automation, which provides all the necessary sensors.

YouTube video implementation

Conclusion

With Home Assistant, you can heat your bathroom intelligently and comfortably. By following the steps in this article, you'll never have to step into a cold bathroom again. Enjoy the comfort and warmth that this smart solution offers you!

Have fun setting up and experimenting with your Home Assistant! If you have any questions or encounter any problems, don't hesitate to look for help in the Home Assistant forums.

The display of the products was implemented with the affiliate-toolkit plugin.

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

en_US