|
Home IO Control
ESPHome add-on for IO-Homecontrol devices
|
Functions | |
| void | clear_status_poll_tracking (IoDevice &dev) |
| Clear all bounded follow-up polling state for a device. | |
| bool | status_poll_tracking_active (const IoDevice &dev, uint32_t now) |
| Check whether a device remains inside its bounded follow-up polling window. | |
| bool | is_binary_entity_position (uint8_t position) |
| Is the given position value an on/off binary encoding? | |
| bool | known_device_matches_entity_class (const IoDevice &dev, DeviceCapabilityClass expected) |
| Does the device's type match the expected HA entity class? | |
| bool | known_device_supports_status_requests (const IoDevice &dev) |
| Does the device support status requests? | |
| bool | known_device_accepts_execute_position (const IoDevice &dev, uint8_t position) |
| Can this device accept an execute (position) command? | |
| bool | known_device_accepts_execute_tilt (const IoDevice &dev) |
| Can this device accept a tilt command? | |
| uint32_t | status_poll_retry_delay_ms (uint8_t consecutive_failures, bool auth_like_failure) |
| Compute the next background status-poll retry delay after a failed exchange. | |
| void | log_rejected_operation (const std::string &device_id, const IoDevice &dev, const char *operation, const char *expected) |
| Log a rejected operation with capability mismatch details. | |
| void | log_component_capture (const RadioDriver *radio, const char *stage, const uint8_t *buf, uint8_t len, const IoFrame *frame=nullptr) |
| Log a frame at the "io_capture" tag with structured fields. | |
| void | log_frame_issue (IOHomeControlComponent *component, const char *direction, const char *reason, const IoFrame &frame, uint8_t len) |
| Log a frame‑level issue (unregistered endpoints, unsupported commands). | |
| void | normalize_stopped_state (IoDevice &dev) |
| Normalize stopped state: some devices briefly report stopped before target/current converge. | |
| void | log_status_update (const std::string &id, const IoDevice &dev, const char *suffix="") |
| Log a concise status‑update line used by inbound handlers. | |
Variables | |
| constexpr const char * | TAG = "home_io_control" |
| Shared log tag for hub-level messages. | |
| constexpr uint32_t | STATUS_RETRY_AFTER_FAIL_MS = 5000 |
| First retry after a silent status-poll failure. | |
| constexpr uint32_t | STATUS_RETRY_AFTER_FAIL_STEP2_MS |
| Second retry after a silent status-poll failure. | |
| constexpr uint32_t | STATUS_RETRY_AFTER_FAIL_STEP3_MS |
| Third retry after a silent status-poll failure. | |
| constexpr uint32_t | STATUS_RETRY_AFTER_FAIL_STEP4_MS |
| Fourth retry after a silent status-poll failure. | |
| constexpr uint32_t | STATUS_RETRY_AFTER_FAIL_MAX_MS |
| Steady-state backoff for repeated silent status-poll failures. | |
| constexpr uint32_t | STATUS_AUTH_RETRY_AFTER_FAIL_MS |
| First retry after a challenge-seen auth-like failure. | |
| constexpr uint32_t | STATUS_AUTH_RETRY_AFTER_FAIL_STEP2_MS |
| Second retry after a challenge-seen auth-like failure. | |
| constexpr uint32_t | STATUS_AUTH_RETRY_AFTER_FAIL_MAX_MS |
| Steady-state backoff after repeated auth-like failures. | |
| constexpr uint32_t | INITIAL_STATUS_REQUEST_DELAY_MS |
| Delay before the first post-boot status request from an entity. | |
| constexpr uint32_t | REMOTE_ACTIVITY_STATUS_POLL_DELAY_MS |
| Delay before polling after overheard remote traffic. | |
| constexpr uint32_t | MAX_TRACKED_STATUS_POLL_WINDOW_MS |
| Hard stop for follow-up polling after a command or remote activity. | |
| constexpr uint32_t | PAIRING_DISCOVERY_RESPONSE_TIMEOUT_MS = 2000 |
| Discovery wait window after sending 0x28. | |
| constexpr uint32_t | PAIRING_KEY_CHALLENGE_TIMEOUT_MS = 500 |
| Wait window for the device's 0x3C challenge. | |
| constexpr float | BINARY_ENTITY_ON_POSITION_THRESHOLD |
| Shared 0-100 cutoff: values below this mean binary "on". | |
| constexpr uint8_t | BINARY_ENTITY_ON_POSITION = 0 |
| constexpr uint8_t | BINARY_ENTITY_OFF_POSITION = 100 |
|
inline |
Clear all bounded follow-up polling state for a device.
| dev | Device record to reset. |
Definition at line 58 of file hub_internal.h.
|
inline |
Is the given position value an on/off binary encoding?
| position | Position value to test. |
Definition at line 81 of file hub_internal.h.
|
inline |
Can this device accept an execute (position) command?
Checks capability and, for unknown types, allows binary positions for light/switch.
| dev | IoDevice to check. |
| position | Position value being sent. |
Definition at line 107 of file hub_internal.h.
|
inline |
Can this device accept a tilt command?
| dev | IoDevice to check. |
Definition at line 118 of file hub_internal.h.
|
inline |
Does the device's type match the expected HA entity class?
UNKNOWN devices always match to keep imported/discovered devices working.
| dev | IoDevice to check. |
| expected | Desired capability class (COVER, LIGHT, SWITCH, etc.). |
Definition at line 90 of file hub_internal.h.
|
inline |
Does the device support status requests?
UNKNOWN devices pass through.
| dev | IoDevice to check. |
Definition at line 98 of file hub_internal.h.
|
inline |
Log a frame at the "io_capture" tag with structured fields.
Used for protocol‑level debugging (phases: component, tx, rx, parse_ok/parse_fail).
| radio | Radio driver instance (provides chip name and capture). |
| stage | String label for the current phase. |
| buf | Raw bytes being logged. |
| len | Length of buf. |
| frame | Optional parsed IoFrame for decoded fields (cmd, src, dst). |
Definition at line 175 of file hub_internal.h.
|
inline |
Log a frame‑level issue (unregistered endpoints, unsupported commands).
| component | Pointer to the component (for device lookup). |
| direction | "tx" or "rx". |
| reason | Short issue label (e.g., "unregistered_device"). |
| frame | Parsed frame. |
| len | Serialized length. |
Definition at line 198 of file hub_internal.h.
|
inline |
Log a rejected operation with capability mismatch details.
| device_id | Device ID string. |
| dev | IoDevice that rejected the command. |
| operation | Human‑readable operation name (e.g., "set position"). |
| expected | Expected capability class or profile name. |
Definition at line 161 of file hub_internal.h.
|
inline |
Log a concise status‑update line used by inbound handlers.
| id | Device ID. |
| dev | Current device state. |
| suffix | Optional suffix added after the state string (e.g., " (status update)"). |
Definition at line 235 of file hub_internal.h.
|
inline |
Normalize stopped state: some devices briefly report stopped before target/current converge.
| dev | Device record to update (may clear is_stopped if positions differ). |
Definition at line 222 of file hub_internal.h.
|
inline |
Compute the next background status-poll retry delay after a failed exchange.
Plain silence is treated as a soft reachability problem and ramps up gradually so sleeping or temporarily busy devices are retried soon. Exchanges that reached the 0x3C challenge but never completed are much more likely to represent an invalid system key or pairing mismatch, so they back off more aggressively to avoid repeated 0x3D HMAC traffic.
| consecutive_failures | 1-based count of consecutive failures in the current failure class. |
| auth_like_failure | True when the failed exchange saw a 0x3C challenge. |
Definition at line 132 of file hub_internal.h.
|
inline |
Check whether a device remains inside its bounded follow-up polling window.
| dev | Device record. |
| now | Current millis() timestamp. |
Definition at line 70 of file hub_internal.h.
|
inlineconstexpr |
Definition at line 54 of file hub_internal.h.
|
inlineconstexpr |
Definition at line 53 of file hub_internal.h.
|
inlineconstexpr |
Shared 0-100 cutoff: values below this mean binary "on".
Definition at line 49 of file hub_internal.h.
|
inlineconstexpr |
Delay before the first post-boot status request from an entity.
Definition at line 41 of file hub_internal.h.
|
inlineconstexpr |
Hard stop for follow-up polling after a command or remote activity.
Definition at line 45 of file hub_internal.h.
|
inlineconstexpr |
Discovery wait window after sending 0x28.
Definition at line 47 of file hub_internal.h.
|
inlineconstexpr |
Wait window for the device's 0x3C challenge.
Definition at line 48 of file hub_internal.h.
|
inlineconstexpr |
Delay before polling after overheard remote traffic.
Definition at line 43 of file hub_internal.h.
|
inlineconstexpr |
Steady-state backoff after repeated auth-like failures.
Definition at line 39 of file hub_internal.h.
|
inlineconstexpr |
First retry after a challenge-seen auth-like failure.
Definition at line 35 of file hub_internal.h.
|
inlineconstexpr |
Second retry after a challenge-seen auth-like failure.
Definition at line 37 of file hub_internal.h.
|
inlineconstexpr |
Steady-state backoff for repeated silent status-poll failures.
Definition at line 33 of file hub_internal.h.
|
inlineconstexpr |
First retry after a silent status-poll failure.
Definition at line 26 of file hub_internal.h.
|
inlineconstexpr |
Second retry after a silent status-poll failure.
Definition at line 27 of file hub_internal.h.
|
inlineconstexpr |
Third retry after a silent status-poll failure.
Definition at line 29 of file hub_internal.h.
|
inlineconstexpr |
Fourth retry after a silent status-poll failure.
Definition at line 31 of file hub_internal.h.
|
inlineconstexpr |
Shared log tag for hub-level messages.
Definition at line 25 of file hub_internal.h.