|
Home IO Control
ESPHome add-on for IO-Homecontrol devices
|
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). | |
| 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.
|
strong |
High‑level capability class derived from DeviceType.
Definition at line 298 of file proto_frame.h.
|
strong |
Device type identifiers reported by IO‑Homecontrol products.
The numeric values follow the official specification. Do not reassign or reorder these.
Definition at line 269 of file proto_frame.h.
|
inline |
Definition at line 16 of file log_frame.h.
| 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.
| data | Pointer to data bytes. |
| len | Number of bytes. |
Definition at line 105 of file proto_frame.cpp.
| 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.
| f | IoFrame to populate. |
| dst | Target device node ID (device we're challenging). |
| src | Controller node ID. |
Definition at line 137 of file proto_commands.cpp.
| 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.
| f | IoFrame to populate. |
| dst | Target device node ID. |
| src | Controller node ID. |
| challenge | 6‑byte challenge from the device. |
| origin | Original request frame that triggered the challenge. |
| key | System key (16 bytes). |
Definition at line 148 of file proto_commands.cpp.
| 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.
| f | IoFrame to populate. |
| own | Controller node ID. |
Definition at line 105 of file proto_commands.cpp.
| 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.
| f | IoFrame to populate. |
| own | Controller's 3‑byte node ID (source address). |
| dst | Target device's 3‑byte node ID (destination address). |
| low_power | True if target is battery/solar‑powered (uses long preamble). |
| position | Desired position: 0–100 (open→closed), or POS_STOP/POS_FAVORITE. |
Definition at line 45 of file proto_commands.cpp.
| 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.
| f | IoFrame to populate. |
| own | Controller node ID. |
| dst | Target device node ID. |
| low_power | True for long preamble (battery/solar devices). |
| tilt_percent | 0 = fully closed, 100 = fully open. |
Definition at line 75 of file proto_commands.cpp.
| 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.
| f | IoFrame to populate. |
| own | Controller's 3‑byte node ID. |
| dst | Target device's 3‑byte node ID. |
Definition at line 64 of file proto_commands.cpp.
| 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.
| f | IoFrame to populate. |
| own | Controller node ID. |
| dst | Target device node ID. |
Definition at line 94 of file proto_commands.cpp.
| 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.
| f | IoFrame to populate. |
| own | Controller node ID. |
| dst | Discovered device node ID. |
Definition at line 114 of file proto_commands.cpp.
| 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.
| f | IoFrame to populate. |
| old_frame | The key‑init frame (used to derive the encryption IV). |
| dst | Target device node ID. |
| src | Controller node ID. |
| key | The 16‑byte system key to transfer. |
| challenge | 6‑byte challenge received from device in its 0x3C response. |
Definition at line 122 of file proto_commands.cpp.
| 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.
| f | IoFrame to populate. |
| own | Controller node ID. |
| dst | Target device node ID. |
Definition at line 177 of file proto_commands.cpp.
| 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.
| f | IoFrame to populate. |
| own | Controller node ID. |
| dst | Device node ID that sent the update. |
Definition at line 166 of file proto_commands.cpp.
| 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.
| type_subtype | Second metadata byte containing subtype in bits [5:0]. |
Definition at line 60 of file proto_frame.cpp.
| 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.
| type_msb | First metadata byte. |
| type_subtype | Second metadata byte containing the remaining type bits and subtype. |
Definition at line 55 of file proto_frame.cpp.
| 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.
| target_raw | 16‑bit raw target value. |
| current_raw | 16‑bit raw current value. |
| is_stopped | True if device reports stopped. |
| target | Output target position (0–100 or UNKNOWN_POSITION). |
| position | Output current position (0–100 or UNKNOWN_POSITION). |
Definition at line 62 of file proto_frame.cpp.
| float esphome::home_io_control::decode_tilt_report | ( | uint16_t | tilt_raw | ) |
Decode tilt angle from raw 16‑bit value.
| tilt_raw | Raw tilt value from status frame. |
Definition at line 95 of file proto_frame.cpp.
|
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.
| raw | Raw bytes from the radio buffer. |
| raw_len | Number of raw bytes available. |
| bit_offset | Initial bit position to start decoding (probe offset). |
| decoded | Output buffer for decoded bytes. |
| decoded_max_len | Capacity of decoded buffer. |
Definition at line 65 of file radio_sx1262.cpp.
| bool esphome::home_io_control::default_inverted_for_type | ( | DeviceType | type | ) |
Determine whether a device type has inverted position mapping by default.
| type | Device type. |
Definition at line 53 of file proto_frame.cpp.
| DeviceCapabilityClass esphome::home_io_control::device_capability_class | ( | DeviceType | type | ) |
Map a raw IO‑Homecontrol type to the closest ESPHome/Home Assistant entity family.
| type | Raw device type. |
Definition at line 268 of file proto_frame.cpp.
| const char * esphome::home_io_control::device_capability_class_name | ( | DeviceType | type | ) |
Get a human‑readable name for a capability class.
| type | Device type (unused, kept for signature compatibility). |
Definition at line 313 of file proto_frame.cpp.
| 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.
| type | Device type. |
Definition at line 360 of file proto_frame.cpp.
| bool esphome::home_io_control::device_supports_binary_control | ( | DeviceType | type | ) |
Does this device type support binary on/off control?
| type | Device type. |
Definition at line 339 of file proto_frame.cpp.
| bool esphome::home_io_control::device_supports_position_control | ( | DeviceType | type | ) |
Does this device type support precise position control (0–100)?
| type | Device type. |
Definition at line 335 of file proto_frame.cpp.
| bool esphome::home_io_control::device_supports_status_requests | ( | DeviceType | type | ) |
Does this device type support status request commands (0x03)?
| type | Device type. |
Definition at line 344 of file proto_frame.cpp.
| bool esphome::home_io_control::device_supports_tilt | ( | DeviceType | type | ) |
Does this device type support tilt (slat angle) control?
| type | Device type. |
Definition at line 348 of file proto_frame.cpp.
| const char * esphome::home_io_control::device_type_name | ( | DeviceType | type | ) |
Convert a DeviceType to a lowercase string identifier.
| type | Device type enum. |
Definition at line 211 of file proto_frame.cpp.
|
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.
| raw | Pointer to raw radio buffer bytes. |
| raw_len | Number of bytes in raw. |
Definition at line 148 of file radio_sx1262.cpp.
|
inline |
Format a position float as a human‑readable string (e.g.
"50%", "unknown").
| pos | Position value (0–100 or UNKNOWN_POSITION). |
Definition at line 427 of file hub_core.h.
| uint8_t esphome::home_io_control::frame_length | ( | const IoFrame & | f | ) |
Get total frame length from ctrl0.
| f | Parsed frame. |
Definition at line 146 of file proto_frame.cpp.
|
static |
Extract a single bit (MSB‑first) from a byte buffer.
Used by UART decoding to scan raw radio samples.
| data | Input byte buffer. |
| bit_pos | Global bit index within buffer. |
Definition at line 50 of file radio_sx1262.cpp.
| bool esphome::home_io_control::has_reached_target_position | ( | float | target, |
| float | position ) |
Has the device reached its target within tolerance?
| target | Target position (0–100 or UNKNOWN_POSITION). |
| position | Current position (0–100 or UNKNOWN_POSITION). |
Definition at line 88 of file proto_frame.cpp.
|
static |
Definition at line 19 of file proto_frame.cpp.
| 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.
| hex | Hex string (must be exactly len*2 characters). |
| out | Output buffer (at least len bytes). |
| len | Number of bytes to produce. |
Definition at line 28 of file proto_frame.cpp.
| 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.
| f | Frame to initialize. |
| is_2w | True for 2‑way (default), false for 1‑way. |
| start | Set START flag (first frame in exchange). |
| end | Set END flag (final frame in exchange). |
| low_power | Set LOW_POWER flag. |
Definition at line 115 of file proto_frame.cpp.
| bool esphome::home_io_control::is_end | ( | const IoFrame & | f | ) |
Check END flag.
| f | Parsed frame. |
Definition at line 148 of file proto_frame.cpp.
|
static |
Check if a command ID is one of the known IO‑Homecontrol commands.
| cmd | Command byte. |
Definition at line 103 of file radio_sx1262.cpp.
|
static |
| bool esphome::home_io_control::is_start | ( | const IoFrame & | f | ) |
Check START flag.
| f | Parsed frame. |
Definition at line 147 of file proto_frame.cpp.
| 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.
| id | 3‑byte node ID. |
Definition at line 47 of file proto_frame.cpp.
| 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).
| buf | Raw byte buffer. |
| buf_len | Number of bytes in buf. |
| f | Output parsed frame. |
Definition at line 177 of file proto_frame.cpp.
| 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).
| f | Parsed frame. |
| buf | Output buffer (must be at least frame_length(f) bytes). |
| buf_size | Size of buf. |
Definition at line 150 of file proto_frame.cpp.
| 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.
| f | Frame to modify. |
| cmd | Command ID. |
| params | Pointer to payload bytes (may be nullptr for zero‑length). |
| params_len | Payload length (0–23). |
Definition at line 130 of file proto_frame.cpp.
| void esphome::home_io_control::set_dst | ( | IoFrame & | f, |
| const uint8_t | id[NODE_ID_SIZE] ) |
Set destination node ID.
| f | Frame to modify. |
| id | 3‑byte destination address. |
Definition at line 127 of file proto_frame.cpp.
| void esphome::home_io_control::set_src | ( | IoFrame & | f, |
| const uint8_t | id[NODE_ID_SIZE] ) |
Set source node ID.
| f | Frame to modify. |
| id | 3‑byte source address. |
Definition at line 128 of file proto_frame.cpp.
|
inline |
Check if a stored node ID is valid (not all-zero, not all-0xFF).
| id | 3‑byte node ID buffer. |
Definition at line 414 of file hub_core.h.
|
staticconstexpr |
AES block size.
Definition at line 84 of file proto_frame.h.
|
staticconstexpr |
AES-128 key size.
Definition at line 83 of file proto_frame.h.
|
staticconstexpr |
Number of bits in one protocol byte.
Definition at line 87 of file proto_frame.h.
|
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.
|
staticconstexpr |
Device sends 6-byte random challenge.
Definition at line 133 of file proto_frame.h.
|
staticconstexpr |
Controller responds with HMAC proof.
Definition at line 134 of file proto_frame.h.
|
staticconstexpr |
Confirm discovery to device.
Definition at line 124 of file proto_frame.h.
|
staticconstexpr |
Device acknowledges confirmation.
Definition at line 125 of file proto_frame.h.
|
staticconstexpr |
Broadcast discovery request.
Definition at line 120 of file proto_frame.h.
|
staticconstexpr |
Device responds with its ID and type.
Definition at line 121 of file proto_frame.h.
|
staticconstexpr |
Discover sub-devices (e.g., light on garage door).
Definition at line 122 of file proto_frame.h.
|
staticconstexpr |
Sub-device response.
Definition at line 123 of file proto_frame.h.
|
staticconstexpr |
Error response to any command.
Definition at line 147 of file proto_frame.h.
|
staticconstexpr |
Set position/open/close/stop — requires authentication.
Definition at line 115 of file proto_frame.h.
|
staticconstexpr |
Request device type/model info.
Definition at line 139 of file proto_frame.h.
|
staticconstexpr |
Device type/model response.
Definition at line 140 of file proto_frame.h.
|
staticconstexpr |
Request device name.
Definition at line 137 of file proto_frame.h.
|
staticconstexpr |
Device name response.
Definition at line 138 of file proto_frame.h.
|
staticconstexpr |
Device confirms key was received.
Definition at line 130 of file proto_frame.h.
|
staticconstexpr |
Initiate key transfer to device.
Definition at line 128 of file proto_frame.h.
|
staticconstexpr |
Send encrypted system key to device.
Definition at line 129 of file proto_frame.h.
|
staticconstexpr |
Get device status — no authentication needed.
Definition at line 116 of file proto_frame.h.
|
staticconstexpr |
Response to 0x00 and 0x03 (contains position data).
Definition at line 117 of file proto_frame.h.
|
staticconstexpr |
Configure device to auto-send status updates.
Definition at line 143 of file proto_frame.h.
|
staticconstexpr |
Config response.
Definition at line 144 of file proto_frame.h.
|
staticconstexpr |
Device-initiated status update (needs auth).
Definition at line 145 of file proto_frame.h.
|
staticconstexpr |
Acknowledge status update.
Definition at line 146 of file proto_frame.h.
|
staticconstexpr |
Least-significant-bit mask for reflected CRC update.
Definition at line 190 of file proto_frame.h.
|
staticconstexpr |
Reversed CRC-CCITT polynomial used by IO-homecontrol.
Definition at line 189 of file proto_frame.h.
|
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).
Definition at line 101 of file proto_frame.h.
|
staticconstexpr |
Bits [4:0]: frame length - 1.
Definition at line 104 of file proto_frame.h.
|
staticconstexpr |
Bit 5: 1=OneWay protocol, 0=TwoWay protocol.
Definition at line 103 of file proto_frame.h.
|
staticconstexpr |
Bit 6: first frame in exchange (uses long preamble).
Definition at line 102 of file proto_frame.h.
|
staticconstexpr |
Control byte 1 (CTRL1) bit definitions.
Definition at line 108 of file proto_frame.h.
|
inlineconstexpr |
SX1276 PA_CONFIG selector for the PA_BOOST output path.
Definition at line 44 of file hub_core.h.
|
inlineconstexpr |
SX1262 DIO3 setting value for a 1.8 V TCXO.
Definition at line 45 of file hub_core.h.
|
inlineconstexpr |
Default TX power used unless YAML overrides it.
Definition at line 43 of file hub_core.h.
|
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.
|
staticconstexpr |
Device name storage including null terminator.
Definition at line 368 of file proto_frame.h.
|
staticconstexpr |
Definition at line 178 of file proto_frame.h.
|
staticconstexpr |
Definition at line 177 of file proto_frame.h.
|
staticconstexpr |
Definition at line 176 of file proto_frame.h.
|
staticconstexpr |
Attempts per command before reporting failure.
Definition at line 66 of file proto_frame.h.
|
staticconstexpr |
Gap between retries within one HA command.
Definition at line 65 of file proto_frame.h.
|
inlineconstexpr |
Fits a full 32-byte frame rendered as spaced hex text.
Definition at line 14 of file log_frame.h.
|
staticconstexpr |
Maximum data bytes after command ID.
Definition at line 91 of file proto_frame.h.
|
staticconstexpr |
Maximum frame size (9 header + 23 data).
Definition at line 90 of file proto_frame.h.
|
staticconstexpr |
Minimum frame: CTRL0+CTRL1+DST(3)+SRC(3)+CMD(1).
Definition at line 89 of file proto_frame.h.
|
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.
|
staticconstexpr |
Channel 2: 868.95 MHz (1W and 2W, TX channel).
Definition at line 31 of file proto_frame.h.
|
staticconstexpr |
Channel 3: 869.85 MHz (2W only).
Definition at line 32 of file proto_frame.h.
|
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.
|
staticconstexpr |
Authentication HMAC is 6 bytes (truncated AES output).
Definition at line 82 of file proto_frame.h.
|
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.
|
staticconstexpr |
Padding byte used in IV construction.
Definition at line 86 of file proto_frame.h.
|
staticconstexpr |
Initialization vector size for AES.
Definition at line 85 of file proto_frame.h.
|
staticconstexpr |
Max carrier-sense attempts before TX anyway.
Definition at line 73 of file proto_frame.h.
|
staticconstexpr |
Backoff between LBT checks (≥ 5ms per ETSI).
Definition at line 74 of file proto_frame.h.
|
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.
|
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.
|
staticconstexpr |
Definition at line 61 of file radio_sx1276.h.
|
staticconstexpr |
Definition at line 60 of file radio_sx1276.h.
|
staticconstexpr |
Definition at line 57 of file radio_sx1276.h.
|
staticconstexpr |
Definition at line 58 of file radio_sx1276.h.
|
staticconstexpr |
Definition at line 59 of file radio_sx1276.h.
|
staticconstexpr |
Device/node addresses are 3 bytes (e.g., "123ABC").
Definition at line 80 of file proto_frame.h.
|
staticconstexpr |
Uppercase hex node ID plus null terminator.
Definition at line 81 of file proto_frame.h.
|
staticconstexpr |
Move to favorite/"My" position.
Definition at line 158 of file proto_frame.h.
|
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.
|
staticconstexpr |
Position unknown.
Definition at line 157 of file proto_frame.h.
|
inlineconstexpr |
Buffer for formatted position strings such as "100%".
Definition at line 46 of file hub_core.h.
|
inlineconstexpr |
Scratch buffer size for raw radio packets and recovered frames.
Definition at line 19 of file radio_interface.h.
|
staticconstexpr |
AFC auto clear.
Definition at line 36 of file radio_sx1276.h.
|
staticconstexpr |
Definition at line 24 of file radio_sx1276.h.
|
staticconstexpr |
Bit rate MSB = FXOSC / bitrate.
Definition at line 23 of file radio_sx1276.h.
|
staticconstexpr |
DIO0-DIO3 pin mapping.
Definition at line 50 of file radio_sx1276.h.
|
staticconstexpr |
DIO4-DIO5 pin mapping.
Definition at line 51 of file radio_sx1276.h.
|
staticconstexpr |
Definition at line 26 of file radio_sx1276.h.
|
staticconstexpr |
Frequency deviation MSB.
Definition at line 25 of file radio_sx1276.h.
|
staticconstexpr |
FIFO read/write access.
Definition at line 21 of file radio_sx1276.h.
|
staticconstexpr |
FIFO threshold for TX start condition.
Definition at line 47 of file radio_sx1276.h.
|
staticconstexpr |
Definition at line 29 of file radio_sx1276.h.
|
staticconstexpr |
Definition at line 28 of file radio_sx1276.h.
|
staticconstexpr |
Carrier frequency MSB (freq = FRF * FXOSC / 2^19).
Definition at line 27 of file radio_sx1276.h.
|
staticconstexpr |
Image calibration.
Definition at line 54 of file radio_sx1276.h.
|
staticconstexpr |
IRQ flags: mode ready, preamble detect, etc.
Definition at line 48 of file radio_sx1276.h.
|
staticconstexpr |
IRQ flags: FIFO full/empty, payload ready, CRC ok.
Definition at line 49 of file radio_sx1276.h.
|
staticconstexpr |
Low noise amplifier gain and boost.
Definition at line 32 of file radio_sx1276.h.
|
staticconstexpr |
Operating mode (sleep/standby/tx/rx).
Definition at line 22 of file radio_sx1276.h.
|
staticconstexpr |
Oscillator / clock output.
Definition at line 38 of file radio_sx1276.h.
|
staticconstexpr |
Power amplifier config (pin select + power level).
Definition at line 30 of file radio_sx1276.h.
|
staticconstexpr |
PA ramp time and modulation shaping.
Definition at line 31 of file radio_sx1276.h.
|
staticconstexpr |
Packet format, CRC, encoding.
Definition at line 44 of file radio_sx1276.h.
|
staticconstexpr |
Packet mode, IoHomeOn, PowerFrame.
Definition at line 45 of file radio_sx1276.h.
|
staticconstexpr |
Max payload length.
Definition at line 46 of file radio_sx1276.h.
|
staticconstexpr |
PLL hop: fast frequency change without standby.
Definition at line 53 of file radio_sx1276.h.
|
staticconstexpr |
Preamble detector config.
Definition at line 37 of file radio_sx1276.h.
|
staticconstexpr |
Definition at line 41 of file radio_sx1276.h.
|
staticconstexpr |
TX preamble length MSB.
Definition at line 40 of file radio_sx1276.h.
|
staticconstexpr |
RSSI smoothing.
Definition at line 34 of file radio_sx1276.h.
|
staticconstexpr |
Instant RSSI value in FSK mode.
Definition at line 39 of file radio_sx1276.h.
|
staticconstexpr |
Receiver bandwidth.
Definition at line 35 of file radio_sx1276.h.
|
staticconstexpr |
Receiver configuration (AFC, AGC, trigger).
Definition at line 33 of file radio_sx1276.h.
|
staticconstexpr |
Sync word config (size, polarity, enable).
Definition at line 42 of file radio_sx1276.h.
|
staticconstexpr |
Sync word byte 1 (registers 0x28-0x2F for bytes 1-8).
Definition at line 43 of file radio_sx1276.h.
|
staticconstexpr |
Chip version (should read 0x12 for SX1276).
Definition at line 52 of file radio_sx1276.h.
|
staticconstexpr |
Wait for final response after challenge response.
Definition at line 63 of file proto_frame.h.
|
staticconstexpr |
Per-channel dwell while waiting for an exchange response.
Definition at line 60 of file proto_frame.h.
|
staticconstexpr |
Wait for response to start frame (longer).
Definition at line 62 of file proto_frame.h.
|
staticconstexpr |
Wait for response to non-start frame.
Definition at line 61 of file proto_frame.h.
|
staticconstexpr |
8 bytes for response/continuation frames
Definition at line 40 of file proto_frame.h.
|
staticconstexpr |
Byte 1 bit 7: device will send auto status update.
Definition at line 170 of file proto_frame.h.
|
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.
|
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.
|
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.
|
staticconstexpr |
Extended status payload marker for tilt-capable devices.
Definition at line 171 of file proto_frame.h.
|
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.
|
staticconstexpr |
Definition at line 42 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 43 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 33 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 32 of file radio_sx1262.h.
|
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.
|
staticconstexpr |
Definition at line 68 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 31 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 29 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 30 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 45 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 44 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 47 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 67 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 66 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 60 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 58 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 59 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 57 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 27 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 51 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 63 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 62 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 64 of file radio_sx1262.h.
|
static |
Definition at line 39 of file radio_sx1262.cpp.
|
staticconstexpr |
Definition at line 37 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 40 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 41 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 28 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 35 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 38 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 36 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 34 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 46 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 24 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 22 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 25 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 21 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 23 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 39 of file radio_sx1262.h.
|
static |
Definition at line 35 of file radio_sx1262.cpp.
|
staticconstexpr |
Definition at line 26 of file radio_sx1262.h.
|
staticconstexpr |
Definition at line 50 of file radio_sx1262.h.
|
static |
Definition at line 34 of file hub_core.cpp.
|
static |
Definition at line 16 of file hub_exchange.cpp.
|
static |
Definition at line 11 of file platform_cover.cpp.
|
static |
Definition at line 11 of file platform_light.cpp.
|
static |
Definition at line 11 of file platform_switch.cpp.
|
static |
Definition at line 34 of file radio_sx1262.cpp.
|
static |
Definition at line 17 of file radio_sx1276.cpp.
|
staticconstexpr |
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.
|
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.
|
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.