mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-22 22:18:38 +01:00
fix2
This commit is contained in:
45
docs-standalone/docs/connection-modes.md
Normal file
45
docs-standalone/docs/connection-modes.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# Connection Modes
|
||||
|
||||
The rewrite supports two panel input/output modes.
|
||||
|
||||
## 1) MQTT mode (default)
|
||||
|
||||
Enabled when:
|
||||
|
||||
- `mqtt_server` is configured
|
||||
- `use_ha_api` is not present
|
||||
|
||||
Behavior:
|
||||
|
||||
- Subscribes to every panel `panelRecvTopic`
|
||||
- Expects JSON payload containing `CustomRecv`
|
||||
- Publishes commands to `panelSendTopic`
|
||||
|
||||
Example receive payload:
|
||||
|
||||
```json
|
||||
{"CustomRecv":"event,startup,54,eu"}
|
||||
```
|
||||
|
||||
## 2) Home Assistant API mode (`use_ha_api`)
|
||||
|
||||
Enabled when key `use_ha_api` exists in config.
|
||||
|
||||
Behavior:
|
||||
|
||||
- Subscribes to HA event `esphome.nspanel.data`
|
||||
- Routes events by `device_id` (must match configured `panelRecvTopic`)
|
||||
- Sends panel commands by calling Home Assistant service:
|
||||
- `<panelSendTopic>_nspanelui_api_call`
|
||||
|
||||
Service payload shape:
|
||||
|
||||
```yaml
|
||||
data: "...panel command..."
|
||||
command: 2
|
||||
```
|
||||
|
||||
## Common to both modes
|
||||
|
||||
- Home Assistant websocket connection is used for entity state cache and service calls.
|
||||
- UI actions (button presses, sliders, mode selects) are translated to Home Assistant service calls.
|
||||
Reference in New Issue
Block a user