|
Home IO Control
ESPHome add-on for IO-Homecontrol devices
|
Device-name, address-classification and 1W-frame codecs. More...
#include "proto_constants.h"#include "proto_device_model.h"#include "proto_sizes.h"#include <cstddef>#include <cstdint>#include <optional>#include <string>Go to the source code of this file.
Classes | |
| struct | esphome::home_io_control::OneWayFrameInfo |
| Decoded representation of a 1W remote frame. More... | |
| struct | esphome::home_io_control::DiscoveryResponseInfo |
| Extended discovery-response fields (manufacturer, Multi Information Byte, backbone address, timestamp) plus flags recording how much of the payload was actually present. More... | |
| struct | esphome::home_io_control::OneWayAdoptedKey |
| Recovered controller identity from a decoded CMD_ONEWAY_ADD_CONTROLLER (0x30) frame. More... | |
| struct | esphome::home_io_control::LastCommandRecord |
| One decoded last-command record. More... | |
| struct | esphome::home_io_control::StatusUpdateEvent |
| The event header of a well-formed CMD_STATUS_UPDATE payload. More... | |
| struct | esphome::home_io_control::TransferOpenReply |
| One decoded CMD_TRANSFER_OPEN_RESP payload. More... | |
| struct | esphome::home_io_control::LimitationStatus |
| One decoded CMD_LIMITATION_STATUS_RESP payload. More... | |
Namespaces | |
| namespace | esphome |
| namespace | esphome::home_io_control |
Functions | |
| std::string | esphome::home_io_control::decode_device_name_payload (const uint8_t *data, uint8_t len) |
| Decode a device-name payload from IO-homecontrol's Latin-1 wire format into UTF-8. | |
| std::string | esphome::home_io_control::trim_ascii_whitespace (const std::string &value) |
| Trim leading and trailing ASCII whitespace from a string. | |
| DeviceNameValidationError | esphome::home_io_control::encode_device_name_payload (const std::string &name, uint8_t payload[DEVICE_NAME_WRITE_PAYLOAD_SIZE], std::string &normalized_name) |
| Validate and encode a user-supplied UTF-8 device name into the fixed Latin-1 write payload. | |
| const char * | esphome::home_io_control::device_name_validation_error_name (DeviceNameValidationError error) |
| Return a stable symbolic name for a device-name validation result. | |
| const char * | esphome::home_io_control::device_name_validation_error_description (DeviceNameValidationError error) |
| Return a human-readable explanation for a device-name validation result. | |
| AddressClass | esphome::home_io_control::classify_address (const uint8_t addr[NODE_ID_SIZE]) |
| Classify an IO-Homecontrol 3-byte address. | |
| const char * | esphome::home_io_control::address_class_name (AddressClass address_class) |
| Get a human-readable name for an address classification. | |
| DeviceType | esphome::home_io_control::broadcast_target_type (const uint8_t addr[NODE_ID_SIZE]) |
| Extract the target device type from a typed broadcast address. | |
| DeviceType | esphome::home_io_control::discovery_target_type (const uint8_t addr[NODE_ID_SIZE]) |
| Extract the device type a discovery request is restricted to. | |
| uint8_t | esphome::home_io_control::discovery_slot_count (const uint8_t addr[NODE_ID_SIZE]) |
| Number of answer slots a discovery request opens. | |
| void | esphome::home_io_control::encode_broadcast_address (DeviceType type, uint8_t out[NODE_ID_SIZE]) |
| Encode a device type into its typed-broadcast destination address — the exact inverse of broadcast_target_type(), kept immediately beside it so the pair cannot drift apart. | |
| void | esphome::home_io_control::encode_discovery_address (DeviceType type, uint8_t out[NODE_ID_SIZE]) |
| Encode a device type into its typed discovery address, the inverse of discovery_target_type(). | |
| void | esphome::home_io_control::decode_1w_main_intent (uint8_t main0, uint8_t main1, char *out, size_t out_size) |
| Decode the "main" position/command bytes from a 1W execute payload. | |
| std::optional< float > | esphome::home_io_control::oneway_intent_to_target (uint8_t main0, uint8_t main1) |
| Resolve a 1W main-byte pair to an optimistic IO target position, if unambiguous. | |
| OneWayFrameInfo | esphome::home_io_control::decode_1w_frame (const IoFrame &frame) |
| Decode a parsed 1W frame into a structured OneWayFrameInfo. | |
| const char * | esphome::home_io_control::oneway_target_label (const OneWayFrameInfo &info) |
| The destination label a decoded 1W frame renders as in a log line. | |
| DiscoveryResponseInfo | esphome::home_io_control::decode_discovery_response (const IoFrame &frame, IoDevice &device, std::string &device_id) |
| Decode a discovery-response payload (CMD_DISCOVER_RESP 0x29 or CMD_DISCOVER_SPE_RESP 0x2B — both carry the identical DISCOVERY_RESP_FULL_SIZE layout) into device metadata. | |
| OneWayAddControllerDecodeError | esphome::home_io_control::decode_1w_add_controller (const IoFrame &frame, OneWayAdoptedKey &out) |
| Decode a CMD_ONEWAY_ADD_CONTROLLER (0x30) frame into a recovered controller identity. | |
| LastCommandRecord | esphome::home_io_control::decode_last_command_record (const IoFrame &frame, uint8_t base) |
| Decode the last-command record at base from a status-bearing payload. | |
| bool | esphome::home_io_control::decode_status_update_event (const IoFrame &frame, StatusUpdateEvent &out) |
| Decode the event header of a CMD_STATUS_UPDATE. | |
| bool | esphome::home_io_control::decode_sun_level_event (const IoFrame &frame, uint16_t &out) |
| Decode the sun value of an EVENT_LOCAL_SENSOR report. | |
| bool | esphome::home_io_control::decode_battery_level_event (const IoFrame &frame, uint8_t &out) |
| Decode the level of an EVENT_BATTERY_LEVEL_CHANGE report as a percentage. | |
| bool | esphome::home_io_control::decode_transfer_open_reply (const IoFrame &f, TransferOpenReply &out) |
| Decode a transfer-open reply (layout verified against a VELUX KLR 200 copy session). | |
| uint16_t | esphome::home_io_control::transfer_chunk_count (uint16_t length) |
| Number of CMD_UNKNOWN4A_REQ chunks that cover length bytes: ceil(length / TRANSFER_BLOCK_SIZE). | |
| bool | esphome::home_io_control::decode_transfer_block (const IoFrame &f, uint8_t handle, uint16_t chunk, const uint8_t *&out, uint8_t &out_len) |
| Decode one CMD_UNKNOWN4A_RESP data block. | |
| bool | esphome::home_io_control::decode_limitation_status (const IoFrame &f, LimitationStatus &out) |
| Decode a limitation reply (assumed layout, see LimitationStatus). | |
| bool | esphome::home_io_control::decode_limitation_request (const IoFrame &f, LimitationType &type, uint8_t ¶meter_id) |
| Decode a limitation request (assumed layout [selector] [parameter id] [00]). | |
| uint32_t | esphome::home_io_control::limitation_time_seconds (uint8_t time_raw) |
| Remaining time of a limitation in seconds. | |
Variables | |
| static constexpr uint8_t | esphome::home_io_control::DEVICE_NAME_WRITE_CHAR_LIMIT = 15 |
| Reference write limit before the trailing null. | |
| static constexpr uint8_t | esphome::home_io_control::DEVICE_NAME_WRITE_PAYLOAD_SIZE |
| Fixed write payload: 15 visible chars plus trailing null/padding. | |
| static constexpr uint16_t | esphome::home_io_control::LATIN1_CODEPOINT_MAX = 0x00FF |
| Highest Unicode code point representable in Latin-1. | |
| static constexpr uint8_t | esphome::home_io_control::ADDRESS_SUFFIX_DISCOVERY_64 = 0x3C |
| Discovery suffix opening 64 slots. | |
| static constexpr uint8_t | esphome::home_io_control::ADDRESS_SUFFIX_DISCOVERY_128 = 0x3D |
| Discovery suffix opening 128 slots. | |
| static constexpr uint8_t | esphome::home_io_control::ADDRESS_SUFFIX_DISCOVERY_255 = 0x3E |
| Discovery suffix opening 255 slots. | |
| static constexpr uint8_t | esphome::home_io_control::DISCOVERY_SLOTS_32 = 32 |
| Window of ADDRESS_SUFFIX_DISCOVERY, and the fallback. | |
| static constexpr uint8_t | esphome::home_io_control::DISCOVERY_SLOTS_64 = 64 |
| Window of ADDRESS_SUFFIX_DISCOVERY_64. | |
| static constexpr uint8_t | esphome::home_io_control::DISCOVERY_SLOTS_128 = 128 |
| Window of ADDRESS_SUFFIX_DISCOVERY_128. | |
| static constexpr uint8_t | esphome::home_io_control::DISCOVERY_SLOTS_255 = 255 |
| Window of ADDRESS_SUFFIX_DISCOVERY_255. | |
| static constexpr size_t | esphome::home_io_control::ONEWAY_INTENT_BUFFER_SIZE = 24 |
| Buffer size for the decoded 1W main-intent string. | |
| constexpr uint8_t | esphome::home_io_control::PRIVATE_RESPONSE_LAST_COMMAND_OFFSET = 8 |
| Offset of the last-command record within each status-bearing payload. | |
| constexpr uint8_t | esphome::home_io_control::STATUS_UPDATE_LAST_COMMAND_OFFSET = 11 |
| constexpr uint8_t | esphome::home_io_control::STATUS_UPDATE_ORIGINATOR_OFFSET = 14 |
| Offset of the Command Originator byte in a CMD_STATUS_UPDATE (0x71) payload. | |
| static constexpr uint8_t | esphome::home_io_control::ADDRESS_SUFFIX_MASK = 0x3F |
| Well-known address suffix values in the broadcast address space. | |
| static constexpr uint8_t | esphome::home_io_control::ADDRESS_SUFFIX_BROADCAST = 0x3F |
| Suffix for "all devices of this type" broadcast. | |
| static constexpr uint8_t | esphome::home_io_control::ADDRESS_SUFFIX_DISCOVERY = 0x3B |
| Suffix for discovery-related broadcasts. | |
CMD_STATUS_UPDATE (0x71) payload header | |
A 0x71 payload is <flags> <status> <event hi> <event lo> <length> <event data...>. Every captured position update carries EVENT_STATUS_CHANGE with 11 data bytes (the target/current/record offsets above sit inside them), and the one other report captured carries EVENT_LOCAL_SENSOR with 5 (tests/corpus/captures/probe/somfy_rs100_probe_subscribe_event_sx1262.yaml). The length byte matches the frame exactly in all of them. | |
| constexpr uint8_t | esphome::home_io_control::STATUS_UPDATE_EVENT_ID_OFFSET = 2 |
| Event id, big-endian, 2 bytes. | |
| constexpr uint8_t | esphome::home_io_control::STATUS_UPDATE_EVENT_LENGTH_OFFSET = 4 |
| Number of event-data bytes that follow. | |
| constexpr uint8_t | esphome::home_io_control::STATUS_UPDATE_EVENT_DATA_OFFSET = 5 |
| First event-data byte. | |
Device-name, address-classification and 1W-frame codecs.
Higher-level decode/encode helpers layered on the frame and device model: Latin-1 device-name round-tripping, broadcast address classification and structured decoding of overheard 1W remote frames.
Definition in file proto_codecs.h.