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

Namespaces

namespace  decisions
namespace  exchange
namespace  detail
namespace  pairing
namespace  crypto

Classes

class  IOHomeControlComponent
 The main IO-Homecontrol component. More...
class  IOHomeDiscoverButton
 Button entity that triggers device discovery and pairing when pressed in Home Assistant. More...
class  IOHomeCover
 Cover entity representing an IO‑Homecontrol shutter/awning/blind. More...
class  IOHomeLight
 Binary light entity for IO‑Homecontrol on/off devices. More...
class  IOHomeSwitch
 Binary switch entity for IO‑Homecontrol on/off devices. More...
struct  IoFrame
 Parsed IO‑Homecontrol frame (CTRL0/1 + addresses + command + data). More...
struct  IoDevice
 Runtime state of a paired IO‑Homecontrol device. More...
class  SpiAccess
 Interface for SPI bus access. More...
struct  RadioTxConfig
 Configuration for transmitting a packet: carrier frequency and preamble length. More...
struct  RadioRxPacket
 Raw packet received from the radio. More...
struct  RadioCaptureInfo
 Diagnostic capture from a radio operation. More...
class  RadioDriver
 Abstract radio driver for IO-Homecontrol. More...
struct  UartProbeResult
 Result of the UART probe: best candidate frame within a raw capture. More...
class  RadioSX1262
 SX1262 implementation of RadioDriver. More...
class  RadioSX1276
 SX1276 implementation of RadioDriver. More...

Typedefs

using DeviceUpdateCallback = std::function<void(const std::string &device_id, const IoDevice &device)>
 Callback type for notifying covers of device state changes.

Enumerations

enum class  DeviceType : uint8_t {
  UNKNOWN = 0x00 , VENETIAN_BLIND = 0x01 , ROLLER_SHUTTER = 0x02 , AWNING = 0x03 ,
  WINDOW_OPENER = 0x04 , GARAGE_OPENER = 0x05 , LIGHT = 0x06 , GATE_OPENER = 0x07 ,
  ROLLING_DOOR_OPENER = 0x08 , LOCK = 0x09 , BLIND = 0x0A , SCREEN = 0x0B ,
  BEACON = 0x0C , DUAL_SHUTTER = 0x0D , HEATING_TEMPERATURE_INTERFACE = 0x0E , ON_OFF_SWITCH = 0x0F ,
  HORIZONTAL_AWNING = 0x10 , EXTERNAL_VENETIAN_BLIND = 0x11 , LOUVRE_BLIND = 0x12 , CURTAIN_TRACK = 0x13 ,
  VENTILATION_POINT = 0x14 , EXTERIOR_HEATING = 0x15 , HEAT_PUMP = 0x16 , INTRUSION_ALARM = 0x17 ,
  SWINGING_SHUTTER = 0x18
}
 Device type identifiers reported by IO‑Homecontrol products. More...
enum class  DeviceCapabilityClass : uint8_t {
  UNKNOWN = 0x00 , COVER = 0x01 , LIGHT = 0x02 , SWITCH = 0x03 ,
  SENSOR = 0x04 , BEACON = 0x05 , CLIMATE = 0x06 , LOCK = 0x07
}
 High‑level capability class derived from DeviceType. More...

Functions

bool stored_node_id_is_valid (const uint8_t id[NODE_ID_SIZE])
 Check if a stored node ID is valid (not all-zero, not all-0xFF).
std::string format_position (float pos)
 Format a position float as a human‑readable string (e.g.
void bytes_to_hex (const uint8_t *data, uint8_t len, char *out, size_t out_size)
bool create_execute (IoFrame &f, const uint8_t *own, const uint8_t *dst, bool low_power, uint8_t position)
 Build an execute command (0x00) to control a device.
bool create_get_status (IoFrame &f, const uint8_t *own, const uint8_t *dst)
 Build a get-status request (0x03). The device responds with its current position.
bool create_execute_tilt (IoFrame &f, const uint8_t *own, const uint8_t *dst, bool low_power, uint8_t tilt_percent)
 Build a tilt execute command (0x00) for devices that support slat angle control.
bool create_get_status_tilt (IoFrame &f, const uint8_t *own, const uint8_t *dst)
 Build a tilt-aware get-status request (0x03) that returns the extended 16-byte tilt payload.
bool create_discover (IoFrame &f, const uint8_t *own)
 Build a discovery broadcast (0x28).
bool create_key_init (IoFrame &f, const uint8_t *own, const uint8_t *dst)
 Build a key-init request (0x31) to start the pairing key exchange with a discovered device.
bool create_key_transfer (IoFrame &f, IoFrame &old_frame, const uint8_t *dst, const uint8_t *src, const uint8_t key[AES_KEY_SIZE], const uint8_t challenge[HMAC_SIZE])
 Build a key-transfer frame (0x32) containing the system key encrypted with the transfer key.
bool create_challenge_req (IoFrame &f, const uint8_t *dst, const uint8_t *src)
 Build a challenge request (0x3C) containing 6 random bytes.
bool create_challenge_resp (IoFrame &f, const uint8_t *dst, const uint8_t *src, const uint8_t challenge[HMAC_SIZE], const IoFrame &origin, const uint8_t *key)
 Build a challenge response (0x3D) proving we know the system key.
bool create_status_update_resp (IoFrame &f, const uint8_t *own, const uint8_t *dst)
 Build a status-update acknowledgment (0x72).
bool create_set_config1 (IoFrame &f, const uint8_t *own, const uint8_t *dst)
 Build a set-config command (0x6F) to tell the device to automatically send status updates when controlled by any remote (not just us).
static int hex_nibble (char ch)
bool hex_to_bytes (const std::string &hex, uint8_t *out, uint8_t len)
 Convert a hex string (e.g., "123ABC") to a byte array.
std::string node_id_to_string (const uint8_t id[NODE_ID_SIZE])
 Format a 3‑byte node ID as a 6‑character uppercase hex string.
bool default_inverted_for_type (DeviceType type)
 Determine whether a device type has inverted position mapping by default.
DeviceType decode_packed_device_type (uint8_t type_msb, uint8_t type_subtype)
 Decode a protocol-packed device type from two metadata bytes.
uint8_t decode_packed_device_subtype (uint8_t type_subtype)
 Decode a protocol-packed device subtype from the second metadata byte.
void decode_position_report (uint16_t target_raw, uint16_t current_raw, bool is_stopped, float &target, float &position)
 Decode target/current position values from a status frame.
bool has_reached_target_position (float target, float position)
 Has the device reached its target within tolerance?
float decode_tilt_report (uint16_t tilt_raw)
 Decode tilt angle from raw 16‑bit value.
uint16_t crc_ccitt (const uint8_t *data, uint8_t len)
 CRC-CCITT used by the IO-Homecontrol protocol for frame validation.
void init_frame (IoFrame &f, bool is_2w=true, bool start=false, bool end=false, bool low_power=false)
 Initialize an IoFrame header (ctrl0/ctrl1) with flags.
void set_dst (IoFrame &f, const uint8_t id[NODE_ID_SIZE])
 Set destination node ID.
void set_src (IoFrame &f, const uint8_t id[NODE_ID_SIZE])
 Set source node ID.
bool set_cmd (IoFrame &f, uint8_t cmd, const uint8_t *params=nullptr, uint8_t params_len=0)
 Set command and payload.
uint8_t frame_length (const IoFrame &f)
 Get total frame length from ctrl0.
bool is_start (const IoFrame &f)
 Check START flag.
bool is_end (const IoFrame &f)
 Check END flag.
uint8_t serialize (const IoFrame &f, uint8_t *buf, uint8_t buf_size)
 Serialize a parsed frame into a wire buffer (without CRC).
bool parse (const uint8_t *buf, uint8_t buf_len, IoFrame &f)
 Parse a wire buffer into a parsed IoFrame (validates length and CTRL0).
const char * device_type_name (DeviceType type)
 Convert a DeviceType to a lowercase string identifier.
DeviceCapabilityClass device_capability_class (DeviceType type)
 Map a raw IO‑Homecontrol type to the closest ESPHome/Home Assistant entity family.
const char * device_capability_class_name (DeviceType type)
 Get a human‑readable name for a capability class.
bool device_supports_position_control (DeviceType type)
 Does this device type support precise position control (0–100)?
bool device_supports_binary_control (DeviceType type)
 Does this device type support binary on/off control?
bool device_supports_status_requests (DeviceType type)
 Does this device type support status request commands (0x03)?
bool device_supports_tilt (DeviceType type)
 Does this device type support tilt (slat angle) control?
const char * device_operation_profile_name (DeviceType type)
 Human‑readable operation profile name for a device type.
static uint8_t get_bit_msb (const uint8_t *data, uint16_t bit_pos)
 Extract a single bit (MSB‑first) from a byte buffer.
static uint8_t decode_uart_probe (const uint8_t *raw, uint8_t raw_len, uint8_t bit_offset, uint8_t *decoded, uint8_t decoded_max_len)
 Decode a raw UART‑encoded bitstream into bytes.
static bool is_known_io_command (uint8_t cmd)
 Check if a command ID is one of the known IO‑Homecontrol commands.
static bool is_plausible_uart_frame (const IoFrame &frame, uint8_t candidate_len)
static UartProbeResult find_uart_probe (const uint8_t *raw, uint8_t raw_len)
 Search a raw capture for the most plausible IoFrame using UART decoding.

Variables

static const char *const TAG = detail::TAG
constexpr uint8_t DEFAULT_TX_POWER_DBM = 17
 Default TX power used unless YAML overrides it.
constexpr uint8_t DEFAULT_PA_PIN_PA_BOOST = 0x80
 SX1276 PA_CONFIG selector for the PA_BOOST output path.
constexpr uint8_t DEFAULT_TCXO_VOLTAGE_SETTING_1P8V = 0x03
 SX1262 DIO3 setting value for a 1.8 V TCXO.
constexpr size_t POSITION_TEXT_BUFFER_SIZE = 16
 Buffer for formatted position strings such as "100%".
static const char *const TAG = "home_io_control.exchange"
constexpr size_t FRAME_LOG_HEX_BUFFER_SIZE = 220
 Fits a full 32-byte frame rendered as spaced hex text.
static const char *const TAG = "home_io_control.cover"
static const char *const TAG = "home_io_control.light"
static const char *const TAG = "home_io_control.switch"
static constexpr uint32_t FREQ_CH1 = 868250000
 The protocol uses 3 frequency channels in the 868 MHz ISM band.
static constexpr uint32_t FREQ_CH2 = 868950000
 Channel 2: 868.95 MHz (1W and 2W, TX channel).
static constexpr uint32_t FREQ_CH3 = 869850000
 Channel 3: 869.85 MHz (2W only).
static constexpr uint16_t LONG_PREAMBLE = 1024
 Preamble is a sequence of 0xAA bytes that precedes every frame.
static constexpr uint16_t SHORT_PREAMBLE = 8
 8 bytes for response/continuation frames
static constexpr uint16_t SX1262_AUTH_RESPONSE_PREAMBLE = 64
 SX1262-specific preamble for the outbound 0x3D challenge response.
static constexpr int32_t SX1262_EXCHANGE_RESPONSE_WAIT_SLICE_MS = 90
 SX1262-specific per-channel dwell while waiting for authenticated exchange responses.
static constexpr int32_t HOP_TIME_US = 2700
 Timing constants for frequency hopping and response waiting.
static constexpr int32_t RESPONSE_CHANNEL_WAIT_MS = 50
 Per-channel dwell while waiting for an exchange response.
static constexpr int32_t RESPONSE_WAIT_MS = 500
 Wait for response to non-start frame.
static constexpr int32_t RESPONSE_START_WAIT_MS = 300
 Wait for response to start frame (longer).
static constexpr int32_t RESPONSE_AUTH_WAIT_MS
 Wait for final response after challenge response.
static constexpr int32_t EXCHANGE_RETRY_DELAY_MS = 250
 Gap between retries within one HA command.
static constexpr uint8_t EXCHANGE_RETRY_COUNT = 3
 Attempts per command before reporting failure.
static constexpr int16_t LBT_RSSI_THRESHOLD_DBM = -90
 Listen-before-talk (LBT) parameters for ETSI EN 300 220 compliance.
static constexpr uint8_t LBT_MAX_RETRIES = 5
 Max carrier-sense attempts before TX anyway.
static constexpr uint8_t LBT_RETRY_DELAY_MS = 5
 Backoff between LBT checks (≥ 5ms per ETSI).
static constexpr uint8_t NODE_ID_SIZE = 3
 Device/node addresses are 3 bytes (e.g., "123ABC").
static constexpr uint8_t NODE_ID_STRING_SIZE = NODE_ID_SIZE * 2 + 1
 Uppercase hex node ID plus null terminator.
static constexpr uint8_t HMAC_SIZE = 6
 Authentication HMAC is 6 bytes (truncated AES output).
static constexpr uint8_t AES_KEY_SIZE = 16
 AES-128 key size.
static constexpr uint8_t AES_BLOCK_SIZE = 16
 AES block size.
static constexpr uint8_t IV_SIZE = 16
 Initialization vector size for AES.
static constexpr uint8_t IV_PADDING = 0x55
 Padding byte used in IV construction.
static constexpr uint8_t BITS_PER_BYTE = 8
 Number of bits in one protocol byte.
static constexpr uint8_t FRAME_MIN_SIZE = 9
 Minimum frame: CTRL0+CTRL1+DST(3)+SRC(3)+CMD(1).
static constexpr uint8_t FRAME_MAX_SIZE = 32
 Maximum frame size (9 header + 23 data).
static constexpr uint8_t FRAME_MAX_DATA_SIZE = 23
 Maximum data bytes after command ID.
static constexpr uint8_t CTRL0_END = 0x80
 Control byte 0 (CTRL0) bit definitions.
static constexpr uint8_t CTRL0_START = 0x40
 Bit 6: first frame in exchange (uses long preamble).
static constexpr uint8_t CTRL0_PROTOCOL_1W = 0x20
 Bit 5: 1=OneWay protocol, 0=TwoWay protocol.
static constexpr uint8_t CTRL0_LENGTH_MASK = 0x1F
 Bits [4:0]: frame length - 1.
static constexpr uint8_t CTRL1_LOW_POWER = 0x20
 Control byte 1 (CTRL1) bit definitions.
static constexpr uint8_t CMD_EXECUTE = 0x00
 Set position/open/close/stop — requires authentication.
static constexpr uint8_t CMD_PRIVATE = 0x03
 Get device status — no authentication needed.
static constexpr uint8_t CMD_PRIVATE_RESP = 0x04
 Response to 0x00 and 0x03 (contains position data).
static constexpr uint8_t CMD_DISCOVER_REQ = 0x28
 Broadcast discovery request.
static constexpr uint8_t CMD_DISCOVER_RESP = 0x29
 Device responds with its ID and type.
static constexpr uint8_t CMD_DISCOVER_SPE_REQ = 0x2A
 Discover sub-devices (e.g., light on garage door).
static constexpr uint8_t CMD_DISCOVER_SPE_RESP = 0x2B
 Sub-device response.
static constexpr uint8_t CMD_DISCOVER_CONFIRM = 0x2C
 Confirm discovery to device.
static constexpr uint8_t CMD_DISCOVER_CONFIRM_ACK = 0x2D
 Device acknowledges confirmation.
static constexpr uint8_t CMD_KEY_INIT = 0x31
 Initiate key transfer to device.
static constexpr uint8_t CMD_KEY_TRANSFER = 0x32
 Send encrypted system key to device.
static constexpr uint8_t CMD_KEY_CONFIRM = 0x33
 Device confirms key was received.
static constexpr uint8_t CMD_CHALLENGE_REQ = 0x3C
 Device sends 6-byte random challenge.
static constexpr uint8_t CMD_CHALLENGE_RESP = 0x3D
 Controller responds with HMAC proof.
static constexpr uint8_t CMD_GET_NAME = 0x50
 Request device name.
static constexpr uint8_t CMD_GET_NAME_RESP = 0x51
 Device name response.
static constexpr uint8_t CMD_GET_INFO2 = 0x56
 Request device type/model info.
static constexpr uint8_t CMD_GET_INFO2_RESP = 0x57
 Device type/model response.
static constexpr uint8_t CMD_SET_CONFIG1 = 0x6F
 Configure device to auto-send status updates.
static constexpr uint8_t CMD_SET_CONFIG1_RESP = 0x70
 Config response.
static constexpr uint8_t CMD_STATUS_UPDATE = 0x71
 Device-initiated status update (needs auth).
static constexpr uint8_t CMD_STATUS_UPDATE_RESP = 0x72
 Acknowledge status update.
static constexpr uint8_t CMD_ERROR_RESP = 0xFE
 Error response to any command.
static constexpr uint8_t POS_STOP = 0xD2
 Position values in the IO protocol.
static constexpr uint8_t POS_UNKNOWN = 0xD4
 Position unknown.
static constexpr uint8_t POS_FAVORITE = 0xD8
 Move to favorite/"My" position.
static constexpr uint16_t STATUS_POS_MAX = 0xC800
 In status responses, position is encoded as a 16-bit value where 0x0000 = fully open (0%) and 0xC800 = fully closed (100%).
static constexpr uint16_t STATUS_POS_TOLERANCE_RAW = 100
 Target-reached tolerance expressed in raw IO-homecontrol position units.
static constexpr uint8_t STATUS_STOPPED = 0x01
 Status byte flags in CMD_PRIVATE_RESP and CMD_STATUS_UPDATE.
static constexpr uint8_t STATUS_EXPECTED = 0x80
 Byte 1 bit 7: device will send auto status update.
static constexpr uint8_t STATUS_TILT_SELECTOR = 0x20
 Extended status payload marker for tilt-capable devices.
static constexpr uint8_t DEVICE_METADATA_SIZE = 2
 Packed device metadata uses two bytes where the high 8 bits carry the upper type bits and the low byte carries both the remaining type bits and the 6-bit manufacturer subtype.
static constexpr uint8_t DEVICE_TYPE_LOW_BITS_SHIFT = 2
static constexpr uint8_t DEVICE_TYPE_HIGH_BITS_SHIFT = 6
static constexpr uint8_t DEVICE_SUBTYPE_MASK = 0x3F
static constexpr uint8_t TRANSFER_KEY [AES_KEY_SIZE]
 The transfer key is a hardcoded key used ONLY during pairing to obfuscate the system key during over-the-air transfer.
static constexpr uint16_t CRC_POLYNOMIAL_REVERSED = 0x8408
 Reversed CRC-CCITT polynomial used by IO-homecontrol.
static constexpr uint16_t CRC_LSB_MASK = 0x0001
 Least-significant-bit mask for reflected CRC update.
static constexpr uint8_t BROADCAST_DISCOVER [NODE_ID_SIZE] = {0x00, 0x00, 0x3B}
 Broadcast address for device discovery (0x00003B).
static constexpr float UNKNOWN_POSITION = 212.0F
 Sentinel value meaning "position is not known yet".
static constexpr uint8_t DEVICE_NAME_BUFFER_SIZE = 32
 Device name storage including null terminator.
constexpr uint8_t RADIO_PACKET_BUFFER_SIZE
 Scratch buffer size for raw radio packets and recovered frames.
static const char *const TAG = "home_io_control.sx1262"
static const uint8_t SX1262_SYNC_WORD_PARAM_24_BITS = 0x18
static const uint8_t SX1262_RX_PROBE_PACKET_LEN = 32
static const uint8_t UART_PROBE_MAX_BIT_OFFSET = 10
 Maximum bit offset to search for valid UART decode start position.
static constexpr uint8_t SX1262_SET_STANDBY = 0x80
static constexpr uint8_t SX1262_SET_RX = 0x82
static constexpr uint8_t SX1262_SET_TX = 0x83
static constexpr uint8_t SX1262_SET_RF_FREQUENCY = 0x86
static constexpr uint8_t SX1262_SET_RX_TX_FALLBACK_MODE = 0x93
static constexpr uint8_t SX1262_WRITE_BUFFER = 0x0E
static constexpr uint8_t SX1262_READ_BUFFER = 0x1E
static constexpr uint8_t SX1262_SET_DIO_IRQ_PARAMS = 0x08
static constexpr uint8_t SX1262_GET_IRQ_STATUS = 0x12
static constexpr uint8_t SX1262_GET_PACKET_STATUS = 0x14
static constexpr uint8_t SX1262_GET_DEVICE_ERRORS = 0x17
static constexpr uint8_t SX1262_CLEAR_IRQ_STATUS = 0x02
static constexpr uint8_t SX1262_CLEAR_DEVICE_ERRORS = 0x07
static constexpr uint8_t SX1262_SET_PACKET_TYPE = 0x8A
static constexpr uint8_t SX1262_SET_MODULATION_PARAMS = 0x8B
static constexpr uint8_t SX1262_SET_PACKET_PARAMS = 0x8C
static constexpr uint8_t SX1262_SET_BUFFER_BASE_ADDRESS = 0x8F
static constexpr uint8_t SX1262_SET_PA_CONFIG = 0x95
static constexpr uint8_t SX1262_SET_TX_PARAMS = 0x8E
static constexpr uint8_t SX1262_SET_DIO2_AS_RF_SWITCH_CTRL = 0x9D
static constexpr uint8_t SX1262_SET_DIO3_AS_TCXO_CTRL = 0x97
static constexpr uint8_t SX1262_CALIBRATE = 0x89
static constexpr uint8_t SX1262_CALIBRATE_IMAGE = 0x98
static constexpr uint8_t SX1262_GET_RX_BUFFER_STATUS = 0x13
static constexpr uint8_t SX1262_GET_RSSI_INST = 0x15
static constexpr uint8_t SX1262_SET_REGULATOR_MODE = 0x96
static constexpr uint8_t SX1262_GET_STATUS = 0xC0
static constexpr uint8_t SX1262_WRITE_REGISTER = 0x0D
static constexpr uint8_t SX1262_READ_REGISTER = 0x1D
static constexpr uint16_t SX1262_IRQ_TX_DONE = 0x0001
static constexpr uint16_t SX1262_IRQ_RX_DONE = 0x0002
static constexpr uint16_t SX1262_IRQ_SYNC_WORD_VALID = 0x0008
static constexpr uint16_t SX1262_IRQ_CRC_ERR = 0x0040
static constexpr uint16_t SX1262_REG_SYNC_WORD = 0x06C0
static constexpr uint16_t SX1262_REG_RX_GAIN = 0x08AC
static constexpr uint16_t SX1262_REG_TX_CLAMP_CONFIG = 0x08D8
static constexpr uint8_t SX1262_GFSK_PACKET_TYPE_KNOWN_LENGTH = 0x00
static constexpr uint8_t SX1262_GFSK_CRC_OFF = 0x01
static constexpr uint8_t SX1262_FALLBACK_STDBY_XOSC = 0x30
static const char *const TAG = "home_io_control.sx1276"
static constexpr uint8_t REG_FIFO = 0x00
 FIFO read/write access.
static constexpr uint8_t REG_OP_MODE = 0x01
 Operating mode (sleep/standby/tx/rx).
static constexpr uint8_t REG_BITRATE_MSB = 0x02
 Bit rate MSB = FXOSC / bitrate.
static constexpr uint8_t REG_BITRATE_LSB = 0x03
static constexpr uint8_t REG_FDEV_MSB = 0x04
 Frequency deviation MSB.
static constexpr uint8_t REG_FDEV_LSB = 0x05
static constexpr uint8_t REG_FRF_MSB = 0x06
 Carrier frequency MSB (freq = FRF * FXOSC / 2^19).
static constexpr uint8_t REG_FRF_MID = 0x07
static constexpr uint8_t REG_FRF_LSB = 0x08
static constexpr uint8_t REG_PA_CONFIG = 0x09
 Power amplifier config (pin select + power level).
static constexpr uint8_t REG_PA_RAMP = 0x0A
 PA ramp time and modulation shaping.
static constexpr uint8_t REG_LNA = 0x0C
 Low noise amplifier gain and boost.
static constexpr uint8_t REG_RX_CONFIG = 0x0D
 Receiver configuration (AFC, AGC, trigger).
static constexpr uint8_t REG_RSSI_CONFIG = 0x0E
 RSSI smoothing.
static constexpr uint8_t REG_RX_BW = 0x12
 Receiver bandwidth.
static constexpr uint8_t REG_AFC_FEI = 0x1A
 AFC auto clear.
static constexpr uint8_t REG_PREAMBLE_DETECT = 0x1F
 Preamble detector config.
static constexpr uint8_t REG_OSC = 0x24
 Oscillator / clock output.
static constexpr uint8_t REG_RSSI_VALUE = 0x11
 Instant RSSI value in FSK mode.
static constexpr uint8_t REG_PREAMBLE_MSB = 0x25
 TX preamble length MSB.
static constexpr uint8_t REG_PREAMBLE_LSB = 0x26
static constexpr uint8_t REG_SYNC_CONFIG = 0x27
 Sync word config (size, polarity, enable).
static constexpr uint8_t REG_SYNC_VALUE1 = 0x28
 Sync word byte 1 (registers 0x28-0x2F for bytes 1-8).
static constexpr uint8_t REG_PACKET_CONFIG1 = 0x30
 Packet format, CRC, encoding.
static constexpr uint8_t REG_PACKET_CONFIG2 = 0x31
 Packet mode, IoHomeOn, PowerFrame.
static constexpr uint8_t REG_PAYLOAD_LENGTH = 0x32
 Max payload length.
static constexpr uint8_t REG_FIFO_THRESH = 0x35
 FIFO threshold for TX start condition.
static constexpr uint8_t REG_IRQ_FLAGS1 = 0x3E
 IRQ flags: mode ready, preamble detect, etc.
static constexpr uint8_t REG_IRQ_FLAGS2 = 0x3F
 IRQ flags: FIFO full/empty, payload ready, CRC ok.
static constexpr uint8_t REG_DIO_MAPPING1 = 0x40
 DIO0-DIO3 pin mapping.
static constexpr uint8_t REG_DIO_MAPPING2 = 0x41
 DIO4-DIO5 pin mapping.
static constexpr uint8_t REG_VERSION = 0x42
 Chip version (should read 0x12 for SX1276).
static constexpr uint8_t REG_PLLHOP = 0x44
 PLL hop: fast frequency change without standby.
static constexpr uint8_t REG_IMAGE_CAL = 0x3B
 Image calibration.
static constexpr uint8_t MODE_SLEEP = 0x00
static constexpr uint8_t MODE_STDBY = 0x01
static constexpr uint8_t MODE_TX = 0x03
static constexpr uint8_t MODE_RX = 0x05
static constexpr uint8_t MODE_MASK = 0x07
static constexpr uint32_t FXOSC = 32000000U
 SX1276 crystal oscillator frequency (32 MHz).

Typedef Documentation

◆ DeviceUpdateCallback

using esphome::home_io_control::DeviceUpdateCallback = std::function<void(const std::string &device_id, const IoDevice &device)>

Callback type for notifying covers of device state changes.

Definition at line 41 of file hub_core.h.

Enumeration Type Documentation

◆ DeviceCapabilityClass

High‑level capability class derived from DeviceType.

Enumerator
UNKNOWN 

Unknown capability.

COVER 

Position‑controlled cover (shutter/blind/awning).

LIGHT 

Binary on/off light.

SWITCH 

Binary on/off switch.

SENSOR 

Sensor device.

BEACON 

Beacon.

CLIMATE 

Climate device (heating/cooling).

LOCK 

Lock.

Definition at line 298 of file proto_frame.h.

◆ DeviceType

enum class esphome::home_io_control::DeviceType : uint8_t
strong

Device type identifiers reported by IO‑Homecontrol products.

The numeric values follow the official specification. Do not reassign or reorder these.

Enumerator
UNKNOWN 

Unknown/unspecified device.

VENETIAN_BLIND 

Venetian blind.

ROLLER_SHUTTER 

Roller shutter.

AWNING 

Awning.

WINDOW_OPENER 

Window opening actuator.

GARAGE_OPENER 

Garage door opener.

LIGHT 

Binary light.

GATE_OPENER 

Gate opener.

ROLLING_DOOR_OPENER 

Rolling door opener.

LOCK 

Lock.

BLIND 

Generic blind.

SCREEN 

Insect/privacy screen.

BEACON 

Beacon (unpaired/announcement).

DUAL_SHUTTER 

Dual-section shutter.

HEATING_TEMPERATURE_INTERFACE 

Heating temperature interface.

ON_OFF_SWITCH 

Generic on/off switch.

HORIZONTAL_AWNING 

Horizontal awning (open/close inverted).

EXTERNAL_VENETIAN_BLIND 

External venetian blind.

LOUVRE_BLIND 

Louvre blind.

CURTAIN_TRACK 

Curtain track.

VENTILATION_POINT 

Ventilation point.

EXTERIOR_HEATING 

Exterior heating.

HEAT_PUMP 

Heat pump.

INTRUSION_ALARM 

Intrusion alarm.

SWINGING_SHUTTER 

Swinging shutter.

Definition at line 269 of file proto_frame.h.

Function Documentation

◆ bytes_to_hex()

void esphome::home_io_control::bytes_to_hex ( const uint8_t * data,
uint8_t len,
char * out,
size_t out_size )
inline

Definition at line 16 of file log_frame.h.

◆ crc_ccitt()

uint16_t esphome::home_io_control::crc_ccitt ( const uint8_t * data,
uint8_t len )

CRC-CCITT used by the IO-Homecontrol protocol for frame validation.

Compute CRC‑CCITT (poly 0x1021, init 0x0000) over a buffer.

Polynomial: 0x1021 (reversed 0x8408), initial value: 0x0000. On SX1276 this is computed in hardware (IoHomeOn mode); on SX1262 it is computed in software by the radio driver.

On SX1276 this is done in hardware; on SX1262 it is computed in software.

Parameters
dataPointer to data bytes.
lenNumber of bytes.
Returns
16‑bit CRC value.

Definition at line 105 of file proto_frame.cpp.

◆ create_challenge_req()

bool esphome::home_io_control::create_challenge_req ( IoFrame & f,
const uint8_t * dst,
const uint8_t * src )

Build a challenge request (0x3C) containing 6 random bytes.

Used when WE need to authenticate an incoming request from a device.

Used when we need to authenticate an incoming request from a device.

Parameters
fIoFrame to populate.
dstTarget device node ID (device we're challenging).
srcController node ID.
Returns
true on success.

Definition at line 137 of file proto_commands.cpp.

Here is the call graph for this function:

◆ create_challenge_resp()

bool esphome::home_io_control::create_challenge_resp ( IoFrame & f,
const uint8_t * dst,
const uint8_t * src,
const uint8_t challenge[HMAC_SIZE],
const IoFrame & origin,
const uint8_t * key )

Build a challenge response (0x3D) proving we know the system key.

The HMAC is computed over [original_command_id + original_data] using the challenge.

HMAC is computed over [original_command_id + original_data] using the challenge.

Parameters
fIoFrame to populate.
dstTarget device node ID.
srcController node ID.
challenge6‑byte challenge from the device.
originOriginal request frame that triggered the challenge.
keySystem key (16 bytes).
Note
The HMAC derivation uses the challenge as IV salt; see create_hmac() in proto_crypto.h for the exact construction. This frame authenticates the controller to the device for the current exchange.
Returns
true on success.

Definition at line 148 of file proto_commands.cpp.

Here is the call graph for this function:

◆ create_discover()

bool esphome::home_io_control::create_discover ( IoFrame & f,
const uint8_t * own )

Build a discovery broadcast (0x28).

Sent to the broadcast address 0x00003B. Only devices in pairing mode (PROG button pressed) will respond.

Sent to the broadcast address; only devices in pairing mode (PROG button pressed) will respond.

Parameters
fIoFrame to populate.
ownController node ID.
Note
Destination is BROADCAST_DISCOVER (0x00003B). The device responds with CMD_DISCOVER_RESP (0x29) containing its node ID and type/subtype. The controller then switches to point‑to‑point communication for phases 2 and 3.
Returns
true on success.

Definition at line 105 of file proto_commands.cpp.

Here is the call graph for this function:

◆ create_execute()

bool esphome::home_io_control::create_execute ( IoFrame & f,
const uint8_t * own,
const uint8_t * dst,
bool low_power,
uint8_t position )

Build an execute command (0x00) to control a device.

Build an execute command (0x00) to control a device (set position or special).

For real positions (0-100), the value is doubled in the frame (0x00=0%, 0xC8=100%). For special commands (stop/favorite), a shorter 6-byte payload is used.

Parameters
fIoFrame to populate.
ownController's 3‑byte node ID (source address).
dstTarget device's 3‑byte node ID (destination address).
low_powerTrue if target is battery/solar‑powered (uses long preamble).
positionDesired position: 0–100 (open→closed), or POS_STOP/POS_FAVORITE.
Note
For solar/battery devices, low_power must be true to use the 1024‑byte preamble required for the receiver to wake up. Mains‑powered devices should use false (8‑byte preamble). See proto_frame.h for LONG_PREAMBLE and SHORT_PREAMBLE.
Returns
true on success; false if position exceeds limits.

Definition at line 45 of file proto_commands.cpp.

Here is the call graph for this function:

◆ create_execute_tilt()

bool esphome::home_io_control::create_execute_tilt ( IoFrame & f,
const uint8_t * own,
const uint8_t * dst,
bool low_power,
uint8_t tilt_percent )

Build a tilt execute command (0x00) for devices that support slat angle control.

Build an execute‑tilt command (0x00) for slat angle control.

Parameters
fIoFrame to populate.
ownController node ID.
dstTarget device node ID.
low_powerTrue for long preamble (battery/solar devices).
tilt_percent0 = fully closed, 100 = fully open.
Note
This uses the same command (0x00) as position control but with a different payload format indicating a tilt operation. The receiver infers tilt from the payload structure. Only devices that advertise tilt support (see device_supports_tilt in proto_frame.h) will honor this.
Returns
true on success.

Definition at line 75 of file proto_commands.cpp.

Here is the call graph for this function:

◆ create_get_status()

bool esphome::home_io_control::create_get_status ( IoFrame & f,
const uint8_t * own,
const uint8_t * dst )

Build a get-status request (0x03). The device responds with its current position.

Build a get‑status request (0x03).

The device responds with its current position.

Parameters
fIoFrame to populate.
ownController's 3‑byte node ID.
dstTarget device's 3‑byte node ID.
Returns
true on success.

Definition at line 64 of file proto_commands.cpp.

Here is the call graph for this function:

◆ create_get_status_tilt()

bool esphome::home_io_control::create_get_status_tilt ( IoFrame & f,
const uint8_t * own,
const uint8_t * dst )

Build a tilt-aware get-status request (0x03) that returns the extended 16-byte tilt payload.

Build a tilt‑aware get‑status request (0x03 with extended payload) that returns the 16‑byte tilt block in the response.

Parameters
fIoFrame to populate.
ownController node ID.
dstTarget device node ID.
Returns
true on success.

Definition at line 94 of file proto_commands.cpp.

Here is the call graph for this function:

◆ create_key_init()

bool esphome::home_io_control::create_key_init ( IoFrame & f,
const uint8_t * own,
const uint8_t * dst )

Build a key-init request (0x31) to start the pairing key exchange with a discovered device.

Build a key‑init request (0x31) to start pairing key exchange with a discovered device.

Parameters
fIoFrame to populate.
ownController node ID.
dstDiscovered device node ID.
Returns
true on success.

Definition at line 114 of file proto_commands.cpp.

Here is the call graph for this function:

◆ create_key_transfer()

bool esphome::home_io_control::create_key_transfer ( IoFrame & f,
IoFrame & old_frame,
const uint8_t * dst,
const uint8_t * src,
const uint8_t key[AES_KEY_SIZE],
const uint8_t challenge[HMAC_SIZE] )

Build a key-transfer frame (0x32) containing the system key encrypted with the transfer key.

Build a key‑transfer frame (0x32) containing the system key encrypted with the transfer key.

Parameters
fIoFrame to populate.
old_frameThe key‑init frame (used to derive the encryption IV).
dstTarget device node ID.
srcController node ID.
keyThe 16‑byte system key to transfer.
challenge6‑byte challenge received from device in its 0x3C response.
Note
The system key is obfuscated via the XOR‑AES construction in crypt_key(). The transfer key (hardcoded in proto_frame.h) is the same for all IO‑Homecontrol devices worldwide; its purpose is to protect the system key in transit during initial pairing. Once transferred, the device uses the system key for all subsequent authenticated exchanges.
Returns
true on success.

Definition at line 122 of file proto_commands.cpp.

Here is the call graph for this function:

◆ create_set_config1()

bool esphome::home_io_control::create_set_config1 ( IoFrame & f,
const uint8_t * own,
const uint8_t * dst )

Build a set-config command (0x6F) to tell the device to automatically send status updates when controlled by any remote (not just us).

Build a set‑config command (0x6F) telling the device to automatically send status updates when controlled by any remote.

Not all devices support this.

Parameters
fIoFrame to populate.
ownController node ID.
dstTarget device node ID.
Note
This configures the device to emit CMD_STATUS_UPDATE (0x71) frames whenever it is controlled by any remote (including the paired controller). This enables HA to receive unsolicited position updates. The controller must still authenticate the status update using the inbound auth flow (hub_exchange.h).
Returns
true on success.

Definition at line 177 of file proto_commands.cpp.

Here is the call graph for this function:

◆ create_status_update_resp()

bool esphome::home_io_control::create_status_update_resp ( IoFrame & f,
const uint8_t * own,
const uint8_t * dst )

Build a status-update acknowledgment (0x72).

Build a status‑update acknowledgment (0x72).

Sent after authenticating a device's status update. The response is sent on all 3 channels to ensure the device receives it.

Sent after authenticating a device's status update; broadcast on all 3 channels for reliability.

Parameters
fIoFrame to populate.
ownController node ID.
dstDevice node ID that sent the update.
Returns
true on success.

Definition at line 166 of file proto_commands.cpp.

Here is the call graph for this function:

◆ decode_packed_device_subtype()

uint8_t esphome::home_io_control::decode_packed_device_subtype ( uint8_t type_subtype)

Decode a protocol-packed device subtype from the second metadata byte.

Parameters
type_subtypeSecond metadata byte containing subtype in bits [5:0].
Returns
Manufacturer-specific subtype.

Definition at line 60 of file proto_frame.cpp.

◆ decode_packed_device_type()

DeviceType esphome::home_io_control::decode_packed_device_type ( uint8_t type_msb,
uint8_t type_subtype )

Decode a protocol-packed device type from two metadata bytes.

Parameters
type_msbFirst metadata byte.
type_subtypeSecond metadata byte containing the remaining type bits and subtype.
Returns
Decoded device type.

Definition at line 55 of file proto_frame.cpp.

◆ decode_position_report()

void esphome::home_io_control::decode_position_report ( uint16_t target_raw,
uint16_t current_raw,
bool is_stopped,
float & target,
float & position )

Decode target/current position values from a status frame.

Parameters
target_raw16‑bit raw target value.
current_raw16‑bit raw current value.
is_stoppedTrue if device reports stopped.
targetOutput target position (0–100 or UNKNOWN_POSITION).
positionOutput current position (0–100 or UNKNOWN_POSITION).

Definition at line 62 of file proto_frame.cpp.

◆ decode_tilt_report()

float esphome::home_io_control::decode_tilt_report ( uint16_t tilt_raw)

Decode tilt angle from raw 16‑bit value.

Parameters
tilt_rawRaw tilt value from status frame.
Returns
Tilt percentage (0 = closed, 100 = open) or UNKNOWN_POSITION.

Definition at line 95 of file proto_frame.cpp.

◆ decode_uart_probe()

uint8_t esphome::home_io_control::decode_uart_probe ( const uint8_t * raw,
uint8_t raw_len,
uint8_t bit_offset,
uint8_t * decoded,
uint8_t decoded_max_len )
static

Decode a raw UART‑encoded bitstream into bytes.

IO‑Homecontrol uses a UART‑like encoding over the air: each byte is represented by a 10‑bit sequence (start bit 0, 8 data bits LSB‑first, stop bit 1). This function slides a window across the raw bitstream and attempts to recover the original bytes. It stops when the sync pattern (0 followed by 1) is not found.

Parameters
rawRaw bytes from the radio buffer.
raw_lenNumber of raw bytes available.
bit_offsetInitial bit position to start decoding (probe offset).
decodedOutput buffer for decoded bytes.
decoded_max_lenCapacity of decoded buffer.
Returns
Number of bytes successfully decoded.

Definition at line 65 of file radio_sx1262.cpp.

Here is the call graph for this function:

◆ default_inverted_for_type()

bool esphome::home_io_control::default_inverted_for_type ( DeviceType type)

Determine whether a device type has inverted position mapping by default.

Parameters
typeDevice type.
Returns
true for horizontal awnings; false otherwise.

Definition at line 53 of file proto_frame.cpp.

◆ device_capability_class()

DeviceCapabilityClass esphome::home_io_control::device_capability_class ( DeviceType type)

Map a raw IO‑Homecontrol type to the closest ESPHome/Home Assistant entity family.

Parameters
typeRaw device type.
Returns
Capability class (COVER, LIGHT, SWITCH, etc.).

Definition at line 268 of file proto_frame.cpp.

◆ device_capability_class_name()

const char * esphome::home_io_control::device_capability_class_name ( DeviceType type)

Get a human‑readable name for a capability class.

Parameters
typeDevice type (unused, kept for signature compatibility).
Returns
String like "cover", "light", "switch", "unknown".

Definition at line 313 of file proto_frame.cpp.

Here is the call graph for this function:

◆ device_operation_profile_name()

const char * esphome::home_io_control::device_operation_profile_name ( DeviceType type)

Human‑readable operation profile name for a device type.

Used for logging and diagnostics.

Parameters
typeDevice type.
Returns
String such as "cover_position", "cover_position_tilt", "binary_on_off", "lock", etc.

Definition at line 360 of file proto_frame.cpp.

Here is the call graph for this function:

◆ device_supports_binary_control()

bool esphome::home_io_control::device_supports_binary_control ( DeviceType type)

Does this device type support binary on/off control?

Parameters
typeDevice type.
Returns
true for lights and switches.

Definition at line 339 of file proto_frame.cpp.

Here is the call graph for this function:

◆ device_supports_position_control()

bool esphome::home_io_control::device_supports_position_control ( DeviceType type)

Does this device type support precise position control (0–100)?

Parameters
typeDevice type.
Returns
true for cover‑family devices.

Definition at line 335 of file proto_frame.cpp.

Here is the call graph for this function:

◆ device_supports_status_requests()

bool esphome::home_io_control::device_supports_status_requests ( DeviceType type)

Does this device type support status request commands (0x03)?

Parameters
typeDevice type.
Returns
true for covers and binary devices.

Definition at line 344 of file proto_frame.cpp.

Here is the call graph for this function:

◆ device_supports_tilt()

bool esphome::home_io_control::device_supports_tilt ( DeviceType type)

Does this device type support tilt (slat angle) control?

Parameters
typeDevice type.
Returns
true for venetian blinds, blinds, external venetian blinds, louvre blinds.

Definition at line 348 of file proto_frame.cpp.

◆ device_type_name()

const char * esphome::home_io_control::device_type_name ( DeviceType type)

Convert a DeviceType to a lowercase string identifier.

Parameters
typeDevice type enum.
Returns
Null‑terminated string name (e.g., "roller_shutter").

Definition at line 211 of file proto_frame.cpp.

◆ find_uart_probe()

UartProbeResult esphome::home_io_control::find_uart_probe ( const uint8_t * raw,
uint8_t raw_len )
static

Search a raw capture for the most plausible IoFrame using UART decoding.

Probes multiple bit offsets and candidate lengths to find a valid parse that looks like a real IO‑Homecontrol frame.

Parameters
rawPointer to raw radio buffer bytes.
raw_lenNumber of bytes in raw.
Returns
UartProbeResult with best candidate (may have valid=false if none found).

Definition at line 148 of file radio_sx1262.cpp.

Here is the call graph for this function:

◆ format_position()

std::string esphome::home_io_control::format_position ( float pos)
inline

Format a position float as a human‑readable string (e.g.

"50%", "unknown").

Parameters
posPosition value (0–100 or UNKNOWN_POSITION).
Returns
String like "50%" or "unknown".

Definition at line 427 of file hub_core.h.

◆ frame_length()

uint8_t esphome::home_io_control::frame_length ( const IoFrame & f)

Get total frame length from ctrl0.

Parameters
fParsed frame.
Returns
Length in bytes.

Definition at line 146 of file proto_frame.cpp.

◆ get_bit_msb()

uint8_t esphome::home_io_control::get_bit_msb ( const uint8_t * data,
uint16_t bit_pos )
static

Extract a single bit (MSB‑first) from a byte buffer.

Used by UART decoding to scan raw radio samples.

Parameters
dataInput byte buffer.
bit_posGlobal bit index within buffer.
Returns
The bit value (0 or 1).

Definition at line 50 of file radio_sx1262.cpp.

◆ has_reached_target_position()

bool esphome::home_io_control::has_reached_target_position ( float target,
float position )

Has the device reached its target within tolerance?

Parameters
targetTarget position (0–100 or UNKNOWN_POSITION).
positionCurrent position (0–100 or UNKNOWN_POSITION).
Returns
true if positions match within STATUS_POS_TOLERANCE_RAW.

Definition at line 88 of file proto_frame.cpp.

◆ hex_nibble()

int esphome::home_io_control::hex_nibble ( char ch)
static

Definition at line 19 of file proto_frame.cpp.

◆ hex_to_bytes()

bool esphome::home_io_control::hex_to_bytes ( const std::string & hex,
uint8_t * out,
uint8_t len )

Convert a hex string (e.g., "123ABC") to a byte array.

Parameters
hexHex string (must be exactly len*2 characters).
outOutput buffer (at least len bytes).
lenNumber of bytes to produce.
Returns
true on success; false if hex length mismatch or non‑hex characters.

Definition at line 28 of file proto_frame.cpp.

Here is the call graph for this function:

◆ init_frame()

void esphome::home_io_control::init_frame ( IoFrame & f,
bool is_2w = true,
bool start = false,
bool end = false,
bool low_power = false )

Initialize an IoFrame header (ctrl0/ctrl1) with flags.

Parameters
fFrame to initialize.
is_2wTrue for 2‑way (default), false for 1‑way.
startSet START flag (first frame in exchange).
endSet END flag (final frame in exchange).
low_powerSet LOW_POWER flag.

Definition at line 115 of file proto_frame.cpp.

◆ is_end()

bool esphome::home_io_control::is_end ( const IoFrame & f)

Check END flag.

Parameters
fParsed frame.
Returns
true if END flag is set.

Definition at line 148 of file proto_frame.cpp.

◆ is_known_io_command()

bool esphome::home_io_control::is_known_io_command ( uint8_t cmd)
static

Check if a command ID is one of the known IO‑Homecontrol commands.

Parameters
cmdCommand byte.
Returns
true if cmd matches a known command constant.

Definition at line 103 of file radio_sx1262.cpp.

◆ is_plausible_uart_frame()

bool esphome::home_io_control::is_plausible_uart_frame ( const IoFrame & frame,
uint8_t candidate_len )
static

Definition at line 134 of file radio_sx1262.cpp.

Here is the call graph for this function:

◆ is_start()

bool esphome::home_io_control::is_start ( const IoFrame & f)

Check START flag.

Parameters
fParsed frame.
Returns
true if START flag is set.

Definition at line 147 of file proto_frame.cpp.

◆ node_id_to_string()

std::string esphome::home_io_control::node_id_to_string ( const uint8_t id[NODE_ID_SIZE])

Format a 3‑byte node ID as a 6‑character uppercase hex string.

Parameters
id3‑byte node ID.
Returns
Hex string (e.g., "123ABC").

Definition at line 47 of file proto_frame.cpp.

◆ parse()

bool esphome::home_io_control::parse ( const uint8_t * buf,
uint8_t buf_len,
IoFrame & f )

Parse a wire buffer into a parsed IoFrame (validates length and CTRL0).

Parameters
bufRaw byte buffer.
buf_lenNumber of bytes in buf.
fOutput parsed frame.
Returns
true if parse succeeded; false otherwise.

Definition at line 177 of file proto_frame.cpp.

Here is the call graph for this function:

◆ serialize()

uint8_t esphome::home_io_control::serialize ( const IoFrame & f,
uint8_t * buf,
uint8_t buf_size )

Serialize a parsed frame into a wire buffer (without CRC).

Parameters
fParsed frame.
bufOutput buffer (must be at least frame_length(f) bytes).
buf_sizeSize of buf.
Returns
Number of bytes written, or 0 on failure.

Definition at line 150 of file proto_frame.cpp.

Here is the call graph for this function:

◆ set_cmd()

bool esphome::home_io_control::set_cmd ( IoFrame & f,
uint8_t cmd,
const uint8_t * params = nullptr,
uint8_t params_len = 0 )

Set command and payload.

Parameters
fFrame to modify.
cmdCommand ID.
paramsPointer to payload bytes (may be nullptr for zero‑length).
params_lenPayload length (0–23).
Returns
true if frame fits within size limits; false otherwise.

Definition at line 130 of file proto_frame.cpp.

◆ set_dst()

void esphome::home_io_control::set_dst ( IoFrame & f,
const uint8_t id[NODE_ID_SIZE] )

Set destination node ID.

Parameters
fFrame to modify.
id3‑byte destination address.

Definition at line 127 of file proto_frame.cpp.

◆ set_src()

void esphome::home_io_control::set_src ( IoFrame & f,
const uint8_t id[NODE_ID_SIZE] )

Set source node ID.

Parameters
fFrame to modify.
id3‑byte source address.

Definition at line 128 of file proto_frame.cpp.

◆ stored_node_id_is_valid()

bool esphome::home_io_control::stored_node_id_is_valid ( const uint8_t id[NODE_ID_SIZE])
inline

Check if a stored node ID is valid (not all-zero, not all-0xFF).

Parameters
id3‑byte node ID buffer.
Returns
true if the ID is non-zero and non-0xFF.

Definition at line 414 of file hub_core.h.

Variable Documentation

◆ AES_BLOCK_SIZE

uint8_t esphome::home_io_control::AES_BLOCK_SIZE = 16
staticconstexpr

AES block size.

Definition at line 84 of file proto_frame.h.

◆ AES_KEY_SIZE

uint8_t esphome::home_io_control::AES_KEY_SIZE = 16
staticconstexpr

AES-128 key size.

Definition at line 83 of file proto_frame.h.

◆ BITS_PER_BYTE

uint8_t esphome::home_io_control::BITS_PER_BYTE = 8
staticconstexpr

Number of bits in one protocol byte.

Definition at line 87 of file proto_frame.h.

◆ BROADCAST_DISCOVER

uint8_t esphome::home_io_control::BROADCAST_DISCOVER[NODE_ID_SIZE] = {0x00, 0x00, 0x3B}
staticconstexpr

Broadcast address for device discovery (0x00003B).

Used as destination in CMD_DISCOVER_REQ frames to trigger all pairable devices to respond.

Definition at line 194 of file proto_frame.h.

◆ CMD_CHALLENGE_REQ

uint8_t esphome::home_io_control::CMD_CHALLENGE_REQ = 0x3C
staticconstexpr

Device sends 6-byte random challenge.

Definition at line 133 of file proto_frame.h.

◆ CMD_CHALLENGE_RESP

uint8_t esphome::home_io_control::CMD_CHALLENGE_RESP = 0x3D
staticconstexpr

Controller responds with HMAC proof.

Definition at line 134 of file proto_frame.h.

◆ CMD_DISCOVER_CONFIRM

uint8_t esphome::home_io_control::CMD_DISCOVER_CONFIRM = 0x2C
staticconstexpr

Confirm discovery to device.

Definition at line 124 of file proto_frame.h.

◆ CMD_DISCOVER_CONFIRM_ACK

uint8_t esphome::home_io_control::CMD_DISCOVER_CONFIRM_ACK = 0x2D
staticconstexpr

Device acknowledges confirmation.

Definition at line 125 of file proto_frame.h.

◆ CMD_DISCOVER_REQ

uint8_t esphome::home_io_control::CMD_DISCOVER_REQ = 0x28
staticconstexpr

Broadcast discovery request.

Definition at line 120 of file proto_frame.h.

◆ CMD_DISCOVER_RESP

uint8_t esphome::home_io_control::CMD_DISCOVER_RESP = 0x29
staticconstexpr

Device responds with its ID and type.

Definition at line 121 of file proto_frame.h.

◆ CMD_DISCOVER_SPE_REQ

uint8_t esphome::home_io_control::CMD_DISCOVER_SPE_REQ = 0x2A
staticconstexpr

Discover sub-devices (e.g., light on garage door).

Definition at line 122 of file proto_frame.h.

◆ CMD_DISCOVER_SPE_RESP

uint8_t esphome::home_io_control::CMD_DISCOVER_SPE_RESP = 0x2B
staticconstexpr

Sub-device response.

Definition at line 123 of file proto_frame.h.

◆ CMD_ERROR_RESP

uint8_t esphome::home_io_control::CMD_ERROR_RESP = 0xFE
staticconstexpr

Error response to any command.

Definition at line 147 of file proto_frame.h.

◆ CMD_EXECUTE

uint8_t esphome::home_io_control::CMD_EXECUTE = 0x00
staticconstexpr

Set position/open/close/stop — requires authentication.

Definition at line 115 of file proto_frame.h.

◆ CMD_GET_INFO2

uint8_t esphome::home_io_control::CMD_GET_INFO2 = 0x56
staticconstexpr

Request device type/model info.

Definition at line 139 of file proto_frame.h.

◆ CMD_GET_INFO2_RESP

uint8_t esphome::home_io_control::CMD_GET_INFO2_RESP = 0x57
staticconstexpr

Device type/model response.

Definition at line 140 of file proto_frame.h.

◆ CMD_GET_NAME

uint8_t esphome::home_io_control::CMD_GET_NAME = 0x50
staticconstexpr

Request device name.

Definition at line 137 of file proto_frame.h.

◆ CMD_GET_NAME_RESP

uint8_t esphome::home_io_control::CMD_GET_NAME_RESP = 0x51
staticconstexpr

Device name response.

Definition at line 138 of file proto_frame.h.

◆ CMD_KEY_CONFIRM

uint8_t esphome::home_io_control::CMD_KEY_CONFIRM = 0x33
staticconstexpr

Device confirms key was received.

Definition at line 130 of file proto_frame.h.

◆ CMD_KEY_INIT

uint8_t esphome::home_io_control::CMD_KEY_INIT = 0x31
staticconstexpr

Initiate key transfer to device.

Definition at line 128 of file proto_frame.h.

◆ CMD_KEY_TRANSFER

uint8_t esphome::home_io_control::CMD_KEY_TRANSFER = 0x32
staticconstexpr

Send encrypted system key to device.

Definition at line 129 of file proto_frame.h.

◆ CMD_PRIVATE

uint8_t esphome::home_io_control::CMD_PRIVATE = 0x03
staticconstexpr

Get device status — no authentication needed.

Definition at line 116 of file proto_frame.h.

◆ CMD_PRIVATE_RESP

uint8_t esphome::home_io_control::CMD_PRIVATE_RESP = 0x04
staticconstexpr

Response to 0x00 and 0x03 (contains position data).

Definition at line 117 of file proto_frame.h.

◆ CMD_SET_CONFIG1

uint8_t esphome::home_io_control::CMD_SET_CONFIG1 = 0x6F
staticconstexpr

Configure device to auto-send status updates.

Definition at line 143 of file proto_frame.h.

◆ CMD_SET_CONFIG1_RESP

uint8_t esphome::home_io_control::CMD_SET_CONFIG1_RESP = 0x70
staticconstexpr

Config response.

Definition at line 144 of file proto_frame.h.

◆ CMD_STATUS_UPDATE

uint8_t esphome::home_io_control::CMD_STATUS_UPDATE = 0x71
staticconstexpr

Device-initiated status update (needs auth).

Definition at line 145 of file proto_frame.h.

◆ CMD_STATUS_UPDATE_RESP

uint8_t esphome::home_io_control::CMD_STATUS_UPDATE_RESP = 0x72
staticconstexpr

Acknowledge status update.

Definition at line 146 of file proto_frame.h.

◆ CRC_LSB_MASK

uint16_t esphome::home_io_control::CRC_LSB_MASK = 0x0001
staticconstexpr

Least-significant-bit mask for reflected CRC update.

Definition at line 190 of file proto_frame.h.

◆ CRC_POLYNOMIAL_REVERSED

uint16_t esphome::home_io_control::CRC_POLYNOMIAL_REVERSED = 0x8408
staticconstexpr

Reversed CRC-CCITT polynomial used by IO-homecontrol.

Definition at line 189 of file proto_frame.h.

◆ CTRL0_END

uint8_t esphome::home_io_control::CTRL0_END = 0x80
staticconstexpr

Control byte 0 (CTRL0) bit definitions.

CTRL0 encodes frame flags and the total frame length. Bits [4:0] = frame_length - 1 (so 0x08 means 9 bytes total).

  • START (bit 6): first frame in an exchange; uses long preamble (1024 bytes).
  • END (bit 7): last frame in an exchange; set on responses and command completions.
  • 1W (bit 5): 1=OneWay protocol (no response expected), 0=TwoWay (response expected). For 2W operation, the controller sets START on initial command and device replies with END; subsequent frames in an authenticated exchange also carry END. Bit 7: last frame in exchange

Definition at line 101 of file proto_frame.h.

◆ CTRL0_LENGTH_MASK

uint8_t esphome::home_io_control::CTRL0_LENGTH_MASK = 0x1F
staticconstexpr

Bits [4:0]: frame length - 1.

Definition at line 104 of file proto_frame.h.

◆ CTRL0_PROTOCOL_1W

uint8_t esphome::home_io_control::CTRL0_PROTOCOL_1W = 0x20
staticconstexpr

Bit 5: 1=OneWay protocol, 0=TwoWay protocol.

Definition at line 103 of file proto_frame.h.

◆ CTRL0_START

uint8_t esphome::home_io_control::CTRL0_START = 0x40
staticconstexpr

Bit 6: first frame in exchange (uses long preamble).

Definition at line 102 of file proto_frame.h.

◆ CTRL1_LOW_POWER

uint8_t esphome::home_io_control::CTRL1_LOW_POWER = 0x20
staticconstexpr

Control byte 1 (CTRL1) bit definitions.

  • LOW_POWER (bit 5): device is battery/solar powered; may sleep and requires long preamble to wake. Bit 5: low-power device (e.g., solar-powered)

Definition at line 108 of file proto_frame.h.

◆ DEFAULT_PA_PIN_PA_BOOST

uint8_t esphome::home_io_control::DEFAULT_PA_PIN_PA_BOOST = 0x80
inlineconstexpr

SX1276 PA_CONFIG selector for the PA_BOOST output path.

Definition at line 44 of file hub_core.h.

◆ DEFAULT_TCXO_VOLTAGE_SETTING_1P8V

uint8_t esphome::home_io_control::DEFAULT_TCXO_VOLTAGE_SETTING_1P8V = 0x03
inlineconstexpr

SX1262 DIO3 setting value for a 1.8 V TCXO.

Definition at line 45 of file hub_core.h.

◆ DEFAULT_TX_POWER_DBM

uint8_t esphome::home_io_control::DEFAULT_TX_POWER_DBM = 17
inlineconstexpr

Default TX power used unless YAML overrides it.

Definition at line 43 of file hub_core.h.

◆ DEVICE_METADATA_SIZE

uint8_t esphome::home_io_control::DEVICE_METADATA_SIZE = 2
staticconstexpr

Packed device metadata uses two bytes where the high 8 bits carry the upper type bits and the low byte carries both the remaining type bits and the 6-bit manufacturer subtype.

Definition at line 175 of file proto_frame.h.

◆ DEVICE_NAME_BUFFER_SIZE

uint8_t esphome::home_io_control::DEVICE_NAME_BUFFER_SIZE = 32
staticconstexpr

Device name storage including null terminator.

Definition at line 368 of file proto_frame.h.

◆ DEVICE_SUBTYPE_MASK

uint8_t esphome::home_io_control::DEVICE_SUBTYPE_MASK = 0x3F
staticconstexpr

Definition at line 178 of file proto_frame.h.

◆ DEVICE_TYPE_HIGH_BITS_SHIFT

uint8_t esphome::home_io_control::DEVICE_TYPE_HIGH_BITS_SHIFT = 6
staticconstexpr

Definition at line 177 of file proto_frame.h.

◆ DEVICE_TYPE_LOW_BITS_SHIFT

uint8_t esphome::home_io_control::DEVICE_TYPE_LOW_BITS_SHIFT = 2
staticconstexpr

Definition at line 176 of file proto_frame.h.

◆ EXCHANGE_RETRY_COUNT

uint8_t esphome::home_io_control::EXCHANGE_RETRY_COUNT = 3
staticconstexpr

Attempts per command before reporting failure.

Definition at line 66 of file proto_frame.h.

◆ EXCHANGE_RETRY_DELAY_MS

int32_t esphome::home_io_control::EXCHANGE_RETRY_DELAY_MS = 250
staticconstexpr

Gap between retries within one HA command.

Definition at line 65 of file proto_frame.h.

◆ FRAME_LOG_HEX_BUFFER_SIZE

size_t esphome::home_io_control::FRAME_LOG_HEX_BUFFER_SIZE = 220
inlineconstexpr

Fits a full 32-byte frame rendered as spaced hex text.

Definition at line 14 of file log_frame.h.

◆ FRAME_MAX_DATA_SIZE

uint8_t esphome::home_io_control::FRAME_MAX_DATA_SIZE = 23
staticconstexpr

Maximum data bytes after command ID.

Definition at line 91 of file proto_frame.h.

◆ FRAME_MAX_SIZE

uint8_t esphome::home_io_control::FRAME_MAX_SIZE = 32
staticconstexpr

Maximum frame size (9 header + 23 data).

Definition at line 90 of file proto_frame.h.

◆ FRAME_MIN_SIZE

uint8_t esphome::home_io_control::FRAME_MIN_SIZE = 9
staticconstexpr

Minimum frame: CTRL0+CTRL1+DST(3)+SRC(3)+CMD(1).

Definition at line 89 of file proto_frame.h.

◆ FREQ_CH1

uint32_t esphome::home_io_control::FREQ_CH1 = 868250000
staticconstexpr

The protocol uses 3 frequency channels in the 868 MHz ISM band.

IO-Homecontrol uses 3 channels in the 868 MHz SRD band. In 1W (one-way) mode, only CH2 is used. In 2W (two-way) mode, the controller hops across all three channels every ~2.7ms when idle. Commands are sent on CH2; responses may arrive on any channel within the exchange wait window. Channel 1: 868.25 MHz (2W only)

Definition at line 30 of file proto_frame.h.

◆ FREQ_CH2

uint32_t esphome::home_io_control::FREQ_CH2 = 868950000
staticconstexpr

Channel 2: 868.95 MHz (1W and 2W, TX channel).

Definition at line 31 of file proto_frame.h.

◆ FREQ_CH3

uint32_t esphome::home_io_control::FREQ_CH3 = 869850000
staticconstexpr

Channel 3: 869.85 MHz (2W only).

Definition at line 32 of file proto_frame.h.

◆ FXOSC

uint32_t esphome::home_io_control::FXOSC = 32000000U
staticconstexpr

SX1276 crystal oscillator frequency (32 MHz).

Used to calculate register values for bitrate, frequency deviation, and carrier frequency.

Definition at line 65 of file radio_sx1276.h.

◆ HMAC_SIZE

uint8_t esphome::home_io_control::HMAC_SIZE = 6
staticconstexpr

Authentication HMAC is 6 bytes (truncated AES output).

Definition at line 82 of file proto_frame.h.

◆ HOP_TIME_US

int32_t esphome::home_io_control::HOP_TIME_US = 2700
staticconstexpr

Timing constants for frequency hopping and response waiting.

Time per channel when hopping (2.7ms)

Definition at line 59 of file proto_frame.h.

◆ IV_PADDING

uint8_t esphome::home_io_control::IV_PADDING = 0x55
staticconstexpr

Padding byte used in IV construction.

Definition at line 86 of file proto_frame.h.

◆ IV_SIZE

uint8_t esphome::home_io_control::IV_SIZE = 16
staticconstexpr

Initialization vector size for AES.

Definition at line 85 of file proto_frame.h.

◆ LBT_MAX_RETRIES

uint8_t esphome::home_io_control::LBT_MAX_RETRIES = 5
staticconstexpr

Max carrier-sense attempts before TX anyway.

Definition at line 73 of file proto_frame.h.

◆ LBT_RETRY_DELAY_MS

uint8_t esphome::home_io_control::LBT_RETRY_DELAY_MS = 5
staticconstexpr

Backoff between LBT checks (≥ 5ms per ETSI).

Definition at line 74 of file proto_frame.h.

◆ LBT_RSSI_THRESHOLD_DBM

int16_t esphome::home_io_control::LBT_RSSI_THRESHOLD_DBM = -90
staticconstexpr

Listen-before-talk (LBT) parameters for ETSI EN 300 220 compliance.

Before transmitting, the radio checks that the channel RSSI is below the threshold. If the channel is busy, TX is deferred by LBT_RETRY_DELAY_MS up to LBT_MAX_RETRIES times. Channel-free threshold (ETSI: ≤ -90 dBm)

Definition at line 72 of file proto_frame.h.

◆ LONG_PREAMBLE

uint16_t esphome::home_io_control::LONG_PREAMBLE = 1024
staticconstexpr

Preamble is a sequence of 0xAA bytes that precedes every frame.

The first frame in an exchange uses a long preamble (1024 bytes = 8192 bits) so the receiver has time to detect it while hopping. Subsequent frames in the same exchange use a short preamble (8 bytes) since both sides are already on the same channel. Solar-powered devices need the long preamble to wake up. 1024 bytes for initial/start frames

Definition at line 39 of file proto_frame.h.

◆ MODE_MASK

uint8_t esphome::home_io_control::MODE_MASK = 0x07
staticconstexpr

Definition at line 61 of file radio_sx1276.h.

◆ MODE_RX

uint8_t esphome::home_io_control::MODE_RX = 0x05
staticconstexpr

Definition at line 60 of file radio_sx1276.h.

◆ MODE_SLEEP

uint8_t esphome::home_io_control::MODE_SLEEP = 0x00
staticconstexpr

Definition at line 57 of file radio_sx1276.h.

◆ MODE_STDBY

uint8_t esphome::home_io_control::MODE_STDBY = 0x01
staticconstexpr

Definition at line 58 of file radio_sx1276.h.

◆ MODE_TX

uint8_t esphome::home_io_control::MODE_TX = 0x03
staticconstexpr

Definition at line 59 of file radio_sx1276.h.

◆ NODE_ID_SIZE

uint8_t esphome::home_io_control::NODE_ID_SIZE = 3
staticconstexpr

Device/node addresses are 3 bytes (e.g., "123ABC").

Definition at line 80 of file proto_frame.h.

◆ NODE_ID_STRING_SIZE

uint8_t esphome::home_io_control::NODE_ID_STRING_SIZE = NODE_ID_SIZE * 2 + 1
staticconstexpr

Uppercase hex node ID plus null terminator.

Definition at line 81 of file proto_frame.h.

◆ POS_FAVORITE

uint8_t esphome::home_io_control::POS_FAVORITE = 0xD8
staticconstexpr

Move to favorite/"My" position.

Definition at line 158 of file proto_frame.h.

◆ POS_STOP

uint8_t esphome::home_io_control::POS_STOP = 0xD2
staticconstexpr

Position values in the IO protocol.

Normal positions are 0-100 (0=fully open, 100=fully closed). Special values above 100 are control commands. Stop movement

Definition at line 156 of file proto_frame.h.

◆ POS_UNKNOWN

uint8_t esphome::home_io_control::POS_UNKNOWN = 0xD4
staticconstexpr

Position unknown.

Definition at line 157 of file proto_frame.h.

◆ POSITION_TEXT_BUFFER_SIZE

size_t esphome::home_io_control::POSITION_TEXT_BUFFER_SIZE = 16
inlineconstexpr

Buffer for formatted position strings such as "100%".

Definition at line 46 of file hub_core.h.

◆ RADIO_PACKET_BUFFER_SIZE

uint8_t esphome::home_io_control::RADIO_PACKET_BUFFER_SIZE
inlineconstexpr
Initial value:
=
64

Scratch buffer size for raw radio packets and recovered frames.

Definition at line 19 of file radio_interface.h.

◆ REG_AFC_FEI

uint8_t esphome::home_io_control::REG_AFC_FEI = 0x1A
staticconstexpr

AFC auto clear.

Definition at line 36 of file radio_sx1276.h.

◆ REG_BITRATE_LSB

uint8_t esphome::home_io_control::REG_BITRATE_LSB = 0x03
staticconstexpr

Definition at line 24 of file radio_sx1276.h.

◆ REG_BITRATE_MSB

uint8_t esphome::home_io_control::REG_BITRATE_MSB = 0x02
staticconstexpr

Bit rate MSB = FXOSC / bitrate.

Definition at line 23 of file radio_sx1276.h.

◆ REG_DIO_MAPPING1

uint8_t esphome::home_io_control::REG_DIO_MAPPING1 = 0x40
staticconstexpr

DIO0-DIO3 pin mapping.

Definition at line 50 of file radio_sx1276.h.

◆ REG_DIO_MAPPING2

uint8_t esphome::home_io_control::REG_DIO_MAPPING2 = 0x41
staticconstexpr

DIO4-DIO5 pin mapping.

Definition at line 51 of file radio_sx1276.h.

◆ REG_FDEV_LSB

uint8_t esphome::home_io_control::REG_FDEV_LSB = 0x05
staticconstexpr

Definition at line 26 of file radio_sx1276.h.

◆ REG_FDEV_MSB

uint8_t esphome::home_io_control::REG_FDEV_MSB = 0x04
staticconstexpr

Frequency deviation MSB.

Definition at line 25 of file radio_sx1276.h.

◆ REG_FIFO

uint8_t esphome::home_io_control::REG_FIFO = 0x00
staticconstexpr

FIFO read/write access.

Definition at line 21 of file radio_sx1276.h.

◆ REG_FIFO_THRESH

uint8_t esphome::home_io_control::REG_FIFO_THRESH = 0x35
staticconstexpr

FIFO threshold for TX start condition.

Definition at line 47 of file radio_sx1276.h.

◆ REG_FRF_LSB

uint8_t esphome::home_io_control::REG_FRF_LSB = 0x08
staticconstexpr

Definition at line 29 of file radio_sx1276.h.

◆ REG_FRF_MID

uint8_t esphome::home_io_control::REG_FRF_MID = 0x07
staticconstexpr

Definition at line 28 of file radio_sx1276.h.

◆ REG_FRF_MSB

uint8_t esphome::home_io_control::REG_FRF_MSB = 0x06
staticconstexpr

Carrier frequency MSB (freq = FRF * FXOSC / 2^19).

Definition at line 27 of file radio_sx1276.h.

◆ REG_IMAGE_CAL

uint8_t esphome::home_io_control::REG_IMAGE_CAL = 0x3B
staticconstexpr

Image calibration.

Definition at line 54 of file radio_sx1276.h.

◆ REG_IRQ_FLAGS1

uint8_t esphome::home_io_control::REG_IRQ_FLAGS1 = 0x3E
staticconstexpr

IRQ flags: mode ready, preamble detect, etc.

Definition at line 48 of file radio_sx1276.h.

◆ REG_IRQ_FLAGS2

uint8_t esphome::home_io_control::REG_IRQ_FLAGS2 = 0x3F
staticconstexpr

IRQ flags: FIFO full/empty, payload ready, CRC ok.

Definition at line 49 of file radio_sx1276.h.

◆ REG_LNA

uint8_t esphome::home_io_control::REG_LNA = 0x0C
staticconstexpr

Low noise amplifier gain and boost.

Definition at line 32 of file radio_sx1276.h.

◆ REG_OP_MODE

uint8_t esphome::home_io_control::REG_OP_MODE = 0x01
staticconstexpr

Operating mode (sleep/standby/tx/rx).

Definition at line 22 of file radio_sx1276.h.

◆ REG_OSC

uint8_t esphome::home_io_control::REG_OSC = 0x24
staticconstexpr

Oscillator / clock output.

Definition at line 38 of file radio_sx1276.h.

◆ REG_PA_CONFIG

uint8_t esphome::home_io_control::REG_PA_CONFIG = 0x09
staticconstexpr

Power amplifier config (pin select + power level).

Definition at line 30 of file radio_sx1276.h.

◆ REG_PA_RAMP

uint8_t esphome::home_io_control::REG_PA_RAMP = 0x0A
staticconstexpr

PA ramp time and modulation shaping.

Definition at line 31 of file radio_sx1276.h.

◆ REG_PACKET_CONFIG1

uint8_t esphome::home_io_control::REG_PACKET_CONFIG1 = 0x30
staticconstexpr

Packet format, CRC, encoding.

Definition at line 44 of file radio_sx1276.h.

◆ REG_PACKET_CONFIG2

uint8_t esphome::home_io_control::REG_PACKET_CONFIG2 = 0x31
staticconstexpr

Packet mode, IoHomeOn, PowerFrame.

Definition at line 45 of file radio_sx1276.h.

◆ REG_PAYLOAD_LENGTH

uint8_t esphome::home_io_control::REG_PAYLOAD_LENGTH = 0x32
staticconstexpr

Max payload length.

Definition at line 46 of file radio_sx1276.h.

◆ REG_PLLHOP

uint8_t esphome::home_io_control::REG_PLLHOP = 0x44
staticconstexpr

PLL hop: fast frequency change without standby.

Definition at line 53 of file radio_sx1276.h.

◆ REG_PREAMBLE_DETECT

uint8_t esphome::home_io_control::REG_PREAMBLE_DETECT = 0x1F
staticconstexpr

Preamble detector config.

Definition at line 37 of file radio_sx1276.h.

◆ REG_PREAMBLE_LSB

uint8_t esphome::home_io_control::REG_PREAMBLE_LSB = 0x26
staticconstexpr

Definition at line 41 of file radio_sx1276.h.

◆ REG_PREAMBLE_MSB

uint8_t esphome::home_io_control::REG_PREAMBLE_MSB = 0x25
staticconstexpr

TX preamble length MSB.

Definition at line 40 of file radio_sx1276.h.

◆ REG_RSSI_CONFIG

uint8_t esphome::home_io_control::REG_RSSI_CONFIG = 0x0E
staticconstexpr

RSSI smoothing.

Definition at line 34 of file radio_sx1276.h.

◆ REG_RSSI_VALUE

uint8_t esphome::home_io_control::REG_RSSI_VALUE = 0x11
staticconstexpr

Instant RSSI value in FSK mode.

Definition at line 39 of file radio_sx1276.h.

◆ REG_RX_BW

uint8_t esphome::home_io_control::REG_RX_BW = 0x12
staticconstexpr

Receiver bandwidth.

Definition at line 35 of file radio_sx1276.h.

◆ REG_RX_CONFIG

uint8_t esphome::home_io_control::REG_RX_CONFIG = 0x0D
staticconstexpr

Receiver configuration (AFC, AGC, trigger).

Definition at line 33 of file radio_sx1276.h.

◆ REG_SYNC_CONFIG

uint8_t esphome::home_io_control::REG_SYNC_CONFIG = 0x27
staticconstexpr

Sync word config (size, polarity, enable).

Definition at line 42 of file radio_sx1276.h.

◆ REG_SYNC_VALUE1

uint8_t esphome::home_io_control::REG_SYNC_VALUE1 = 0x28
staticconstexpr

Sync word byte 1 (registers 0x28-0x2F for bytes 1-8).

Definition at line 43 of file radio_sx1276.h.

◆ REG_VERSION

uint8_t esphome::home_io_control::REG_VERSION = 0x42
staticconstexpr

Chip version (should read 0x12 for SX1276).

Definition at line 52 of file radio_sx1276.h.

◆ RESPONSE_AUTH_WAIT_MS

int32_t esphome::home_io_control::RESPONSE_AUTH_WAIT_MS
staticconstexpr
Initial value:
=
static constexpr int32_t RESPONSE_WAIT_MS
Wait for response to non-start frame.
Definition proto_frame.h:61

Wait for final response after challenge response.

Definition at line 63 of file proto_frame.h.

◆ RESPONSE_CHANNEL_WAIT_MS

int32_t esphome::home_io_control::RESPONSE_CHANNEL_WAIT_MS = 50
staticconstexpr

Per-channel dwell while waiting for an exchange response.

Definition at line 60 of file proto_frame.h.

◆ RESPONSE_START_WAIT_MS

int32_t esphome::home_io_control::RESPONSE_START_WAIT_MS = 300
staticconstexpr

Wait for response to start frame (longer).

Definition at line 62 of file proto_frame.h.

◆ RESPONSE_WAIT_MS

int32_t esphome::home_io_control::RESPONSE_WAIT_MS = 500
staticconstexpr

Wait for response to non-start frame.

Definition at line 61 of file proto_frame.h.

◆ SHORT_PREAMBLE

uint16_t esphome::home_io_control::SHORT_PREAMBLE = 8
staticconstexpr

8 bytes for response/continuation frames

Definition at line 40 of file proto_frame.h.

◆ STATUS_EXPECTED

uint8_t esphome::home_io_control::STATUS_EXPECTED = 0x80
staticconstexpr

Byte 1 bit 7: device will send auto status update.

Definition at line 170 of file proto_frame.h.

◆ STATUS_POS_MAX

uint16_t esphome::home_io_control::STATUS_POS_MAX = 0xC800
staticconstexpr

In status responses, position is encoded as a 16-bit value where 0x0000 = fully open (0%) and 0xC800 = fully closed (100%).

Definition at line 162 of file proto_frame.h.

◆ STATUS_POS_TOLERANCE_RAW

uint16_t esphome::home_io_control::STATUS_POS_TOLERANCE_RAW = 100
staticconstexpr

Target-reached tolerance expressed in raw IO-homecontrol position units.

100 raw units out of 51200 full-scale is about 0.195%, so this only absorbs tiny target/current mismatches from device rounding or early stopped flags.

Definition at line 166 of file proto_frame.h.

◆ STATUS_STOPPED

uint8_t esphome::home_io_control::STATUS_STOPPED = 0x01
staticconstexpr

Status byte flags in CMD_PRIVATE_RESP and CMD_STATUS_UPDATE.

Byte 0 bit 0: device is not moving

Definition at line 169 of file proto_frame.h.

◆ STATUS_TILT_SELECTOR

uint8_t esphome::home_io_control::STATUS_TILT_SELECTOR = 0x20
staticconstexpr

Extended status payload marker for tilt-capable devices.

Definition at line 171 of file proto_frame.h.

◆ SX1262_AUTH_RESPONSE_PREAMBLE

uint16_t esphome::home_io_control::SX1262_AUTH_RESPONSE_PREAMBLE = 64
staticconstexpr

SX1262-specific preamble for the outbound 0x3D challenge response.

The SX1262 path has to rebuild the IO-homecontrol framing details in software and the 0x3D auth response is sent immediately after we switch from RX to TX upon receiving the device's 0x3C challenge. Real-device tuning showed that 64 preamble bytes gives the peer enough lock-on margin in that tight turn-around window, while leaving the proven SX1276 short-response waveform untouched.

Definition at line 48 of file proto_frame.h.

◆ SX1262_CALIBRATE

uint8_t esphome::home_io_control::SX1262_CALIBRATE = 0x89
staticconstexpr

Definition at line 42 of file radio_sx1262.h.

◆ SX1262_CALIBRATE_IMAGE

uint8_t esphome::home_io_control::SX1262_CALIBRATE_IMAGE = 0x98
staticconstexpr

Definition at line 43 of file radio_sx1262.h.

◆ SX1262_CLEAR_DEVICE_ERRORS

uint8_t esphome::home_io_control::SX1262_CLEAR_DEVICE_ERRORS = 0x07
staticconstexpr

Definition at line 33 of file radio_sx1262.h.

◆ SX1262_CLEAR_IRQ_STATUS

uint8_t esphome::home_io_control::SX1262_CLEAR_IRQ_STATUS = 0x02
staticconstexpr

Definition at line 32 of file radio_sx1262.h.

◆ SX1262_EXCHANGE_RESPONSE_WAIT_SLICE_MS

int32_t esphome::home_io_control::SX1262_EXCHANGE_RESPONSE_WAIT_SLICE_MS = 90
staticconstexpr

SX1262-specific per-channel dwell while waiting for authenticated exchange responses.

A 50 ms dwell was short enough that the controller could hop away from the request channel just before the device emitted its post-auth reply. Using 90 ms keeps the SX1262 receiver on that channel long enough for the observed device turn-around after 0x3D, without inflating the overall 300/500 ms exchange windows for the rest of the protocol.

Definition at line 56 of file proto_frame.h.

◆ SX1262_FALLBACK_STDBY_XOSC

uint8_t esphome::home_io_control::SX1262_FALLBACK_STDBY_XOSC = 0x30
staticconstexpr

Definition at line 68 of file radio_sx1262.h.

◆ SX1262_GET_DEVICE_ERRORS

uint8_t esphome::home_io_control::SX1262_GET_DEVICE_ERRORS = 0x17
staticconstexpr

Definition at line 31 of file radio_sx1262.h.

◆ SX1262_GET_IRQ_STATUS

uint8_t esphome::home_io_control::SX1262_GET_IRQ_STATUS = 0x12
staticconstexpr

Definition at line 29 of file radio_sx1262.h.

◆ SX1262_GET_PACKET_STATUS

uint8_t esphome::home_io_control::SX1262_GET_PACKET_STATUS = 0x14
staticconstexpr

Definition at line 30 of file radio_sx1262.h.

◆ SX1262_GET_RSSI_INST

uint8_t esphome::home_io_control::SX1262_GET_RSSI_INST = 0x15
staticconstexpr

Definition at line 45 of file radio_sx1262.h.

◆ SX1262_GET_RX_BUFFER_STATUS

uint8_t esphome::home_io_control::SX1262_GET_RX_BUFFER_STATUS = 0x13
staticconstexpr

Definition at line 44 of file radio_sx1262.h.

◆ SX1262_GET_STATUS

uint8_t esphome::home_io_control::SX1262_GET_STATUS = 0xC0
staticconstexpr

Definition at line 47 of file radio_sx1262.h.

◆ SX1262_GFSK_CRC_OFF

uint8_t esphome::home_io_control::SX1262_GFSK_CRC_OFF = 0x01
staticconstexpr

Definition at line 67 of file radio_sx1262.h.

◆ SX1262_GFSK_PACKET_TYPE_KNOWN_LENGTH

uint8_t esphome::home_io_control::SX1262_GFSK_PACKET_TYPE_KNOWN_LENGTH = 0x00
staticconstexpr

Definition at line 66 of file radio_sx1262.h.

◆ SX1262_IRQ_CRC_ERR

uint16_t esphome::home_io_control::SX1262_IRQ_CRC_ERR = 0x0040
staticconstexpr

Definition at line 60 of file radio_sx1262.h.

◆ SX1262_IRQ_RX_DONE

uint16_t esphome::home_io_control::SX1262_IRQ_RX_DONE = 0x0002
staticconstexpr

Definition at line 58 of file radio_sx1262.h.

◆ SX1262_IRQ_SYNC_WORD_VALID

uint16_t esphome::home_io_control::SX1262_IRQ_SYNC_WORD_VALID = 0x0008
staticconstexpr

Definition at line 59 of file radio_sx1262.h.

◆ SX1262_IRQ_TX_DONE

uint16_t esphome::home_io_control::SX1262_IRQ_TX_DONE = 0x0001
staticconstexpr

Definition at line 57 of file radio_sx1262.h.

◆ SX1262_READ_BUFFER

uint8_t esphome::home_io_control::SX1262_READ_BUFFER = 0x1E
staticconstexpr

Definition at line 27 of file radio_sx1262.h.

◆ SX1262_READ_REGISTER

uint8_t esphome::home_io_control::SX1262_READ_REGISTER = 0x1D
staticconstexpr

Definition at line 51 of file radio_sx1262.h.

◆ SX1262_REG_RX_GAIN

uint16_t esphome::home_io_control::SX1262_REG_RX_GAIN = 0x08AC
staticconstexpr

Definition at line 63 of file radio_sx1262.h.

◆ SX1262_REG_SYNC_WORD

uint16_t esphome::home_io_control::SX1262_REG_SYNC_WORD = 0x06C0
staticconstexpr

Definition at line 62 of file radio_sx1262.h.

◆ SX1262_REG_TX_CLAMP_CONFIG

uint16_t esphome::home_io_control::SX1262_REG_TX_CLAMP_CONFIG = 0x08D8
staticconstexpr

Definition at line 64 of file radio_sx1262.h.

◆ SX1262_RX_PROBE_PACKET_LEN

const uint8_t esphome::home_io_control::SX1262_RX_PROBE_PACKET_LEN = 32
static

Definition at line 39 of file radio_sx1262.cpp.

◆ SX1262_SET_BUFFER_BASE_ADDRESS

uint8_t esphome::home_io_control::SX1262_SET_BUFFER_BASE_ADDRESS = 0x8F
staticconstexpr

Definition at line 37 of file radio_sx1262.h.

◆ SX1262_SET_DIO2_AS_RF_SWITCH_CTRL

uint8_t esphome::home_io_control::SX1262_SET_DIO2_AS_RF_SWITCH_CTRL = 0x9D
staticconstexpr

Definition at line 40 of file radio_sx1262.h.

◆ SX1262_SET_DIO3_AS_TCXO_CTRL

uint8_t esphome::home_io_control::SX1262_SET_DIO3_AS_TCXO_CTRL = 0x97
staticconstexpr

Definition at line 41 of file radio_sx1262.h.

◆ SX1262_SET_DIO_IRQ_PARAMS

uint8_t esphome::home_io_control::SX1262_SET_DIO_IRQ_PARAMS = 0x08
staticconstexpr

Definition at line 28 of file radio_sx1262.h.

◆ SX1262_SET_MODULATION_PARAMS

uint8_t esphome::home_io_control::SX1262_SET_MODULATION_PARAMS = 0x8B
staticconstexpr

Definition at line 35 of file radio_sx1262.h.

◆ SX1262_SET_PA_CONFIG

uint8_t esphome::home_io_control::SX1262_SET_PA_CONFIG = 0x95
staticconstexpr

Definition at line 38 of file radio_sx1262.h.

◆ SX1262_SET_PACKET_PARAMS

uint8_t esphome::home_io_control::SX1262_SET_PACKET_PARAMS = 0x8C
staticconstexpr

Definition at line 36 of file radio_sx1262.h.

◆ SX1262_SET_PACKET_TYPE

uint8_t esphome::home_io_control::SX1262_SET_PACKET_TYPE = 0x8A
staticconstexpr

Definition at line 34 of file radio_sx1262.h.

◆ SX1262_SET_REGULATOR_MODE

uint8_t esphome::home_io_control::SX1262_SET_REGULATOR_MODE = 0x96
staticconstexpr

Definition at line 46 of file radio_sx1262.h.

◆ SX1262_SET_RF_FREQUENCY

uint8_t esphome::home_io_control::SX1262_SET_RF_FREQUENCY = 0x86
staticconstexpr

Definition at line 24 of file radio_sx1262.h.

◆ SX1262_SET_RX

uint8_t esphome::home_io_control::SX1262_SET_RX = 0x82
staticconstexpr

Definition at line 22 of file radio_sx1262.h.

◆ SX1262_SET_RX_TX_FALLBACK_MODE

uint8_t esphome::home_io_control::SX1262_SET_RX_TX_FALLBACK_MODE = 0x93
staticconstexpr

Definition at line 25 of file radio_sx1262.h.

◆ SX1262_SET_STANDBY

uint8_t esphome::home_io_control::SX1262_SET_STANDBY = 0x80
staticconstexpr

Definition at line 21 of file radio_sx1262.h.

◆ SX1262_SET_TX

uint8_t esphome::home_io_control::SX1262_SET_TX = 0x83
staticconstexpr

Definition at line 23 of file radio_sx1262.h.

◆ SX1262_SET_TX_PARAMS

uint8_t esphome::home_io_control::SX1262_SET_TX_PARAMS = 0x8E
staticconstexpr

Definition at line 39 of file radio_sx1262.h.

◆ SX1262_SYNC_WORD_PARAM_24_BITS

const uint8_t esphome::home_io_control::SX1262_SYNC_WORD_PARAM_24_BITS = 0x18
static

Definition at line 35 of file radio_sx1262.cpp.

◆ SX1262_WRITE_BUFFER

uint8_t esphome::home_io_control::SX1262_WRITE_BUFFER = 0x0E
staticconstexpr

Definition at line 26 of file radio_sx1262.h.

◆ SX1262_WRITE_REGISTER

uint8_t esphome::home_io_control::SX1262_WRITE_REGISTER = 0x0D
staticconstexpr

Definition at line 50 of file radio_sx1262.h.

◆ TAG [1/7]

const char* const esphome::home_io_control::TAG = detail::TAG
static

Definition at line 34 of file hub_core.cpp.

◆ TAG [2/7]

const char* const esphome::home_io_control::TAG = "home_io_control.exchange"
static

Definition at line 16 of file hub_exchange.cpp.

◆ TAG [3/7]

const char* const esphome::home_io_control::TAG = "home_io_control.cover"
static

Definition at line 11 of file platform_cover.cpp.

◆ TAG [4/7]

const char* const esphome::home_io_control::TAG = "home_io_control.light"
static

Definition at line 11 of file platform_light.cpp.

◆ TAG [5/7]

const char* const esphome::home_io_control::TAG = "home_io_control.switch"
static

Definition at line 11 of file platform_switch.cpp.

◆ TAG [6/7]

const char* const esphome::home_io_control::TAG = "home_io_control.sx1262"
static

Definition at line 34 of file radio_sx1262.cpp.

◆ TAG [7/7]

const char* const esphome::home_io_control::TAG = "home_io_control.sx1276"
static

Definition at line 17 of file radio_sx1276.cpp.

◆ TRANSFER_KEY

uint8_t esphome::home_io_control::TRANSFER_KEY[AES_KEY_SIZE]
staticconstexpr
Initial value:
= {0x34, 0xC3, 0x46, 0x6E, 0xD8, 0x8F, 0x4E, 0x8E,
0x16, 0xAA, 0x47, 0x39, 0x49, 0x88, 0x43, 0x73}

The transfer key is a hardcoded key used ONLY during pairing to obfuscate the system key during over-the-air transfer.

It is NOT the system key. This is the same across all IO-Homecontrol devices worldwide.

Definition at line 187 of file proto_frame.h.

◆ UART_PROBE_MAX_BIT_OFFSET

const uint8_t esphome::home_io_control::UART_PROBE_MAX_BIT_OFFSET = 10
static

Maximum bit offset to search for valid UART decode start position.

The UART frame is 10 bits (start + 8 data). If the sync word is not aligned, we probe up to 10 bits offset to recover the correct framing.

Definition at line 43 of file radio_sx1262.cpp.

◆ UNKNOWN_POSITION

float esphome::home_io_control::UNKNOWN_POSITION = 212.0F
staticconstexpr

Sentinel value meaning "position is not known yet".

Matches POS_UNKNOWN (0xD4 = 212 decimal) for easy debugging.

Definition at line 367 of file proto_frame.h.