Tado Home/Away Control In Home Assistant: A DIY Guide

by Alex Johnson 54 views

Hey there, fellow smart home enthusiasts! Are you looking to integrate your Tado smart thermostat system with Home Assistant to gain more control over your home's heating and cooling? You've come to the right place! This guide walks you through the process of adding Tado home and away control to your Home Assistant setup, even if you're not an IT whiz.

Understanding the Challenge: Tado Local Control and Home Assistant

Many users, like yourself, appreciate the convenience and energy-saving benefits of Tado's smart thermostat system. The ability to control your heating remotely and set schedules for home and away modes is a game-changer. However, integrating this functionality seamlessly with Home Assistant can be a bit tricky. The main challenge lies in replicating the behavior of Tado's cloud-based home/away control using local control methods.

The original poster expressed a common concern: they were able to control their Tado devices locally through Home Assistant, but the preset_mode: home automation, which previously set the entire home to either home or away mode, wasn't functioning as expected. Specifically, setting the system to 'away' just turned the TRVs (Thermostatic Radiator Valves) off, rather than activating the away schedule. This is problematic for those who, for example, need to keep a room warmer for pets while they're away.

This article addresses this issue head-on, providing a step-by-step guide to replicating Tado's home/away functionality within Home Assistant using local control.

Prerequisites: Setting up Tado Local Control

Before we dive into the solution, let's ensure you have the foundation in place. This guide assumes you've already successfully set up local Tado control within your Home Assistant. If you haven't, here's a quick rundown of the steps involved:

  1. Install the Tado integration: Use HACS (Home Assistant Community Store) or manual installation to add the Tado integration to your Home Assistant instance.
  2. Configure the integration: Provide the necessary credentials (if required for your chosen method) and configure the integration to recognize your Tado devices.
  3. Verify device discovery: Ensure that Home Assistant can discover and control your Tado devices, such as thermostats and TRVs.

With local control established, we can move on to the core of the problem: implementing home/away mode functionality.

Step-by-Step Guide: Replicating Tado Home/Away Control in Home Assistant

Here's how you can achieve Tado home/away control in Home Assistant using shell commands and REST sensors:

1. Define REST Sensors for Zone Temperatures

First, you'll need to create REST sensors to monitor the temperature in each of your Tado zones. This involves defining sensors that fetch temperature data from your local Tado system. Here’s an example configuration:

sensor:
  - platform: rest
    resource: http://XXXXX.XXXXX.XXXXX.XXXXX:4407/zones/1
    name: Tado Living Room Temperature
    value_template: "{{ value_json.zone.state.cur_temp_c | default('unavailable') }}"
    unit_of_measurement: "°C"
    device_class: temperature
    scan_interval: 30

  - platform: rest
    resource: http://XXXXX.XXXXX.XXXXX.XXXXX:4407/zones/1
    name: Tado Living Room Humidity
    value_template: "{{ value_json.zone.state.hum_perc | default('unavailable') }}"
    unit_of_measurement: "%"
    device_class: humidity
    scan_interval: 30

  - platform: rest
    resource: http://XXXXX.XXXXX.XXXXX.XXXXX:4407/zones/1
    name: Tado Living Room Setpoint
    value_template: "{{ value_json.zone.state.target_temp_c | default('unavailable') }}"
    unit_of_measurement: "°C"
    scan_interval: 30

  # ... (Zones 2–7 remain identical, only the IP replaced)

Key Takeaways:

  • Replace XXXXX.XXXXX.XXXXX.XXXXX with the actual IP address of your Tado system.
  • The value_template extracts the current temperature (cur_temp_c), humidity (hum_perc), and target temperature (target_temp_c) from the JSON response.
  • Adjust the scan_interval to your preferred update frequency (30 seconds is a good starting point).
  • Duplicate and modify this configuration for each zone in your Tado setup, adjusting the zone number in the resource URL.

2. Configure Shell Commands for Tado Control

Next, we'll set up shell commands to interact with your Tado system. These commands will allow us to set temperatures, turn heating on/off, and implement home/away modes. Add the following to your configuration.yaml file:

shell_command:
  tado_set_temperature: >-
    curl -s -X POST "http://XXXXX.XXXXX.XXXXX.XXXXX:4407/zones/{{ zone_id }}/set?temperature={{ temperature }}&termination=manual"
  
  tado_heating_on: >-
    curl -s -X POST "http://XXXXX.XXXXX.XXXXX.XXXXX:4407/zones/{{ zone_id }}/set?temperature={{ temperature }}&heating_enabled=true"
  
  tado_heating_off: >-
    curl -s -X POST "http://XXXXX.XXXXX.XXXXX.XXXXX:4407/zones/{{ zone_id }}/set?temperature={{ temperature }}&heating_enabled=false"
  
  tado_away_mode: >-
    curl -s -X POST "http://XXXXX.XXXXX.XXXXX.XXXXX:4407/zones/1/set?heating_enabled=false" &&
    curl -s -X POST "http://XXXXX.XXXXX.XXXXX.XXXXX:4407/zones/2/set?heating_enabled=false" &&
    curl -s -X POST "http://XXXXX.XXXXX.XXXXX.XXXXX:4407/zones/3/set?heating_enabled=false" &&
    curl -s -X POST "http://XXXXX.XXXXX.XXXXX.XXXXX:4407/zones/4/set?heating_enabled=false" &&
    curl -s -X POST "http://XXXXX.XXXXX.XXXXX.XXXXX:4407/zones/5/set?heating_enabled=false" &&
    curl -s -X POST "http://XXXXX.XXXXX.XXXXX.XXXXX:4407/zones/6/set?heating_enabled=false" &&
    curl -s -X POST "http://XXXXX.XXXXX.XXXXX.XXXXX:4407/zones/7/set?heating_enabled=false"
  
  tado_home_mode: >-
    curl -s -X POST "http://XXXXX.XXXXX.XXXXX.XXXXX:4407/zones/1/set?temperature=-1" &&
    curl -s -X POST "http://XXXXX.XXXXX.XXXXX.XXXXX:4407/zones/2/set?temperature=-1" &&
    curl -s -X POST "http://XXXXX.XXXXX.XXXXX.XXXXX:4407/zones/3/set?temperature=-1" &&
    curl -s -X POST "http://XXXXX.XXXXX.XXXXX.XXXXX:4407/zones/4/set?temperature=-1" &&
    curl -s -X POST "http://XXXXX.XXXXX.XXXXX.XXXXX:4407/zones/5/set?temperature=-1" &&
    curl -s -X POST "http://XXXXX.XXXXX.XXXXX.XXXXX:4407/zones/6/set?temperature=-1" &&
    curl -s -X POST "http://XXXXX.XXXXX.XXXXX.XXXXX:4407/zones/7/set?temperature=-1"

Key Considerations:

  • Again, replace XXXXX.XXXXX.XXXXX.XXXXX with your Tado system's IP address.
  • The tado_set_temperature command sets the temperature for a specific zone (zone_id) using the curl command. The termination=manual parameter ensures the temperature is set manually and doesn't revert to the schedule immediately.
  • The tado_heating_on and tado_heating_off commands control the heating state of a zone.
  • The tado_away_mode command turns off heating in all zones (1 through 7 in this example). Adjust the zone numbers to match your setup.
  • The tado_home_mode command sets the temperature to -1 for all zones, which typically tells Tado to revert to its scheduled settings. This effectively activates the home schedule.

3. Automate Temperature Changes

Now, let’s create automations to handle temperature changes in each zone. This ensures that when you adjust the target temperature in Home Assistant, the changes are reflected in your Tado system:

# ==================== TEMPERATURE CHANGE AUTOMATIONS ====================

# Living Room - Zone 1
- id: tado_living_room_temp_change
  alias: Tado Living Room Temperature Change
  trigger:
    - platform: state
      entity_id: climate.tado_living_room
      attribute: temperature
  action:
    - service: shell_command.tado_set_temperature
      data:
        zone_id: 1
        temperature: "{{ state_attr('climate.tado_living_room', 'temperature') }}"

# Second Bedroom - Zone 2
- id: tado_second_bedroom_temp_change
  alias: Tado Second Bedroom Temperature Change
  trigger:
    - platform: state
      entity_id: climate.tado_second_bedroom
      attribute: temperature
  action:
    - service: shell_command.tado_set_temperature
      data:
        zone_id: 2
        temperature: "{{ state_attr('climate.tado_second_bedroom', 'temperature') }}"

# Office - Zone 3
- id: tado_office_temp_change
  alias: Tado Office Temperature Change
  trigger:
    - platform: state
      entity_id: climate.tado_office
      attribute: temperature
  action:
    - service: shell_command.tado_set_temperature
      data:
        zone_id: 3
        temperature: "{{ state_attr('climate.tado_office', 'temperature') }}"

# Bedroom - Zone 4
- id: tado_bedroom_temp_change
  alias: Tado Bedroom Temperature Change
  trigger:
    - platform: state
      entity_id: climate.tado_bedroom
      attribute: temperature
  action:
    - service: shell_command.tado_set_temperature
      data:
        zone_id: 4
        temperature: "{{ state_attr('climate.tado_bedroom', 'temperature') }}"

# Hallway - Zone 5
- id: tado_hallway_temp_change
  alias: Tado Hallway Temperature Change
  trigger:
    - platform: state
      entity_id: climate.tado_hallway
      attribute: temperature
  action:
    - service: shell_command.tado_set_temperature
      data:
        zone_id: 5
        temperature: "{{ state_attr('climate.tado_hallway', 'temperature') }}"

# Kitchen - Zone 6
- id: tado_kitchen_temp_change
  alias: Tado Kitchen Temperature Change
  trigger:
    - platform: state
      entity_id: climate.tado_kitchen
      attribute: temperature
  action:
    - service: shell_command.tado_set_temperature
      data:
        zone_id: 6
        temperature: "{{ state_attr('climate.tado_kitchen', 'temperature') }}"

# Bathroom - Zone 7
- id: tado_bathroom_temp_change
  alias: Tado Bathroom Temperature Change
  trigger:
    - platform: state
      entity_id: climate.tado_bathroom
      attribute: temperature
  action:
    - service: shell_command.tado_set_temperature
      data:
        zone_id: 7
        temperature: "{{ state_attr('climate.tado_bathroom', 'temperature') }}"

Key Points:

  • Each automation is triggered when the temperature attribute of a climate entity changes (e.g., climate.tado_living_room).
  • The action uses the shell_command.tado_set_temperature service to send the new temperature to the corresponding Tado zone.
  • The data section specifies the zone_id and the new temperature using a template that extracts the temperature from the climate entity's state attributes.
  • Repeat this pattern for each of your Tado zones.

4. Automate Heating On/Off Control

Similarly, we'll create automations to control the heating state (on/off) for each zone. These automations will respond to changes in input booleans, allowing you to create switches in your Home Assistant interface to control heating in each zone:

# ==================== HEATING ON/OFF AUTOMATIONS ====================

# Living Room - Zone 1 ON/OFF
- id: tado_living_room_heating_on
  alias: Tado Living Room Heating ON
  trigger:
    - platform: state
      entity_id: input_boolean.tado_living_room_heating
      to: 'on'
  action:
    - service: shell_command.tado_heating_on
      data:
        zone_id: 1
        temperature: "{{ state_attr('climate.tado_living_room', 'temperature') | default(20) }}"

- id: tado_living_room_heating_off
  alias: Tado Living Room Heating OFF
  trigger:
    - platform: state
      entity_id: input_boolean.tado_living_room_heating
      to: 'off'
  action:
    - service: shell_command.tado_heating_off
      data:
        zone_id: 1
        temperature: "{{ state_attr('climate.tado_living_room', 'temperature') | default(20) }}"

# Second Bedroom - Zone 2 ON/OFF
- id: tado_second_bedroom_heating_on
  alias: Tado Second Bedroom Heating ON
  trigger:
    - platform: state
      entity_id: input_boolean.tado_second_bedroom_heating
      to: 'on'
  action:
    - service: shell_command.tado_heating_on
      data:
        zone_id: 2
        temperature: "{{ state_attr('climate.tado_second_bedroom', 'temperature') | default(20) }}"

- id: tado_second_bedroom_heating_off
  alias: Tado Second Bedroom Heating OFF
  trigger:
    - platform: state
      entity_id: input_boolean.tado_second_bedroom_heating
      to: 'off'
  action:
    - service: shell_command.tado_heating_off
      data:
        zone_id: 2
        temperature: "{{ state_attr('climate.tado_second_bedroom', 'temperature') | default(20) }}"

# Office - Zone 3 ON/OFF
- id: tado_office_heating_on
  alias: Tado Office Heating ON
  trigger:
    - platform: state
      entity_id: input_boolean.tado_office_heating
      to: 'on'
  action:
    - service: shell_command.tado_heating_on
      data:
        zone_id: 3
        temperature: "{{ state_attr('climate.tado_office', 'temperature') | default(20) }}"

- id: tado_office_heating_off
  alias: Tado Office Heating OFF
  trigger:
    - platform: state
      entity_id: input_boolean.tado_office_heating
      to: 'off'
  action:
    - service: shell_command.tado_heating_off
      data:
        zone_id: 3
        temperature: "{{ state_attr('climate.tado_office', 'temperature') | default(20) }}"

# Bedroom - Zone 4 ON/OFF
- id: tado_bedroom_heating_on
  alias: Tado Bedroom Heating ON
  trigger:
    - platform: state
      entity_id: input_boolean.tado_bedroom_heating
      to: 'on'
  action:
    - service: shell_command.tado_heating_on
      data:
        zone_id: 4
        temperature: "{{ state_attr('climate.tado_bedroom', 'temperature') | default(20) }}"

- id: tado_bedroom_heating_off
  alias: Tado Bedroom Heating OFF
  trigger:
    - platform: state
      entity_id: input_boolean.tado_bedroom_heating
      to: 'off'
  action:
    - service: shell_command.tado_heating_off
      data:
        zone_id: 4
        temperature: "{{ state_attr('climate.tado_bedroom', 'temperature') | default(20) }}"

# Hallway - Zone 5 ON/OFF
- id: tado_hallway_heating_on
  alias: Tado Hallway Heating ON
  trigger:
    - platform: state
      entity_id: input_boolean.tado_hallway_heating
      to: 'on'
  action:
    - service: shell_command.tado_heating_on
      data:
        zone_id: 5
        temperature: "{{ state_attr('climate.tado_hallway', 'temperature') | default(20) }}"

- id: tado_hallway_heating_off
  alias: Tado Hallway Heating OFF
  trigger:
    - platform: state
      entity_id: input_boolean.tado_hallway_heating
      to: 'off'
  action:
    - service: shell_command.tado_heating_off
      data:
        zone_id: 5
        temperature: "{{ state_attr('climate.tado_hallway', 'temperature') | default(20) }}"

# Kitchen - Zone 6 ON/OFF
- id: tado_kitchen_heating_on
  alias: Tado Kitchen Heating ON
  trigger:
    - platform: state
      entity_id: input_boolean.tado_kitchen_heating
      to: 'on'
  action:
    - service: shell_command.tado_heating_on
      data:
        zone_id: 6
        temperature: "{{ state_attr('climate.tado_kitchen', 'temperature') | default(20) }}"

- id: tado_kitchen_heating_off
  alias: Tado Kitchen Heating OFF
  trigger:
    - platform: state
      entity_id: input_boolean.tado_kitchen_heating
      to: 'off'
  action:
    - service: shell_command.tado_heating_off
      data:
        zone_id: 6
        temperature: "{{ state_attr('climate.tado_kitchen', 'temperature') | default(20) }}"

# Bathroom - Zone 7 ON/OFF
- id: tado_bathroom_heating_on
  alias: Tado Bathroom Heating ON
  trigger:
    - platform: state
      entity_id: input_boolean.tado_bathroom_heating
      to: 'on'
  action:
    - service: shell_command.tado_heating_on
      data:
        zone_id: 7
        temperature: "{{ state_attr('climate.tado_bathroom', 'temperature') | default(20) }}"

- id: tado_bathroom_heating_off
  alias: Tado Bathroom Heating OFF
  trigger:
    - platform: state
      entity_id: input_boolean.tado_bathroom_heating
      to: 'off'
  action:
    - service: shell_command.tado_heating_off
      data:
        zone_id: 7
        temperature: "{{ state_attr('climate.tado_bathroom', 'temperature') | default(20) }}"

Key Details:

  • For each zone, we create two automations: one to turn the heating on and another to turn it off.
  • The trigger is based on the state of an input_boolean entity (e.g., input_boolean.tado_living_room_heating). You'll need to create these input booleans in your configuration.yaml file.
  • The action calls either shell_command.tado_heating_on or shell_command.tado_heating_off, passing the zone ID and a default temperature (20°C in this example).
  • The default temperature is used if the climate entity's temperature attribute is unavailable.

5. Create Input Booleans for Zone Control

To control the heating state of each zone, you'll need to define input_boolean entities. Add the following to your configuration.yaml file:

input_boolean:
  tado_living_room_heating:
    name: Living Room Heating
    initial: off
  tado_second_bedroom_heating:
    name: Second Bedroom Heating
    initial: off
  tado_office_heating:
    name: Office Heating
    initial: off
  tado_bedroom_heating:
    name: Bedroom Heating
    initial: off
  tado_hallway_heating:
    name: Hallway Heating
    initial: off
  tado_kitchen_heating:
    name: Kitchen Heating
    initial: off
  tado_bathroom_heating:
    name: Bathroom Heating
    initial: off

Explanation:

  • Each input_boolean represents a heating zone and has a name and an initial state (off in this case).
  • These input booleans will appear as switches in your Home Assistant interface, allowing you to toggle the heating on or off in each zone.

6. Implement Home and Away Mode Automations

Now comes the crucial part: creating automations to switch between home and away modes. This involves using the tado_home_mode and tado_away_mode shell commands we defined earlier.

# Home/Away Mode Automations
- id: tado_set_away_mode
  alias: Set Tado Away Mode
  trigger:
    - platform: state
      entity_id: input_boolean.home_away_mode
      to: 'on'
  action:
    - service: shell_command.tado_away_mode

- id: tado_set_home_mode
  alias: Set Tado Home Mode
  trigger:
    - platform: state
      entity_id: input_boolean.home_away_mode
      to: 'off'
  action:
    - service: shell_command.tado_home_mode

Key Concepts:

  • We define two automations: one for away mode and one for home mode.
  • Both automations are triggered by the state of an input_boolean entity called input_boolean.home_away_mode. You'll need to create this input boolean as well.
  • When input_boolean.home_away_mode is turned on (away mode), the tado_away_mode shell command is executed, turning off heating in all zones.
  • When input_boolean.home_away_mode is turned off (home mode), the tado_home_mode shell command is executed, setting the temperature to -1 in all zones, which tells Tado to revert to its scheduled settings.

7. Create the Home/Away Mode Input Boolean

Don't forget to create the input_boolean.home_away_mode entity:

input_boolean:
  home_away_mode:
    name: Home/Away Mode
    initial: off

This input boolean will act as a master switch for your home/away mode.

Final Thoughts and Further Customization

By following these steps, you can effectively replicate Tado's home/away control within Home Assistant using local control. This setup allows you to maintain your Tado schedules while integrating your heating system seamlessly into your smart home ecosystem.

Remember to adapt the configurations to match your specific setup, including zone IDs, IP addresses, and preferred temperature settings. You can further customize this setup by adding triggers based on presence detection, time of day, or other smart home events.

Conclusion

Integrating your Tado smart thermostat with Home Assistant opens up a world of possibilities for home automation. While setting up local control and replicating features like home/away mode requires some technical know-how, the result is a more flexible and personalized smart home experience. By using REST sensors, shell commands, and automations, you can take full control of your heating system and create a truly intelligent home environment.

For more information and troubleshooting tips, check out the official Home Assistant community forums and the Tado integration documentation. You can find helpful resources and discussions on websites like Home Assistant Community.