v0.14.13
This commit is contained in:
+19
-7
@@ -1,6 +1,6 @@
|
||||
# GREE Controller API reference
|
||||
|
||||
HTTP and WebSocket API for GREE Controller **0.14.12**.
|
||||
HTTP and WebSocket API for GREE Controller **0.14.13**.
|
||||
|
||||
[← Main documentation](../README.md)
|
||||
|
||||
@@ -197,7 +197,8 @@ Common statuses:
|
||||
| GET/PUT | `/api/settings/debug` | Debug overlay/GREE frame settings. |
|
||||
| GET | `/api/configuration/export` | Export full application configuration. |
|
||||
| POST | `/api/configuration/import` | Import/replace application configuration. |
|
||||
| POST | `/api/integrations/home-assistant/test` | Test HA server/API authentication without requiring an entity. |
|
||||
| POST | `/api/integrations/home-assistant/test` | Test the active HA authentication path and return one live sample entity reading when available. |
|
||||
| GET | `/api/integrations/home-assistant/entities` | Compact Home Assistant entity catalog used by searchable Shared Flow input suggestions. |
|
||||
| POST | `/api/integrations/home-assistant/entity` | Read raw HA entity state/attributes for shared Flow input diagnostics. |
|
||||
| POST | `/api/integrations/notifications/test` | Send a test notification. |
|
||||
|
||||
@@ -233,7 +234,7 @@ Response:
|
||||
{
|
||||
"status": "ok",
|
||||
"name": "gree-controller",
|
||||
"version": "0.14.12",
|
||||
"version": "0.14.13",
|
||||
"uptime_seconds": 1234,
|
||||
"control_ready": true,
|
||||
"time": "2026-08-30T06:54:00Z"
|
||||
@@ -296,7 +297,7 @@ Returns the initial Web UI snapshot:
|
||||
"control_plan": {"generated_at": "2026-09-04T08:00:00Z", "zones": [], "rules": []},
|
||||
"control_plan_revision": 42,
|
||||
"system": {
|
||||
"version": "0.14.12",
|
||||
"version": "0.14.13",
|
||||
"uptime_seconds": 1234,
|
||||
"auth_required": false,
|
||||
"control_ready": true,
|
||||
@@ -1198,7 +1199,7 @@ Times must use `HH:MM`; maximum fan speed is clamped to `1..5`.
|
||||
}
|
||||
```
|
||||
|
||||
`auth_mode` is runtime-only: `manual` for standalone installations and `supervisor` for the Home Assistant add-on. In Supervisor mode the returned URL is `http://supervisor/core/`, authentication uses runtime `SUPERVISOR_TOKEN`, and `PUT` does not replace the stored standalone URL/token fields. In manual mode, `PUT` replaces `token_configured` with optional `token`. Omitted/`null` token preserves the saved token; an explicit empty string clears it. `outdoor_entity_id` is the optional global Home Assistant outdoor-temperature sensor. Each zone can set `ha_outdoor_entity_id` to override that source only for the zone; a blank override uses the global sensor. Home Assistant room-temperature sensors remain configured per zone with `ha_entity_id` when `sensor_source` is `home_assistant` or `combined`. Sensor age is clamped to `30..86400` seconds. URLs, aliases, entity IDs and shared Flow inputs are normalized/validated before persistence. Global/per-zone outdoor sensors and per-zone room sensors are exposed through the normal alias and sensor-history/metric surfaces, and the Web UI offers them as suggestions in Flow Home Assistant entity fields. Shared inputs are value sources only; comparison operators and thresholds belong to Flow nodes. The Home Assistant connection test validates only the server/API token and requires no entity.
|
||||
`auth_mode` is `manual` for standalone installations and normally `supervisor` for the Home Assistant add-on. The add-on detects the Supervisor environment and runtime `SUPERVISOR_TOKEN`; while Supervisor auth is active, the effective URL is `http://supervisor/core/` and the Web UI hides manual URL/token/TLS fields. `supervisor_detected`, `supervisor_token_detected`, `manual_url`, `manual_token_configured` and `manual_auth_override` describe that state without exposing secrets. If the automatic HA test fails, the UI unlocks the persisted manual URL/token fallback; saving it sets `manual_auth_override=true`. Standalone URL/token behavior is unchanged. Omitted/`null` token preserves the saved manual token; an explicit empty string clears it. `outdoor_entity_id` is the optional global Home Assistant outdoor-temperature sensor. Each zone can set `ha_outdoor_entity_id` to override that source only for the zone; a blank override uses the global sensor. Home Assistant room-temperature sensors remain configured per zone with `ha_entity_id` when `sensor_source` is `home_assistant` or `combined`. Sensor age is clamped to `30..86400` seconds. URLs, aliases, entity IDs and shared Flow inputs are normalized/validated before persistence. Global/per-zone outdoor sensors and per-zone room sensors are exposed through the normal alias and sensor-history/metric surfaces. Shared Flow input HA sources can query `/api/integrations/home-assistant/entities` for live searchable entity suggestions. Shared inputs are value sources only; comparison operators and thresholds belong to Flow nodes.
|
||||
|
||||
### `/api/settings/debug`
|
||||
|
||||
@@ -1270,14 +1271,25 @@ Response:
|
||||
|
||||
### `POST /api/integrations/home-assistant/test`
|
||||
|
||||
No request body is required. The endpoint validates the configured Home Assistant URL and access token against the Home Assistant API root; it does not read or require any entity. Response:
|
||||
No request body is required. The endpoint validates the active Home Assistant authentication path and reads the state registry. In the packaged add-on it uses Supervisor auth unless manual fallback is active. A successful response includes one readable entity sample when available, which the Web UI shows in the success toast:
|
||||
|
||||
```json
|
||||
{
|
||||
"ok": true
|
||||
"ok": true,
|
||||
"auth_mode": "supervisor",
|
||||
"sample": {
|
||||
"entity_id": "sensor.living_room_temperature",
|
||||
"name": "Living room temperature",
|
||||
"state": "22.4",
|
||||
"unit": "°C"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### `GET /api/integrations/home-assistant/entities`
|
||||
|
||||
Returns a compact entity catalog for authenticated Web UI suggestions. Each row contains `entity_id`, friendly `name`, current `state`, `unit` and `device_class`. When HA is not configured it returns `configured: false` with an empty list.
|
||||
|
||||
### `POST /api/integrations/home-assistant/entity`
|
||||
|
||||
Reads the current raw Home Assistant entity document used by the shared-Flow-input diagnostics UI.
|
||||
|
||||
+163
-7
@@ -2,9 +2,9 @@
|
||||
"openapi": "3.1.0",
|
||||
"info": {
|
||||
"title": "GREE Controller API",
|
||||
"version": "0.14.12",
|
||||
"version": "0.14.13",
|
||||
"summary": "Local HTTP/WebSocket API for GREE HVAC control",
|
||||
"description": "Self-hosted API used by the GREE Controller Web UI and Home Assistant integration.\n\n### Authentication\nAdministrator endpoints accept `Authorization: Bearer <APP_TOKEN>` or `x-api-token: <APP_TOKEN>` when configured. Restricted Home Assistant control endpoints also accept generated integration tokens.\n\n### Local and GREE Cloud\nDevices use one API model and one command surface. `connection_type=local` is dispatched only to the existing LAN/UDP provider; `connection_type=gree_cloud` is dispatched only to the GREE Cloud provider. No automatic transport fallback is performed.\n\n### GREE Cloud security\nCloud passwords, REST/MQTT tokens, Authorization values and device cipher keys are never returned in normal API responses or Cloud diagnostics. MQTT uses TLS with certificate and hostname validation.\n\n### Energy\nGREE Cloud `ElcAll` and selected Home Assistant cumulative energy sensors are normalized to kWh and converted to consumption deltas before aggregation. Raw cumulative values are retained only as meter samples/baselines.\n\n### 0.14.12\nThe Home Assistant add-on now uses the Supervisor Core API proxy and runtime SUPERVISOR_TOKEN automatically; standalone Home Assistant URL/token configuration is unchanged.\n\n### 0.14.11\nWeb UI icons now use a shared inline SVG set instead of font-dependent Unicode glyphs across navigation, dialogs, Flow, charts, controls and event categories for consistent cross-platform rendering.\n\n\n### 0.14.10\nNight mode and Home Assistant / Sensors standalone settings now use the full available page width, matching the other Web UI sections.\n\n### 0.14.9\nPower controls use an embedded SVG icon instead of a font-dependent Unicode glyph. Home Assistant room-sensor stale/error events identify the affected entity and zone, and historical event rows can recover that context from metadata.\n\n### 0.14.8\nRemaining Home Assistant and notification diagnostic errors no longer use device-transport 502 responses. Missing/invalid integration configuration returns 400, configured external dependency failures return 424, and 502 is reserved for Local/LAN GREE device communication.\n\n### 0.14.7\nHome Assistant energy-sensor discovery now returns an empty optional result when HA is not configured, uses 424 for configured external-dependency failures, and custom select popovers use their rendered height when positioning above a field.\n\n\n### 0.14.6\nFixes dynamic custom-select duplication in History → Energy and hides Energy history controls when no energy source is configured.\n\n### 0.14.5\nWeb UI single-choice controls now use one consistent custom dropdown, language packs are loaded on demand, and the dashboard outdoor temperature opens a 24-hour history modal.\n\n### 0.14.4\nHome Assistant connection tests validate only the configured server/API token and require no entity. `outdoor_entity_id` is the global Home Assistant outdoor-temperature sensor; zones can override it with `ha_outdoor_entity_id`. Room-temperature Home Assistant sensors remain configured per zone with `ha_entity_id`. Global/per-zone outdoor sensors are integrated with aliases, metrics/history and Visual Flow entity suggestions.\n\n### 0.14.2\nAdds independent vertical/horizontal swing controls across manual device control, thermostat zones, legacy automations, Visual Flow and Home Assistant zone climates. Swing is treated as an auxiliary one-shot unit setting and does not replace thermostat ownership.\n\n### 0.14.1\nAdds split/multisplit installation groups with shared energy and outdoor-temperature sources, multi-target energy charts with period comparison, cleaner Cloud status/alerts and safe MQTT cleanup after the last Cloud device is removed.\n\n### 0.14.0\nAdds first-class GREE Cloud MQTT status/control, reconnect/resubscribe lifecycle, Cloud diagnostics, per-device capabilities, Cloud/HA energy sources and energy-history aggregation while preserving the LAN transport contract.",
|
||||
"description": "Self-hosted API used by the GREE Controller Web UI and Home Assistant integration.\n\n### Authentication\nAdministrator endpoints accept `Authorization: Bearer <APP_TOKEN>` or `x-api-token: <APP_TOKEN>` when configured. Restricted Home Assistant control endpoints also accept generated integration tokens.\n\n### Local and GREE Cloud\nDevices use one API model and one command surface. `connection_type=local` is dispatched only to the existing LAN/UDP provider; `connection_type=gree_cloud` is dispatched only to the GREE Cloud provider. No automatic transport fallback is performed.\n\n### GREE Cloud security\nCloud passwords, REST/MQTT tokens, Authorization values and device cipher keys are never returned in normal API responses or Cloud diagnostics. MQTT uses TLS with certificate and hostname validation.\n\n### Energy\nGREE Cloud `ElcAll` and selected Home Assistant cumulative energy sensors are normalized to kWh and converted to consumption deltas before aggregation. Raw cumulative values are retained only as meter samples/baselines.\n\n### 0.14.13\nHome Assistant add-on authentication is now hidden behind an automatic Supervisor status, manual URL/token fallback is unlocked only after a failed HA test, connection tests return a live sample entity reading, and Shared Flow input HA sources include searchable live entity suggestions.\n\n### 0.14.12\nThe Home Assistant add-on now uses the Supervisor Core API proxy and runtime SUPERVISOR_TOKEN automatically; standalone Home Assistant URL/token configuration is unchanged.\n\n### 0.14.11\nWeb UI icons now use a shared inline SVG set instead of font-dependent Unicode glyphs across navigation, dialogs, Flow, charts, controls and event categories for consistent cross-platform rendering.\n\n\n### 0.14.10\nNight mode and Home Assistant / Sensors standalone settings now use the full available page width, matching the other Web UI sections.\n\n### 0.14.9\nPower controls use an embedded SVG icon instead of a font-dependent Unicode glyph. Home Assistant room-sensor stale/error events identify the affected entity and zone, and historical event rows can recover that context from metadata.\n\n### 0.14.8\nRemaining Home Assistant and notification diagnostic errors no longer use device-transport 502 responses. Missing/invalid integration configuration returns 400, configured external dependency failures return 424, and 502 is reserved for Local/LAN GREE device communication.\n\n### 0.14.7\nHome Assistant energy-sensor discovery now returns an empty optional result when HA is not configured, uses 424 for configured external-dependency failures, and custom select popovers use their rendered height when positioning above a field.\n\n\n### 0.14.6\nFixes dynamic custom-select duplication in History → Energy and hides Energy history controls when no energy source is configured.\n\n### 0.14.5\nWeb UI single-choice controls now use one consistent custom dropdown, language packs are loaded on demand, and the dashboard outdoor temperature opens a 24-hour history modal.\n\n### 0.14.4\nHome Assistant connection tests validate only the configured server/API token and require no entity. `outdoor_entity_id` is the global Home Assistant outdoor-temperature sensor; zones can override it with `ha_outdoor_entity_id`. Room-temperature Home Assistant sensors remain configured per zone with `ha_entity_id`. Global/per-zone outdoor sensors are integrated with aliases, metrics/history and Visual Flow entity suggestions.\n\n### 0.14.2\nAdds independent vertical/horizontal swing controls across manual device control, thermostat zones, legacy automations, Visual Flow and Home Assistant zone climates. Swing is treated as an auxiliary one-shot unit setting and does not replace thermostat ownership.\n\n### 0.14.1\nAdds split/multisplit installation groups with shared energy and outdoor-temperature sources, multi-target energy charts with period comparison, cleaner Cloud status/alerts and safe MQTT cleanup after the last Cloud device is removed.\n\n### 0.14.0\nAdds first-class GREE Cloud MQTT status/control, reconnect/resubscribe lifecycle, Cloud diagnostics, per-device capabilities, Cloud/HA energy sources and energy-history aggregation while preserving the LAN transport contract.",
|
||||
"license": {
|
||||
"name": "MIT"
|
||||
}
|
||||
@@ -3095,7 +3095,7 @@
|
||||
"Diagnostics"
|
||||
],
|
||||
"summary": "Test Home Assistant connection",
|
||||
"description": "Validates the configured Home Assistant URL and access token against the Home Assistant API root. No entity is required or read.",
|
||||
"description": "Validates the active Home Assistant authentication path and state registry. In the add-on this uses Supervisor auth unless manual fallback is active. A successful response includes one readable entity sample when available.",
|
||||
"operationId": "testHomeAssistant",
|
||||
"security": [
|
||||
{
|
||||
@@ -3115,15 +3115,58 @@
|
||||
"properties": {
|
||||
"ok": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"auth_mode": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"manual",
|
||||
"supervisor"
|
||||
]
|
||||
},
|
||||
"sample": {
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"properties": {
|
||||
"entity_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"state": {
|
||||
"type": "string"
|
||||
},
|
||||
"unit": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"entity_id",
|
||||
"name",
|
||||
"state",
|
||||
"unit"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"ok"
|
||||
"ok",
|
||||
"auth_mode",
|
||||
"sample"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"example": {
|
||||
"ok": true
|
||||
"ok": true,
|
||||
"auth_mode": "supervisor",
|
||||
"sample": {
|
||||
"entity_id": "sensor.living_room_temperature",
|
||||
"name": "Living room temperature",
|
||||
"state": "22.4",
|
||||
"unit": "°C"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5465,6 +5508,89 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/integrations/home-assistant/entities": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"Diagnostics"
|
||||
],
|
||||
"summary": "List Home Assistant entities for UI suggestions",
|
||||
"description": "Returns a compact, authenticated Home Assistant state-registry view used by searchable entity pickers in Shared Flow input configuration.",
|
||||
"operationId": "listHomeAssistantEntities",
|
||||
"security": [
|
||||
{
|
||||
"BearerToken": []
|
||||
},
|
||||
{
|
||||
"ApiTokenHeader": []
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Entity suggestion catalog",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"configured": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"entities": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"entity_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"state": {
|
||||
"type": "string"
|
||||
},
|
||||
"unit": {
|
||||
"type": "string"
|
||||
},
|
||||
"device_class": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"entity_id",
|
||||
"name",
|
||||
"state",
|
||||
"unit",
|
||||
"device_class"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"configured",
|
||||
"entities"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"$ref": "#/components/responses/BadRequest"
|
||||
},
|
||||
"401": {
|
||||
"$ref": "#/components/responses/Unauthorized"
|
||||
},
|
||||
"424": {
|
||||
"$ref": "#/components/responses/FailedDependency"
|
||||
},
|
||||
"500": {
|
||||
"$ref": "#/components/responses/InternalError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
@@ -5520,7 +5646,7 @@
|
||||
},
|
||||
"version": {
|
||||
"type": "string",
|
||||
"example": "0.14.12"
|
||||
"example": "0.14.13"
|
||||
},
|
||||
"uptime_seconds": {
|
||||
"type": "integer",
|
||||
@@ -8520,6 +8646,10 @@
|
||||
"url": {
|
||||
"type": "string"
|
||||
},
|
||||
"manual_url": {
|
||||
"type": "string",
|
||||
"description": "Persisted manual Home Assistant URL used only when manual fallback is active in the add-on; equals url in standalone mode."
|
||||
},
|
||||
"auth_mode": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
@@ -8556,6 +8686,22 @@
|
||||
},
|
||||
"token_configured": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"manual_token_configured": {
|
||||
"type": "boolean",
|
||||
"description": "Whether a persisted manual Home Assistant token is available for fallback."
|
||||
},
|
||||
"supervisor_detected": {
|
||||
"type": "boolean",
|
||||
"description": "True when the packaged Home Assistant add-on environment was detected."
|
||||
},
|
||||
"supervisor_token_detected": {
|
||||
"type": "boolean",
|
||||
"description": "True when the add-on environment exposes a non-empty SUPERVISOR_TOKEN."
|
||||
},
|
||||
"manual_auth_override": {
|
||||
"type": "boolean",
|
||||
"description": "True when the add-on is explicitly using the persisted manual URL/token fallback."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -8567,7 +8713,12 @@
|
||||
"sensor_aliases",
|
||||
"flow_inputs",
|
||||
"outdoor_assist_enabled",
|
||||
"token_configured"
|
||||
"token_configured",
|
||||
"manual_url",
|
||||
"manual_token_configured",
|
||||
"supervisor_detected",
|
||||
"supervisor_token_detected",
|
||||
"manual_auth_override"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
@@ -8609,6 +8760,11 @@
|
||||
"null"
|
||||
],
|
||||
"description": "Omit/null to preserve the stored token; empty string clears it."
|
||||
},
|
||||
"manual_auth_override": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "In the Home Assistant add-on only, switch from automatic Supervisor auth to the persisted manual URL/token fallback. Ignored for standalone behavior."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
||||
Reference in New Issue
Block a user