Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,10 @@ climate:
name: "Living Room Heating"
# Configure with REST commands
```
The ["tado-local"](https://github.com/array81/tado-local) Home Assistant custom component is build to work with TadoLocal.
The ["tado-local"](https://github.com/array81/tado-local) Home Assistant custom component is build to work with TadoLocal Server.

**Full documentation**: See [`home-assistant/README.md`](home-assistant/README.md) for installing TadoLocal Server as App and advanced configuration.

**Contributions welcome!** If you'd like to build a native Home Assistant integration or HACS addon, we'd be happy to review PRs.

### Other Platforms

Expand Down
7 changes: 6 additions & 1 deletion home-assistant/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ FROM $BUILD_FROM

RUN apk add git py3-pip
WORKDIR /usr/src/app
RUN git clone https://github.com/ampscm/TadoLocal.git
# Clone repo metadata, but only check out the todal-local and cfg files to save time and space
RUN git clone --depth 1 --filter=blob:none --sparse https://github.com/AmpScm/TadoLocal.git \
&& cd TadoLocal \
&& git sparse-checkout init --no-cone \
&& git sparse-checkout set tado_local requirements.txt setup.py pyenv.cfg pyproject.toml

WORKDIR /usr/src/app/TadoLocal
RUN python -m venv my-venv
RUN my-venv/bin/pip install -e .
Expand Down
184 changes: 176 additions & 8 deletions home-assistant/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,181 @@
To install this as a Home Assistant add-on, you need to do the following:

- SSH or SFTP into your HA filesystem.
- Under the /addons directory, create a directory named tado-local
- Copy alle the files from the home-assistant folder in this project under the 'tado-local' directory
# TadoLocal Server – Home Assistant App (Add-on)

Then follow the steps that are described on https://developers.home-assistant.io/docs/add-ons/tutorial under 'Installing and testing your add-on'.
![Home Assistant](https://img.shields.io/badge/Home%20Assistant-App-blue)
![Architecture](https://img.shields.io/badge/Architecture-amd64%20%7C%20armhf%20%7C%20armv7-orange)
![License](https://img.shields.io/github/license/AmpScm/TadoLocal)

Before starting, set the IP-address and pincode of the Tado Bridge. See the generic documentation of TadoLocal for more information.
This app runs the **TadoLocal Server** inside Home Assistant, allowing **local communication with Tado devices without relying on the cloud**.

When you start the addon for the first time, check the logs. The logs will display an URL that you need to authenticatie at Tado.
The app exposes a local API that can be used by the **TadoLocal Home Assistant custom integration**.

---
# Installation
## Quick Install

Install the add-on directly into Home Assistant:

[![Add repository to Home Assistant](https://my.home-assistant.io/badges/supervisor_add_addon_repository.svg)](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2FAmpScm%2FTadoLocal)

Steps:

1. Click the button above
2. Click **Open Link**
3. Click **+ Add**
4. Click **Close**
5. Search for **TadoLocal Server** and click on it
6. Click **Install**
7. Follow the [Configuration](#configuration) section **before starting**

---

## Manual Installation

If you prefer installing manually:

1. SSH or SFTP into your Home Assistant filesystem
2. Navigate to:

```
/addons
```

3. Create the directory:

```
/addons/tado-local-server
```

4. Copy **all files from the `home-assistant` folder** of this repository into that directory.

Ensure `run.sh` is saved in **Unix format (LF)** and not **Windows format (CRLF)**.

Example structure:

```
/addons/
└── tado-local-server/
├── config.yaml
├── Dockerfile
├── run.sh
├── README.md
├── icon.png
├── logo.png
└── translations/
├── en.yaml
└── nl.yaml
```

5. Restart Home Assistant or reload add-ons.

Then follow the Home Assistant developer documentation:

https://developers.home-assistant.io/docs/add-ons/tutorial

---

# Configuration
## Setup Tado Internet Bridge

Before starting the add-on, configure the following options:

| Option | Description |
|------|------|
| **Bridge IP** | IP address of your Tado Bridge |
| **Bridge PIN** | HomeKit PIN code of the Tado Bridge |
| **Keep database private** | Determines where the `tado-local.db` file is stored |

---

## Database Location

If **Keep database private = false**

The database will be copied to:

```
/config/.storage/tado-local.db
```

This makes the database accessible from Home Assistant via:

- Samba
- Terminal
- SSH

If **Keep database private = true**

The database stays inside the container:

```
/data/tado-local.db
```


## Accessories

Some devices require **separate pairing sessions**, for example:

- **Tado Smart AC Control V3+**

You can add these accessories in the configuration using the **Add** button and providing:

- Accessory IP address
- HomeKit PIN code


---
# Running TadoLocal Server
## First Startup

When starting the add-on for the first time:

1. Open the **Log** tab of the TadoLocal Server add-on
2. A URL will appear that you must open to authenticate with Tado.

Alternatively:

1. Click **Open Web UI** on the TadoLocal Server App page
2. The **TadoLocal Web GUI** will open
3. Click **Authenticate** in the Web GUI. (center top)

---

## After Authentication

After successful authentication:

- The logs will confirm authentication
- The **TadoLocal services will start**
- The **zones will appear** in the Web GUI

---

# Home Assistant Integration (Devices & Services)

After the add-on is running successfully, install the **TadoLocal custom integration**:

https://github.com/array81/tado-local

Follow the instructions in that repository.

When configuring the integration, use: `localhost` as the IP address and the configured port (default **4407**).

---

# Updating

The TadoServer Python code is downloaded directly from GitHub.

When a new version becomes available, simply click **Rebuild** on the TadoLocal Server add-on page.

---

# Troubleshooting

If something does not work:

1. Check the **add-on logs**
2. Verify the **Bridge IP and PIN**
3. Ensure Home Assistant can reach the Tado Bridge

When you have successfully authenticated at Tado, check the logs again. It will confirm the authentication and that the TadoLocal services will start running.
17 changes: 15 additions & 2 deletions home-assistant/config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
name: "TadoLocal Server"
description: "TadoLocal Server, based on AmpScm/TadoLocal"
version: "0.1.0"
version: "1.1.1"
slug: "tado-local-server"
url: "https://github.com/AmpScm/TadoLocal"
init: false
webui: "http://[HOST]:[PORT:4407]"
arch:
- amd64
- armhf
- armv7
ports:
4407/tcp: 4407
map:
- type: homeassistant_config
read_only: false
path: /homeassistant_config
options:
bridge_ip: "1.2.3.4"
bridge_pin: "123-45-678"
keep_db_private: true
log_level: info
accessories: []
schema:
bridge_ip: str
bridge_pin: str
bridge_pin: str
keep_db_private: bool
log_level: list(debug|info)
accessories:
- ip: str
pin: str
Binary file added home-assistant/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added home-assistant/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 45 additions & 3 deletions home-assistant/run.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,55 @@
#!/usr/bin/with-contenv bashio
echo "Tado-local server starting.."
CONFIG_PSTH=/data/options.json
ARGS=""

# Get the variables from HA
BRIDGE_IP="$(bashio::config 'bridge_ip')"
echo "Bridge IP is $BRIDGE_IP"
BRIDGE_PIN="$(bashio::config 'bridge_pin')"
echo "Bridge pin is $BRIDGE_PIN"
echo "Bridge:"
echo " IP is $BRIDGE_IP"
echo " pin is $BRIDGE_PIN"
ARGS="${ARGS} --bridge-ip ${BRIDGE_IP} --pin ${BRIDGE_PIN}"

# Check if log_level is set to debug or trace
LOG_LEVEL="$(bashio::config 'log_level')"
if [ "$LOG_LEVEL" = "debug" ]; then
echo "INFO: Enabling verbose logging for log_level=${LOG_LEVEL}"
ARGS="${ARGS} --verbose"
fi

# Determine where to store the database based on the keep_db_private option
LOCAL_DB="$(bashio::config 'keep_db_private')"
if [ "$LOCAL_DB" = true ]; then
echo "INFO: keep_db_private is true, using /data/tado-local.db (not accessible outside the container)"
ARGS="${ARGS} --state /data/tado-local.db"
else
echo "INFO: keep_db_private is false, using /homeassistant_config/.storage/tado-local.db (accessible outside the container)"
ARGS="${ARGS} --state /homeassistant_config/.storage/tado-local.db"
if [ -f "/data/tado-local.db" ]; then
# Forward compatibility: if the old database location exists, move it to the new location and use it.
echo "*** WARNING: DB found at /data/tado-local.db. move to new location and use it. ***"
echo "--- mv /data/tado-local.db /homeassistant_config/.storage/tado-local.db"
mv /data/tado-local.db /homeassistant_config/.storage/tado-local.db
fi
fi

# Get the number of accessories configured in HA
ACCESSORY_COUNT="$(bashio::config 'accessories|length' || echo 0)"
echo "Accessories found: ${ACCESSORY_COUNT}"

# Loop through the accessories and build the arguments for tado-local server
for ((i=0; i<ACCESSORY_COUNT; i++)); do
ACCESSORY_IP="$(bashio::config "accessories[${i}].ip")"
ACCESSORY_PIN="$(bashio::config "accessories[${i}].pin")"

echo "Accessory ${i}:"
echo " IP: ${ACCESSORY_IP}"
echo " PIN: ${ACCESSORY_PIN}"
ARGS="${ARGS} --accessory-ip ${ACCESSORY_IP} --accessory-pin ${ACCESSORY_PIN}"
done

# Start the server
/usr/src/app/TadoLocal/my-venv/bin/tado-local --bridge-ip "${BRIDGE_IP}" --pin "${BRIDGE_PIN}" --state /data/tado-local.db
echo "Exec: ../tado-local $ARGS"
/usr/src/app/TadoLocal/my-venv/bin/tado-local $ARGS

27 changes: 27 additions & 0 deletions home-assistant/translations/en.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "TadoLocal Server"
description: "TadoLocal Server, based op AmpScm/TadoLocal"

configuration:
bridge_ip:
name: "Bridge IP"
description: "IP address of the Tado bridge."

bridge_pin:
name: "Bridge PIN"
description: "HomeKit PIN code of the Tado bridge. (Format: xxx-xx-xxx)"

log_level:
name: "Log level"
description: "Set add-on logging verbosity. Use debug for more detailed startup and runtime logs."

keep_db_private:
name: "Keep database private"
description: "Store the TadoLocal database in the add-on data folder (/data) instead of placing it in the Home Assistant configuration folder (/config/.storage).
By placing it in /config/.storage, it becomes accessible or editable via Home Assistant."

accessories:
name: "Accessories"
description: "List of Tado accessories to pair. (Like Smart AC Control)"

network:
4407/tcp: "Port to use for the TadoLocal web server (default: 4407)"
27 changes: 27 additions & 0 deletions home-assistant/translations/nl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "TadoLocal Server"
description: "TadoLocal Server, gebaseerd op AmpScm/TadoLocal"

configuration:
bridge_ip:
name: "Bridge IP"
description: "IP-adres van de Tado Internet bridge."

bridge_pin:
name: "Bridge PIN"
description: "HomeKit Pincode van de Tado Internet bridge. (formaat: xxx-xx-xxx)"

log_level:
name: "Logniveau"
description: "Stel de logdetails van de add-on in. Gebruik debug voor uitgebreidere opstart- en runtime-logs."

keep_db_private:
name: "Database privé houden"
description: "Bewaar de TadoLocal database in de datafolder (/data) van de add-on in plaats van deze in de Home Assistant-configuratiemap (/config/.storage) te plaatsen.
Door de /config/.storage te plaatsen is deze te benaderen of bewerken via HA."

accessories:
name: "Accessoires"
description: "Lijst met Tado-accessoires die gepaired moeten worden. (Zoals Smart AC Control)"

network:
4407/tcp: "Poort die gebruikt wordt voor de TadoLocal webserver (standaard: 4407)"
5 changes: 5 additions & 0 deletions repository.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# https://developers.home-assistant.io/docs/add-ons/repository#repository-configuration
name: TadoLocal Server Apps repository
url: 'https://github.com/AmpScm/TadoLocal'
maintainer: AmpScm <AmpScm.TadoLocal@email.com>

Loading