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
6 changes: 4 additions & 2 deletions DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ tado-local/
**Purpose**: Command-line interface and application bootstrap

**Key Responsibilities**:
- Parse command-line arguments (`--bridge-ip`, `--pin`, `--port`, `--state`)
- Parse command-line arguments (`--bridge-ip`, `--pin`, `--port`, `--state`, `--accessory-ip`, `--accessory-pin`)
- Initialize database and create API instance
- Manage bridge pairing (load existing or create new)
- Optionally pair standalone HomeKit accessories (e.g. Smart AC Control V3+)
- Start OAuth2 device flow for cloud authentication (browser-based)
- Configure and start uvicorn web server
- Handle graceful shutdown and cleanup
Expand All @@ -126,7 +127,8 @@ main()
│ ├── TadoLocalAPI.__init__(db_path)
│ ├── create_app() + register_routes()
│ ├── TadoBridge.pair_or_load()
│ ├── TadoLocalAPI.initialize(pairing)
│ ├── TadoBridge.pair_or_load_accessory() # for each --accessory-ip
│ ├── TadoLocalAPI.initialize(pairing, extra_pairings=...)
│ └── uvicorn.Server.serve()
└── cleanup()
```
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,22 @@ Options:
--pin XXX-XX-XXX HomeKit PIN for initial pairing
--port PORT API server port (default: 4407)
--clear-pairings Clear all existing pairings before starting
--accessory-ip IP IP of a standalone HomeKit accessory (repeatable)
--accessory-pin PIN HomeKit PIN for a standalone accessory (repeatable)
```

#### Standalone Accessories

Some Tado products (e.g. Smart AC Control V3+) are standalone HomeKit accessories
that pair independently from the bridge. You can include them alongside the bridge:

```bash
tado-local --bridge-ip 192.168.1.100 --accessory-ip 192.168.1.101 --accessory-pin 987-65-432
```

Multiple accessories can be added by repeating the flags. Their zones will appear
in the same API alongside the bridge zones.

### Optional Authentication

You can optionally secure the REST API with one or more Bearer tokens. This is useful for:
Expand Down Expand Up @@ -620,6 +634,8 @@ Options:
--pin XXX-XX-XXX HomeKit PIN for initial pairing
--port PORT API server port (default: 4407)
--clear-pairings Clear all existing pairings before starting
--accessory-ip IP IP of a standalone HomeKit accessory (repeatable)
--accessory-pin PIN HomeKit PIN for a standalone accessory (repeatable)
```

---
Expand Down
31 changes: 29 additions & 2 deletions tado_local/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,21 @@ def handle_signal(signum, frame):
args.bridge_ip, args.pin, db_path, args.clear_pairings
)

# Initialize the API with the pairing
await tado_api.initialize(bridge_pairing)
# Pair / load standalone accessories (e.g. Smart AC Control V3+)
accessory_pairings = []
for idx, acc_ip in enumerate(args.accessory_ip):
acc_pin = args.accessory_pin[idx] if idx < len(args.accessory_pin) else None
try:
pairing, _ = await TadoBridge.pair_or_load_accessory(
acc_ip, acc_pin, db_path
)
accessory_pairings.append(pairing)
logger.info(f"Standalone accessory {acc_ip}: ready")
except Exception as e:
logger.error(f"Standalone accessory {acc_ip}: failed ({e})")

# Initialize the API with the bridge pairing + any standalone accessories
await tado_api.initialize(bridge_pairing, extra_pairings=accessory_pairings or None)

# Register mDNS service asynchronously (Avahi via DBus preferred, fall back to zeroconf)
if not args.no_mdns:
Expand Down Expand Up @@ -385,6 +398,12 @@ def main():
# Debug mode with verbose logging
tado-local --bridge-ip 192.168.1.100 --verbose

# Pair a standalone Smart AC Control alongside the bridge
tado-local --bridge-ip 192.168.1.100 --accessory-ip 192.168.1.101 --accessory-pin 987-65-432

# Reconnect to a previously paired standalone accessory (no PIN needed)
tado-local --bridge-ip 192.168.1.100 --accessory-ip 192.168.1.101

API Endpoints:
GET / - API information
GET /status - System status
Expand Down Expand Up @@ -437,6 +456,14 @@ def main():
"--pid-file",
help="Write process ID to specified file (useful for daemon mode)"
)
parser.add_argument(
"--accessory-ip", action="append", default=[],
help="IP of a standalone HomeKit accessory such as Tado Smart AC Control V3+ (repeatable)"
)
parser.add_argument(
"--accessory-pin", action="append", default=[],
help="HomeKit PIN for a standalone accessory (repeatable, order must match --accessory-ip)"
)
# Parse CLI arguments
args = parser.parse_args()

Expand Down
2 changes: 1 addition & 1 deletion tado_local/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
# - 1.1.1: Bug fix update
# - 2.0.0: Major breaking change

__version__ = "1.1.0"
__version__ = "1.1.1"
Loading
Loading