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/spi/spi.h"
#include "esphome/components/button/button.h"
#include "proto_frame.h"
#include "radio_interface.h"
#include "hub_exchange.h"
#include "hub_decisions.h"
#include "hub_pairing.h"
#include <deque>
#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...
struct  esphome::home_io_control::IOHomeControlComponent::PendingOperation
 A single queued operation to be processed in loop(). More...
struct  esphome::home_io_control::IOHomeControlComponent::ExchangeDebugInfo
 Debug snapshot of the last exchange attempt. More...
class  esphome::home_io_control::IOHomeDiscoverButton
 Button entity that triggers device discovery and pairing when pressed in Home Assistant. More...

Namespaces

namespace  esphome
namespace  esphome::home_io_control

Typedefs

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.

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() processes the pending_operations_ queue (serializes all radio work).
  • All outbound commands go through send_and_receive_ which handles retry & auth.
  • Inbound frames are processed in process_received_packet_ and may trigger inbound authentication (hub_exchange.h) if the device proves itself.
  • Device registry and callbacks provide fan‑out to platform entities (covers/lights/switches).

Definition in file hub_core.h.