Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
esphome::home_io_control::IoDevice Struct Reference

Runtime state of a paired IO‑Homecontrol device. More...

#include <proto_device_model.h>

Collaboration diagram for esphome::home_io_control::IoDevice:

Public Attributes

uint8_t node_id [NODE_ID_SIZE] {}
 Device's 3‑byte radio address.
DeviceType type {DeviceType::UNKNOWN}
 Device type (shutter, awning, etc.).
uint8_t subtype {0}
 Device subtype (manufacturer‑specific).
char name [DEVICE_NAME_BUFFER_SIZE] {}
 Cached UTF-8 device name decoded from Latin-1 wire payloads.
float position {UNKNOWN_POSITION}
 Current position: 0=open, 100=closed, or UNKNOWN_POSITION.
float tilt {UNKNOWN_POSITION}
 Current tilt: 0=closed, 100=open, or UNKNOWN_POSITION.
float target {UNKNOWN_POSITION}
 Target position the device is moving toward.
bool is_stopped {true}
 True if device is not moving.
bool inverted {false}
 True if open/close positions are swapped (e.g., horizontal awning).
bool silent {false}
 True to send position moves with the reference hub's "silent operation" extended block, which makes the motor travel more slowly.
bool optimistic_state {true}
 True if target may be set ahead of a confirming poll/response.
bool low_power {false}
 YAML-declared: this target is a low-power / duty-cycled receiver, so directed frames set CTRL1_LOW_POWER and use the long wake-up preamble.
bool dimmable {false}
 True for a LIGHT-class device configured dimmable: true in YAML.
uint8_t last_result_code {0}
 Last CMD_ERROR_RESP result byte (0 = none recorded).
uint32_t last_result_at_ms {0}
 millis() timestamp of last_result_code, 0 when none recorded.
uint8_t last_commander [NODE_ID_SIZE] {}
 Node ID of the controller that last commanded this device, as reported verbatim by the device in its own status payload.
uint8_t last_command_originator {0}
 That command's Command Originator byte (ORIGINATOR_* in proto_constants.h).
bool has_last_command {false}
 True once a status reply carried a well-formed last-command record.
uint32_t last_status {0}
 millis() timestamp of last received status.
int16_t last_rssi_dbm {RSSI_UNKNOWN_DBM}
 Most recent raw RSSI sample (dBm), or RSSI_UNKNOWN_DBM.
int16_t rssi_ema_scaled {RSSI_UNKNOWN_DBM}
 Smoothed RSSI as fixed point in 1/RSSI_EMA_SCALE dBm — read through device_rssi_ema_dbm(), updated by detail::update_link_health() in hub_internal.h.
uint32_t last_seen_ms {0}
 millis() of the last frame received from this device (any command), 0 = never.
uint16_t exchange_timeout_count {0}
 Cumulative count of outbound exchanges to this device with no valid response (see detail::record_exchange_timeout() in hub_internal.h).
uint16_t exchange_attempt_count {0}
 Cumulative attempts (ExchangeEngine::DebugInfo::tries, 1-based per exchange) across those timed-out exchanges only — attempts within an ultimately successful exchange are not counted (deliberate scope limit).
OptimisticState optimistic {}
 Hub-side predictions; see OptimisticState. Never observation.

Detailed Description

Runtime state of a paired IO‑Homecontrol device.

Definition at line 308 of file proto_device_model.h.

Member Data Documentation

◆ dimmable

bool esphome::home_io_control::IoDevice::dimmable {false}

True for a LIGHT-class device configured dimmable: true in YAML.

Not a protocol-level fact (the wire gives no dimmable-capability signal) — set from platform_light.cpp's YAML config via DeviceRegistry::set_dimmable(), purely for accurate profile-name logging.

Definition at line 328 of file proto_device_model.h.

◆ exchange_attempt_count

uint16_t esphome::home_io_control::IoDevice::exchange_attempt_count {0}

Cumulative attempts (ExchangeEngine::DebugInfo::tries, 1-based per exchange) across those timed-out exchanges only — attempts within an ultimately successful exchange are not counted (deliberate scope limit).

Definition at line 358 of file proto_device_model.h.

◆ exchange_timeout_count

uint16_t esphome::home_io_control::IoDevice::exchange_timeout_count {0}

Cumulative count of outbound exchanges to this device with no valid response (see detail::record_exchange_timeout() in hub_internal.h).

Definition at line 356 of file proto_device_model.h.

◆ has_last_command

bool esphome::home_io_control::IoDevice::has_last_command {false}

True once a status reply carried a well-formed last-command record.

Definition at line 345 of file proto_device_model.h.

◆ inverted

bool esphome::home_io_control::IoDevice::inverted {false}

True if open/close positions are swapped (e.g., horizontal awning).

Definition at line 317 of file proto_device_model.h.

◆ is_stopped

bool esphome::home_io_control::IoDevice::is_stopped {true}

True if device is not moving.

Definition at line 316 of file proto_device_model.h.

◆ last_command_originator

uint8_t esphome::home_io_control::IoDevice::last_command_originator {0}

That command's Command Originator byte (ORIGINATOR_* in proto_constants.h).

Only meaningful when has_last_command.

Definition at line 343 of file proto_device_model.h.

◆ last_commander

uint8_t esphome::home_io_control::IoDevice::last_commander[NODE_ID_SIZE] {}

Node ID of the controller that last commanded this device, as reported verbatim by the device in its own status payload.

All zeroes until a status reply carrying the record has been decoded (see detail::decode_last_command_record() in hub_internal.h).

Definition at line 339 of file proto_device_model.h.

◆ last_result_at_ms

uint32_t esphome::home_io_control::IoDevice::last_result_at_ms {0}

millis() timestamp of last_result_code, 0 when none recorded.

Definition at line 338 of file proto_device_model.h.

◆ last_result_code

uint8_t esphome::home_io_control::IoDevice::last_result_code {0}

Last CMD_ERROR_RESP result byte (0 = none recorded).

See command_result_name()/is_limitation_result() in proto_constants.h. Cleared by the next successful status/command reply for this device. Note: 0 is also the real RESULT_UNKNOWN_STATUS_REPLY wire value, so that specific explicit reply is indistinguishable here from "nothing recorded yet" — a known, accepted tradeoff.

Definition at line 333 of file proto_device_model.h.

◆ last_rssi_dbm

int16_t esphome::home_io_control::IoDevice::last_rssi_dbm {RSSI_UNKNOWN_DBM}

Most recent raw RSSI sample (dBm), or RSSI_UNKNOWN_DBM.

Definition at line 347 of file proto_device_model.h.

◆ last_seen_ms

uint32_t esphome::home_io_control::IoDevice::last_seen_ms {0}

millis() of the last frame received from this device (any command), 0 = never.

Definition at line 355 of file proto_device_model.h.

◆ last_status

uint32_t esphome::home_io_control::IoDevice::last_status {0}

millis() timestamp of last received status.

Definition at line 346 of file proto_device_model.h.

◆ low_power

bool esphome::home_io_control::IoDevice::low_power {false}

YAML-declared: this target is a low-power / duty-cycled receiver, so directed frames set CTRL1_LOW_POWER and use the long wake-up preamble.

A protocol-reported class exists (discovery Multi Information Byte) but is surfaced through the pairing/scan snippet, never applied at runtime.

Definition at line 324 of file proto_device_model.h.

◆ name

char esphome::home_io_control::IoDevice::name[DEVICE_NAME_BUFFER_SIZE] {}

Cached UTF-8 device name decoded from Latin-1 wire payloads.

Definition at line 312 of file proto_device_model.h.

◆ node_id

uint8_t esphome::home_io_control::IoDevice::node_id[NODE_ID_SIZE] {}

Device's 3‑byte radio address.

Definition at line 309 of file proto_device_model.h.

◆ optimistic

OptimisticState esphome::home_io_control::IoDevice::optimistic {}

Hub-side predictions; see OptimisticState. Never observation.

Definition at line 361 of file proto_device_model.h.

◆ optimistic_state

bool esphome::home_io_control::IoDevice::optimistic_state {true}

True if target may be set ahead of a confirming poll/response.

Definition at line 323 of file proto_device_model.h.

◆ position

float esphome::home_io_control::IoDevice::position {UNKNOWN_POSITION}

Current position: 0=open, 100=closed, or UNKNOWN_POSITION.

Definition at line 313 of file proto_device_model.h.

◆ rssi_ema_scaled

int16_t esphome::home_io_control::IoDevice::rssi_ema_scaled {RSSI_UNKNOWN_DBM}

Smoothed RSSI as fixed point in 1/RSSI_EMA_SCALE dBm — read through device_rssi_ema_dbm(), updated by detail::update_link_health() in hub_internal.h.

Fixed point (rather than whole dBm) keeps sub-dBm EMA contributions from vanishing to integer truncation, so the average converges on a stable signal instead of stalling up to RSSI_EMA_SCALE−1 dBm away. RSSI_UNKNOWN_DBM before the first sample.

Definition at line 348 of file proto_device_model.h.

◆ silent

bool esphome::home_io_control::IoDevice::silent {false}

True to send position moves with the reference hub's "silent operation" extended block, which makes the motor travel more slowly.

Like inverted/dimmable this is a YAML-declared preference, not a protocol-reported fact — nothing on the wire tells us whether a device is in that mode.

Definition at line 318 of file proto_device_model.h.

◆ subtype

uint8_t esphome::home_io_control::IoDevice::subtype {0}

Device subtype (manufacturer‑specific).

Definition at line 311 of file proto_device_model.h.

◆ target

float esphome::home_io_control::IoDevice::target {UNKNOWN_POSITION}

Target position the device is moving toward.

Definition at line 315 of file proto_device_model.h.

◆ tilt

float esphome::home_io_control::IoDevice::tilt {UNKNOWN_POSITION}

Current tilt: 0=closed, 100=open, or UNKNOWN_POSITION.

Definition at line 314 of file proto_device_model.h.

◆ type

DeviceType esphome::home_io_control::IoDevice::type {DeviceType::UNKNOWN}

Device type (shutter, awning, etc.).

Definition at line 310 of file proto_device_model.h.


The documentation for this struct was generated from the following file: