https://github.com/thingspanel/thingspanel-device-connector-homeassistant
ThingsPanel Home Assistant DeviceConnector
https://github.com/thingspanel/thingspanel-device-connector-homeassistant
Last synced: 20 days ago
JSON representation
ThingsPanel Home Assistant DeviceConnector
- Host: GitHub
- URL: https://github.com/thingspanel/thingspanel-device-connector-homeassistant
- Owner: ThingsPanel
- Created: 2026-05-26T08:05:09.000Z (28 days ago)
- Default Branch: main
- Last Pushed: 2026-05-26T22:05:57.000Z (27 days ago)
- Last Synced: 2026-05-27T00:07:47.470Z (27 days ago)
- Language: Go
- Size: 24.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Home Assistant DeviceConnector
ThingsPanel `DeviceConnector` for Home Assistant. This is the new connector runtime implementation. The local directory keeps the historical `homeassistant-service` name, but the standalone repository should be `thingspanel-device-connector-homeassistant`.
## Publish identity
- `connectorKey`: `homeassistant`
- Standalone repo: `github.com/thingspanel/thingspanel-device-connector-homeassistant`
- Suggested visibility: public
## Scope
- Discover Home Assistant entities through the HA REST API
- Control standard switch/light style entities through the internal MQTT command bridge
- Periodically publish state/telemetry back to ThingsPanel
- Keep Home Assistant and Xiaomi connectors separated: HA manages entities inside Home Assistant, while `xiaomi` talks to Xiaomi cloud/LAN directly
## Runtime configuration
Required environment variables:
- `CONNECTOR_SERVICE_IDENTIFIER=homeassistant`
- `CONNECTOR_INSTANCE_ID=`
- `THINGSPANEL_BACKEND_URL=http://127.0.0.1:4000`
- `HA_BASE_URL=http://127.0.0.1:8123`
- `HA_ACCESS_TOKEN=`
MQTT bridge and telemetry:
- `TP_MQTT_BROKER=tcp://127.0.0.1:1883`
- `HA_TP_DEVICE_ID=`
- `HA_MQTT_USERNAME=`
- `HA_MQTT_PASSWORD=`
- `HA_ENTITY_ID=`
- `HA_TELEMETRY_INTERVAL_SECONDS=30`
## Local run
```bash
cd examples/device-connectors/homeassistant-service
go run .
curl http://127.0.0.1:9001/health
curl "http://127.0.0.1:9001/api/v1/form/config?form_type=SVCR"
```
## Standard commands
Topic:
```text
plugin/homeassistant/devices/command//
```
Examples:
- `{"method":"switch","params":"on"}`
- `{"method":"switch","params":"off"}`
- `{"method":"brightness","params":35}`
- `{"method":"query","params":"state"}`
Local helper:
```bash
go run ./cmd/publish-command -service homeassistant -method query -params '"state"'
```
## Verification and deploy
```bash
go test ./...
```
Deploy helper in this monorepo:
```bash
cd encore-api
go run ./cmd/deploy-homeassistant-service
```