|
Home IO Control
ESPHome add-on for IO-Homecontrol devices
|
Internal pairing-state model for hub‑owned discovery and key‑exchange flows. More...
Go to the source code of this file.
Classes | |
| struct | esphome::home_io_control::pairing::PairingContext |
| Context object that lives for the duration of a single pairing attempt. More... | |
Namespaces | |
| namespace | esphome |
| namespace | esphome::home_io_control |
| namespace | esphome::home_io_control::pairing |
Internal pairing-state model for hub‑owned discovery and key‑exchange flows.
This module implements the three‑phase pairing procedure that temporarily tracks a newly paired device in the controller's runtime registry and installs the system key on the device:
Phase 1 — Discovery (broadcast 0x28 → device responds 0x29): Controller broadcasts a discovery packet on the primary channel. A device in pairing mode (PROG button pressed) responds with its node ID and type/subtype. The controller validates the response and extracts device metadata.
Phase 2 — Authenticated Key Exchange (0x31 → 0x3C → 0x32 → 0x33): The controller sends CMD_KEY_INIT (0x31) to the device. The device challenges with CMD_CHALLENGE_REQ (0x3C). The controller proves knowledge of the system key with CMD_CHALLENGE_RESP (0x3D) and simultaneously sends the encrypted system key via CMD_KEY_TRANSFER (0x32). The device confirms with CMD_KEY_CONFIRM (0x33).
Phase 3 — Configuration (CMD_SET_CONFIG1): The controller sends a configuration frame (0x6F) to enable automatic status updates from the device. This phase completes even if the config frame fails; the device will still operate in polled mode.
All frames use the standard authenticated exchange flow defined in hub_exchange.h. The pairing state machine serializes these phases, logs the YAML metadata the user should add, and keeps the paired device in the current runtime registry until reboot.
Definition in file hub_pairing.h.