You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add HTTPS/SSL support and enhance connection handling
- Implemented HTTPS/SSL support for OpenClaw gateways in `lan_https` mode.
- Added configuration options for SSL certificate verification.
- Improved auto-discovery for `lan_https` access mode.
- Updated documentation in README and changelog for new features and fixes.
- Fixed connection errors related to SSL certificate verification.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,18 @@
2
2
3
3
All notable changes to the OpenClaw Home Assistant Integration will be documented in this file.
4
4
5
+
## [0.1.52] - 2026-02-23
6
+
7
+
### Added
8
+
- Added HTTPS / SSL support for connecting to OpenClaw gateways running in `lan_https` mode or behind TLS reverse proxies.
9
+
- Auto-discovery now detects `access_mode: lan_https` and connects to the internal gateway port automatically (no certificate setup needed for local addons).
10
+
- Added `Verify SSL certificate` option in manual config for self-signed certificate environments.
11
+
- Added `ssl_error` config flow error with actionable guidance.
12
+
- Added comprehensive remote connection documentation to README with setup table for all access modes.
13
+
14
+
### Fixed
15
+
- Fixed "400 Bad Request — plain HTTP request was sent to HTTPS port" when the addon uses `lan_https` access mode.
Copy file name to clipboardExpand all lines: README.md
+67-3Lines changed: 67 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,10 +38,68 @@ OpenClaw is a Home Assistant custom integration that connects your HA instance t
38
38
## Requirements
39
39
40
40
- Home Assistant Core `2025.1.0+` (declared minimum)
41
-
- Supervisor is optional (used for auto-discovery)
42
-
- OpenClaw Assistant addon installed and running
41
+
- An **OpenClaw gateway** with `enable_openai_api` enabled — either:
42
+
- The [OpenClaw Assistant addon](https://github.com/techartdev/OpenClawHomeAssistant) running on the same HA instance (auto-discovery supported), **or**
43
+
- Any standalone [OpenClaw](https://github.com/openclaw/openclaw) installation reachable over the network (manual config)
44
+
- Supervisor is optional (used only for addon auto-discovery)
43
45
44
-
The integration can auto-detect the addon when Supervisor is available. You can always configure host/port/token manually.
46
+
> **No addon required.** If you have OpenClaw running anywhere — on a separate server, a VPS, a Docker container, or even another machine on your LAN — this integration can connect to it via the manual configuration flow.
47
+
48
+
---
49
+
50
+
## Connection modes
51
+
52
+
The integration supports connecting to OpenClaw in several ways:
53
+
54
+
### Local addon (auto-discovery)
55
+
56
+
If the OpenClaw Assistant addon is installed on the **same** Home Assistant instance, the integration auto-discovers it:
57
+
- Reads token from the shared filesystem
58
+
- Detects `access_mode` and chooses the correct port automatically
59
+
- No manual config needed — just click **Submit** on the confirm step
60
+
61
+
> **`lan_https` mode**: The integration automatically connects to the internal gateway port (plain HTTP on loopback), bypassing the HTTPS proxy entirely. No certificate setup required.
62
+
63
+
### Remote or standalone OpenClaw instance (manual config)
64
+
65
+
You can connect to **any reachable OpenClaw gateway** — whether it's the HA addon on another machine, a standalone `openclaw` install on a VPS, or a Docker container on your LAN. The integration doesn't care how OpenClaw is installed; it only needs the `/v1/chat/completions` endpoint.
66
+
67
+
**Prerequisites on the OpenClaw instance:**
68
+
69
+
1. The OpenAI-compatible API must be **enabled**:
70
+
-**Addon users**: Set `enable_openai_api: true` in addon settings
71
+
-**Standalone users**: Set `gateway.http.endpoints.chatCompletions.enabled: true` in `openclaw.json`, or run:
72
+
```sh
73
+
openclaw config set gateway.http.endpoints.chatCompletions.enabled true
74
+
```
75
+
2. The gateway must be **network-reachable** from your HA instance (not bound to loopback only)
76
+
3. You need the **gateway auth token**:
77
+
```sh
78
+
openclaw config get gateway.auth.token
79
+
```
80
+
81
+
**Setup steps:**
82
+
83
+
1. Go to **Settings → Devices & Services → Add Integration → OpenClaw**
84
+
2. Auto-discovery will fail (no local addon) — you'll see the **Manual Configuration** form
85
+
3. Fill in:
86
+
- **Gateway Host**: IP or hostname of the remote machine (e.g. `192.168.1.50`)
87
+
- **Gateway Port**: The gateway port (default `18789`)
88
+
- **Gateway Token**: Auth token from the remote `openclaw.json`
89
+
- **Use SSL (HTTPS)**: Check if connecting to an HTTPS endpoint
| Behind reverse proxy (NPM/Caddy with Let's Encrypt) | Domain or IP | 443 | ✅ | ✅ | Trusted cert from a real CA |
99
+
| Plain HTTP addon on LAN | Remote IP | 18789 | ❌ | — | Addon `bind_mode` must be `lan`|
100
+
| Tailscale | Tailscale IP | 18789 | ❌ | — | Encrypted tunnel; plain HTTP is fine |
101
+
102
+
>**Security note**: Avoid exposing plain HTTP gateways to the public internet. Use `lan_https`, a reverse proxy with TLS, or Tailscale for remote access.
45
103
46
104
---
47
105
@@ -307,6 +365,12 @@ action:
307
365
- Verify `openclaw_message_received` is being fired in Developer Tools → Events
308
366
- Confirm session IDs match between card and service calls
309
367
368
+
### "400 Bad Request — plain HTTP request was sent to HTTPS port"
369
+
370
+
- The gateway is running in `lan_https` mode (built-in HTTPS proxy)
371
+
- **Local addon**: Remove and re-add the integration — auto-discovery now detects `lan_https` and uses the correct internal port automatically
372
+
- **Remote connection**: Enable **Use SSL (HTTPS)** and disable **Verify SSL certificate** in the manual config
Copy file name to clipboardExpand all lines: custom_components/openclaw/strings.json
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -17,14 +17,14 @@
17
17
"gateway_host": "Gateway Host",
18
18
"gateway_port": "Gateway Port",
19
19
"gateway_token": "Gateway Token",
20
-
"use_ssl": "Use SSL (HTTPS)"
20
+
"use_ssl": "Use SSL (HTTPS)",
21
+
"verify_ssl": "Verify SSL certificate"
21
22
}
22
23
}
23
24
},
24
25
"error": {
25
26
"cannot_connect": "Cannot connect to the OpenClaw gateway. Ensure the addon is running.",
26
-
"invalid_auth": "Invalid gateway token. Check your OpenClaw configuration.",
27
-
"openai_api_disabled": "The gateway returned an unexpected response — the OpenAI-compatible API is likely disabled. In the OpenClaw addon settings enable 'enable_openai_api', restart the addon, and try again.",
27
+
"invalid_auth": "Invalid gateway token. Check your OpenClaw configuration.", "ssl_error": "SSL certificate verification failed. If using self-signed certificates (e.g. lan_https mode), uncheck 'Verify SSL certificate' or use automatic discovery.", "openai_api_disabled": "The gateway returned an unexpected response — the OpenAI-compatible API is likely disabled. In the OpenClaw addon settings enable 'enable_openai_api', restart the addon, and try again.",
Copy file name to clipboardExpand all lines: custom_components/openclaw/translations/en.json
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -17,13 +17,15 @@
17
17
"gateway_host": "Gateway Host",
18
18
"gateway_port": "Gateway Port",
19
19
"gateway_token": "Gateway Token",
20
-
"use_ssl": "Use SSL (HTTPS)"
20
+
"use_ssl": "Use SSL (HTTPS)",
21
+
"verify_ssl": "Verify SSL certificate"
21
22
}
22
23
}
23
24
},
24
25
"error": {
25
26
"cannot_connect": "Cannot connect to the OpenClaw gateway. Ensure the addon is running.",
26
27
"invalid_auth": "Invalid gateway token. Check your OpenClaw configuration.",
28
+
"ssl_error": "SSL certificate verification failed. If using self-signed certificates (e.g. lan_https mode), uncheck 'Verify SSL certificate' or use automatic discovery.",
27
29
"openai_api_disabled": "The gateway returned an unexpected response — the OpenAI-compatible API is likely disabled. In the OpenClaw addon settings enable 'enable_openai_api', restart the addon, and try again.",
0 commit comments