Tado Home/Away Control In Home Assistant: A DIY Guide
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:
- Install the Tado integration: Use HACS (Home Assistant Community Store) or manual installation to add the Tado integration to your Home Assistant instance.
- Configure the integration: Provide the necessary credentials (if required for your chosen method) and configure the integration to recognize your Tado devices.
- 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.XXXXXwith the actual IP address of your Tado system. - The
value_templateextracts the current temperature (cur_temp_c), humidity (hum_perc), and target temperature (target_temp_c) from the JSON response. - Adjust the
scan_intervalto 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
resourceURL.
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.XXXXXwith your Tado system's IP address. - The
tado_set_temperaturecommand sets the temperature for a specific zone (zone_id) using thecurlcommand. Thetermination=manualparameter ensures the temperature is set manually and doesn't revert to the schedule immediately. - The
tado_heating_onandtado_heating_offcommands control the heating state of a zone. - The
tado_away_modecommand turns off heating in all zones (1 through 7 in this example). Adjust the zone numbers to match your setup. - The
tado_home_modecommand 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
temperatureattribute of a climate entity changes (e.g.,climate.tado_living_room). - The
actionuses theshell_command.tado_set_temperatureservice to send the new temperature to the corresponding Tado zone. - The
datasection specifies thezone_idand the newtemperatureusing 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
triggeris based on the state of aninput_booleanentity (e.g.,input_boolean.tado_living_room_heating). You'll need to create these input booleans in yourconfiguration.yamlfile. - The
actioncalls eithershell_command.tado_heating_onorshell_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_booleanrepresents 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_booleanentity calledinput_boolean.home_away_mode. You'll need to create this input boolean as well. - When
input_boolean.home_away_modeis turnedon(away mode), thetado_away_modeshell command is executed, turning off heating in all zones. - When
input_boolean.home_away_modeis turnedoff(home mode), thetado_home_modeshell 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.