|
Home IO Control
ESPHome add-on for IO-Homecontrol devices
|
Fixed-size per-attempt telemetry recorder for the pairing flow. More...
#include <pairing_telemetry.h>
Public Member Functions | |
| void | begin () |
| Reset all state and start a new attempt. Call once at discover_and_pair() entry. | |
| void | record_tx (uint8_t cmd) |
| Record that we transmitted a frame. | |
| void | record_rx (const IoFrame &frame, int16_t rssi) |
| Record that we received and accepted a frame. | |
| void | record_rx_reject (const IoFrame &frame, int16_t rssi) |
| Record that we received a frame that parsed but was rejected by a classifier. | |
| void | record_lbt_defer (int16_t rssi) |
| Record a listen-before-talk defer (channel busy). | |
| void | record_hop () |
| Record a frequency hop while waiting. | |
| void | set_phase (pairing::PairingState phase) |
| Record a pairing state-machine phase transition. | |
| void | set_outcome (PairingOutcome outcome) |
| Record the final outcome of the attempt. | |
| void | set_paired_device (const uint8_t node_id[NODE_ID_SIZE], DeviceType type) |
| Record the successfully paired device, if any. | |
| void | increment_discovery_attempt () |
| Increment the discovery attempt counter (one call per discovery command retry). | |
| void | set_advice_codes (const std::string &codes) |
| Record the advisor's short advice codes for the ;advice= result-sensor field. | |
| const PairingTelemetryEvent * | events () const |
| uint8_t | event_count () const |
| uint16_t | heard_count () const |
| bool | truncated () const |
| pairing::PairingState | phase () const |
| PairingOutcome | outcome () const |
| uint8_t | discovery_attempts () const |
| uint8_t | lbt_retries () const |
| bool | has_paired_device () const |
| const uint8_t * | paired_node_id () const |
| DeviceType | paired_device_type () const |
| uint32_t | duration_ms () const |
| void | log_summary () const |
| Emit a multi-line human-readable summary via ESP_LOGI. Call once, at the end of the attempt. | |
| std::string | result_sensor_string () const |
| Render the frozen v1; machine-readable result string. | |
Fixed-size per-attempt telemetry recorder for the pairing flow.
Owned by the hub, reset at the start of every discover_and_pair() call. Not thread-safe — pairing is a single blocking call on the main loop, matching the rest of this component.
Definition at line 71 of file pairing_telemetry.h.
| void esphome::home_io_control::PairingTelemetry::begin | ( | ) |
Reset all state and start a new attempt. Call once at discover_and_pair() entry.
Definition at line 75 of file pairing_telemetry.cpp.
|
inlinenodiscard |
Definition at line 130 of file pairing_telemetry.h.
|
nodiscard |
Definition at line 165 of file pairing_telemetry.cpp.
|
inlinenodiscard |
Definition at line 116 of file pairing_telemetry.h.
|
inlinenodiscard |
Definition at line 114 of file pairing_telemetry.h.
|
inlinenodiscard |
Definition at line 134 of file pairing_telemetry.h.
|
inlinenodiscard |
Definition at line 118 of file pairing_telemetry.h.
| void esphome::home_io_control::PairingTelemetry::increment_discovery_attempt | ( | ) |
Increment the discovery attempt counter (one call per discovery command retry).
Definition at line 160 of file pairing_telemetry.cpp.
|
inlinenodiscard |
Definition at line 132 of file pairing_telemetry.h.
| void esphome::home_io_control::PairingTelemetry::log_summary | ( | ) | const |
Emit a multi-line human-readable summary via ESP_LOGI. Call once, at the end of the attempt.
Definition at line 167 of file pairing_telemetry.cpp.
|
inlinenodiscard |
Definition at line 128 of file pairing_telemetry.h.
|
inlinenodiscard |
Definition at line 138 of file pairing_telemetry.h.
|
inlinenodiscard |
Definition at line 136 of file pairing_telemetry.h.
|
inlinenodiscard |
Definition at line 126 of file pairing_telemetry.h.
| void esphome::home_io_control::PairingTelemetry::record_hop | ( | ) |
Record a frequency hop while waiting.
The exchange engine does not expose which channel index a hop landed on, so this only marks that a hop happened, not where to.
Definition at line 141 of file pairing_telemetry.cpp.
| void esphome::home_io_control::PairingTelemetry::record_lbt_defer | ( | int16_t | rssi | ) |
Record a listen-before-talk defer (channel busy).
| rssi | RSSI in dBm that triggered the defer. |
Definition at line 135 of file pairing_telemetry.cpp.
| void esphome::home_io_control::PairingTelemetry::record_rx | ( | const IoFrame & | frame, |
| int16_t | rssi ) |
Record that we received and accepted a frame.
| frame | Parsed frame (cmd, src, dst, and the 1W protocol bit are recorded — dst and the 1W bit feed PairingAdvisor's ONE_WAY_PAIRING_TRAFFIC and FOREIGN_CONTROLLER_PAIRING detection, see pairing_advisor.h). |
| rssi | RSSI in dBm. |
Definition at line 125 of file pairing_telemetry.cpp.
| void esphome::home_io_control::PairingTelemetry::record_rx_reject | ( | const IoFrame & | frame, |
| int16_t | rssi ) |
Record that we received a frame that parsed but was rejected by a classifier.
| frame | Parsed frame (cmd, src, dst, and the 1W protocol bit are recorded — dst and the 1W bit feed PairingAdvisor's ONE_WAY_PAIRING_TRAFFIC and FOREIGN_CONTROLLER_PAIRING detection, see pairing_advisor.h). |
| rssi | RSSI in dBm. |
Definition at line 130 of file pairing_telemetry.cpp.
| void esphome::home_io_control::PairingTelemetry::record_tx | ( | uint8_t | cmd | ) |
Record that we transmitted a frame.
| cmd | Frame command byte. |
Definition at line 121 of file pairing_telemetry.cpp.
|
nodiscard |
Render the frozen v1; machine-readable result string.
Format (never change without bumping the version tag — the Phase 2 rig's read-back contract parses this exactly; the space after each ; is intentional — Home Assistant's UI only line-wraps this sensor's long value at whitespace, so a fields-only-separated-by-; string renders as one unbroken, unreadable line): v1; outcome=<...>; phase=<...>; node=<XXXXXX|->; type=<...|->; attempts=<n>; lbt=<n>; dur_ms=<n>; heard=<n>; advice=<comma-separated codes|none>
Definition at line 193 of file pairing_telemetry.cpp.
|
inline |
Record the advisor's short advice codes for the ;advice= result-sensor field.
| codes | Comma-separated short codes (e.g. "1w_traffic,channel_busy"), or empty if none. |
Definition at line 111 of file pairing_telemetry.h.
| void esphome::home_io_control::PairingTelemetry::set_outcome | ( | PairingOutcome | outcome | ) |
Record the final outcome of the attempt.
| outcome | Final disposition. |
Definition at line 148 of file pairing_telemetry.cpp.
| void esphome::home_io_control::PairingTelemetry::set_paired_device | ( | const uint8_t | node_id[NODE_ID_SIZE], |
| DeviceType | type ) |
Record the successfully paired device, if any.
| node_id | Paired device's node ID. |
| type | Paired device's type. |
Definition at line 154 of file pairing_telemetry.cpp.
| void esphome::home_io_control::PairingTelemetry::set_phase | ( | pairing::PairingState | phase | ) |
Record a pairing state-machine phase transition.
| phase | New phase. |
Definition at line 143 of file pairing_telemetry.cpp.
|
inlinenodiscard |
Definition at line 124 of file pairing_telemetry.h.