Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
hub_core.h File Reference

IO-Homecontrol ESPHome component — protocol controller. More...

#include "esphome/core/component.h"
#include "esphome/core/hal.h"
#include "esphome/components/api/custom_api_device.h"
#include "esphome/components/spi/spi.h"
#include "proto_codecs.h"
#include "proto_frame.h"
#include "radio_interface.h"
#include "tuning_config.h"
#include "hub_exchange.h"
#include "hub_decisions.h"
#include "hub_pairing.h"
#include "device_registry.h"
#include "status_poll_policy.h"
#include "operation_queue.h"
#include "exchange_engine.h"
#include "pairing_engine.h"
#include "management_actions.h"
#include "pairing_responder.h"
#include "lr1121_firmware_decisions.h"
#include "radio_lr1121_firmware_updater.h"
#include <map>
#include <vector>
#include <functional>
Include dependency graph for hub_core.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  esphome::home_io_control::IOHomeControlComponent
 The main IO-Homecontrol component. More...

Namespaces

namespace  esphome
namespace  esphome::home_io_control

Functions

bool esphome::home_io_control::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 esphome::home_io_control::format_position (float pos)
 Format a position float as a human‑readable string (e.g.

Variables

constexpr uint8_t esphome::home_io_control::DEFAULT_TX_POWER_DBM = 17
 Default TX power used unless YAML overrides it.
constexpr uint8_t esphome::home_io_control::DEFAULT_PA_PIN_PA_BOOST = 0x80
 SX1276 PA_CONFIG selector for the PA_BOOST output path.
constexpr uint8_t esphome::home_io_control::DEFAULT_TCXO_VOLTAGE_SETTING_1P8V = 0x03
 SX1262 DIO3 setting value for a 1.8 V TCXO.
constexpr size_t esphome::home_io_control::POSITION_TEXT_BUFFER_SIZE = 16
 Buffer for formatted position strings such as "100%".

Detailed Description

IO-Homecontrol ESPHome component — protocol controller.

This component manages the IO-Homecontrol 2W protocol: sending commands, receiving responses with automatic authentication, device discovery/pairing, and device state tracking. Radio hardware is delegated to a RadioDriver implementation (SX1276, SX1262, etc.).

SPI configuration: MSB first, CPOL=0, CPHA=0 (Mode 0), 8 MHz clock. The component inherits SPIDevice and implements SpiAccess to bridge the ESPHome SPI framework to the radio driver.

Architecture notes:

  • setup() initializes radio, waits for YAML-driven device registration, and enters RX mode.
  • loop() drains the OperationQueue collaborator (serializes all radio work).
  • All outbound commands go through send_and_receive_, a thin wrapper around ExchangeEngine which owns retry, timing, and challenge-response auth.
  • Inbound frames are processed in process_received_packet_ and may trigger inbound authentication (ExchangeEngine::authenticate_request) if the device proves itself.
  • DeviceRegistry and its callbacks provide fan-out to platform entities (covers/lights/switches/locks); StatusPollPolicy schedules follow-up polls; PairingEngine owns pairing; ManagementActions owns the rename/identify/force-open hub-level Home Assistant actions.

Definition in file hub_core.h.