|
ESPHome 2026.10.0-dev
|
Data Structures | |
| class | ControllerDevice |
| The shared feedback half of a controller-owned hub device: online/offline tracking, retry counting and the on_command_sent trigger all route to the controller from here. More... | |
| class | ModbusBinaryOutput |
| class | ModbusBinarySensor |
| class | ModbusController |
| Modbus controller class. More... | |
| class | ModbusFloatOutput |
| class | ModbusNumber |
| class | ModbusSelect |
| class | ModbusSensor |
| class | ModbusSwitch |
| class | ModbusTextSensor |
| class | PollingDevice |
| A persistent hub device that polls one register range - the read-side mirror of WriterDevice. More... | |
| struct | RegisterRange |
| class | SensorItem |
| class | SensorItemsComparator |
| class | WriterDevice |
| The write side of a ControllerDevice, owned by the writer entities through WriterEntity, whose forwarders re-expose exactly the request API a write lambda may use and record every dispatch. More... | |
| class | WriterEntity |
| Gives a writer entity the write API of the WriterDevice it owns. More... | |
Typedefs | |
| using | SensorSet = std::set<SensorItem *, SensorItemsComparator> |
| using | value_to_data_t = std::function<float>(float) |
Enumerations | |
| enum class | RangeReuse : uint8_t { AUTO = 0 , ALWAYS = 1 , NEVER = 2 } |
| How an item relates to the register range built just before it (same register type, address order). More... | |
| enum class | RawEncoding { NONE = 0 , HEXBYTES = 1 , COMMA = 2 , ANSI = 3 } |
Functions | |
| ESPDEPRECATED ("Use modbus::helpers::value_type_is_float() instead. Removed in 2026.10.0", "2026.4.0") inline bool value_type_is_float(SensorValueType v) | |
| ESPDEPRECATED ("Use modbus::helpers::modbus_register_read_function() instead. Removed in 2026.10.0", "2026.4.0") inline FunctionCode modbus_register_read_function(modbus | |
| ESPDEPRECATED ("Use modbus::helpers::modbus_register_write_function() instead. Removed in 2026.10.0", "2026.4.0") inline FunctionCode modbus_register_write_function(modbus | |
| ESPDEPRECATED ("Use modbus::helpers::c_to_hex() instead. Removed in 2026.10.0", "2026.4.0") inline uint8_t c_to_hex(char c) | |
| ESPDEPRECATED ("Use modbus::helpers::byte_from_hex_str() instead. Removed in 2026.10.0", "2026.4.0") inline uint8_t byte_from_hex_str(const std | |
| ESPDEPRECATED ("Use modbus::helpers::word_from_hex_str() instead. Removed in 2026.10.0", "2026.4.0") inline uint16_t word_from_hex_str(const std | |
| ESPDEPRECATED ("Use modbus::helpers::dword_from_hex_str() instead. Removed in 2026.10.0", "2026.4.0") inline uint32_t dword_from_hex_str(const std | |
| ESPDEPRECATED ("Use modbus::helpers::qword_from_hex_str() instead. Removed in 2026.10.0", "2026.4.0") inline uint64_t qword_from_hex_str(const std | |
| template<typename T > | |
| ESPDEPRECATED ("Use modbus::helpers::get_data() instead. Removed in 2026.10.0", "2026.4.0") T get_data(const std | |
| template<typename T > | |
| ESPDEPRECATED ("Use modbus::helpers::get_data() instead. Removed in 2027.2.0", "2026.8.0") T get_data(std | |
| ESPDEPRECATED ("Use modbus::helpers::bit_from_packed() instead. Removed in 2027.2.0", "2026.4.0") inline bool coil_from_vector(int coil | |
| ESPDEPRECATED ("Use modbus::helpers::bit_from_packed() instead. Removed in 2027.2.0", "2026.8.0") inline bool coil_from_vector(int coil | |
| template<typename N > | |
| ESPDEPRECATED ("Use modbus::helpers::mask_and_shift_by_rightbit() instead. Removed in 2026.10.0", "2026.4.0") N mask_and_shift_by_rightbit(N data | |
| ESPDEPRECATED ("Use modbus::helpers::number_to_payload() instead. Removed in 2026.10.0", "2026.4.0") inline void number_to_payload(std | |
| ESPDEPRECATED ("Use modbus::helpers::payload_to_number() instead. Removed in 2026.10.0", "2026.4.0") inline int64_t payload_to_number(const std | |
| ESPDEPRECATED ("Use modbus::helpers::float_to_payload() instead. Removed in 2026.10.0", "2026.4.0") inline std | |
| class ESPDEPRECATED("One-shot writes go through the entity write helpers (WriterDevice) or the modbus_client actions, and " "polling runs through PollingDevice. Removed in 2027.3.0", "2026.9.0") ModbusCommandItem bool | offline_retry_due (uint16_t update_counter, uint16_t module_offline_at, uint16_t offline_skip_updates) |
| A single modbus command. | |
| float | payload_to_float (std::span< const uint8_t > data, const SensorItem &item, uint8_t offset) |
| Convert vector<uint8_t> response payload to float. | |
| ESPDEPRECATED ("Pass the offset explicitly: payload_to_float(data, item, item.offset). Removed in 2027.2.0", "2026.8.0") inline float payload_to_float(std | |
Variables | |
| const std::vector< uint8_t > & | data |
| uint32_t | mask |
| using esphome::modbus_controller::SensorSet = std::set<SensorItem *, SensorItemsComparator> |
Definition at line 252 of file modbus_controller.h.
| using esphome::modbus_controller::value_to_data_t = std::function<float>(float) |
Definition at line 11 of file modbus_number.h.
|
strong |
How an item relates to the register range built just before it (same register type, address order).
The numeric order doubles as the comparator tiebreak for items at the same address (see SensorItemsComparator): AUTO items form the shared range first, so a NEVER item comes last and shares a range it did not start (items on one address must share, see create_polling_commands_()).
| Enumerator | |
|---|---|
| AUTO | |
| ALWAYS | |
| NEVER | |
Definition at line 133 of file modbus_controller.h.
|
strong |
| Enumerator | |
|---|---|
| NONE | |
| HEXBYTES | |
| COMMA | |
| ANSI | |
Definition at line 11 of file modbus_textsensor.h.
| esphome::modbus_controller::ESPDEPRECATED | ( | "Pass the offset explicitly: payload_to_float(data, item, item.offset). Removed in 2027.2.0" | , |
| "2026.8.0" | ) |
Definition at line 698 of file modbus_controller.h.
| esphome::modbus_controller::ESPDEPRECATED | ( | "Use modbus::helpers::bit_from_packed() instead. Removed in 2027.2.0" | , |
| "2026.4.0" | ) |
| esphome::modbus_controller::ESPDEPRECATED | ( | "Use modbus::helpers::bit_from_packed() instead. Removed in 2027.2.0" | , |
| "2026.8.0" | ) |
| esphome::modbus_controller::ESPDEPRECATED | ( | "Use modbus::helpers::byte_from_hex_str() instead. Removed in 2026.10.0" | , |
| "2026.4.0" | ) const |
Definition at line 50 of file modbus_controller.h.
| esphome::modbus_controller::ESPDEPRECATED | ( | "Use modbus::helpers::c_to_hex() instead. Removed in 2026.10.0" | , |
| "2026.4.0" | ) |
Definition at line 47 of file modbus_controller.h.
| esphome::modbus_controller::ESPDEPRECATED | ( | "Use modbus::helpers::dword_from_hex_str() instead. Removed in 2026.10.0" | , |
| "2026.4.0" | ) const |
Definition at line 60 of file modbus_controller.h.
| esphome::modbus_controller::ESPDEPRECATED | ( | "Use modbus::helpers::float_to_payload() instead. Removed in 2026.10.0" | , |
| "2026.4.0" | ) |
Definition at line 120 of file modbus_controller.h.
| esphome::modbus_controller::ESPDEPRECATED | ( | "Use modbus::helpers::get_data() instead. Removed in 2026.10.0" | , |
| "2026.4.0" | ) const |
Definition at line 71 of file modbus_controller.h.
| esphome::modbus_controller::ESPDEPRECATED | ( | "Use modbus::helpers::get_data() instead. Removed in 2027.2.0" | , |
| "2026.8.0" | ) |
Definition at line 85 of file modbus_controller.h.
| esphome::modbus_controller::ESPDEPRECATED | ( | "Use modbus::helpers::mask_and_shift_by_rightbit() instead. Removed in 2026.10.0" | , |
| "2026.4.0" | ) |
| esphome::modbus_controller::ESPDEPRECATED | ( | "Use modbus::helpers::modbus_register_read_function() instead. Removed in 2026.10.0" | , |
| "2026.4.0" | ) |
Definition at line 37 of file modbus_controller.h.
| esphome::modbus_controller::ESPDEPRECATED | ( | "Use modbus::helpers::modbus_register_write_function() instead. Removed in 2026.10.0" | , |
| "2026.4.0" | ) |
Definition at line 42 of file modbus_controller.h.
| esphome::modbus_controller::ESPDEPRECATED | ( | "Use modbus::helpers::number_to_payload() instead. Removed in 2026.10.0" | , |
| "2026.4.0" | ) |
Definition at line 108 of file modbus_controller.h.
| esphome::modbus_controller::ESPDEPRECATED | ( | "Use modbus::helpers::payload_to_number() instead. Removed in 2026.10.0" | , |
| "2026.4.0" | ) const |
Definition at line 113 of file modbus_controller.h.
| esphome::modbus_controller::ESPDEPRECATED | ( | "Use modbus::helpers::qword_from_hex_str() instead. Removed in 2026.10.0" | , |
| "2026.4.0" | ) const |
Definition at line 65 of file modbus_controller.h.
| esphome::modbus_controller::ESPDEPRECATED | ( | "Use modbus::helpers::value_type_is_float() instead. Removed in 2026.10.0" | , |
| "2026.4.0" | ) |
Definition at line 34 of file modbus_controller.h.
| esphome::modbus_controller::ESPDEPRECATED | ( | "Use modbus::helpers::word_from_hex_str() instead. Removed in 2026.10.0" | , |
| "2026.4.0" | ) const |
Definition at line 55 of file modbus_controller.h.
|
inline |
A single modbus command.
Each command is its own ModbusClientDevice: it sends its frame to the hub and the hub routes the response back to this object's on_modbus_* callbacks, so the controller no longer has to match responses to a FIFO queue. Whether an offline probe is due this update cycle: every offline_skip_updates + 1 cycles, anchored at the cycle the device went offline. Pure so the cadence (including update_counter wraparound) can be unit tested; used by ModbusController::update().
Definition at line 549 of file modbus_controller.h.
|
inline |
Convert vector<uint8_t> response payload to float.
| data | payload with data |
| item | SensorItem object |
Definition at line 682 of file modbus_controller.h.
| std::span< const uint8_t > esphome::modbus_controller::data |
Definition at line 92 of file modbus_controller.h.
| uint32_t esphome::modbus_controller::mask |
Definition at line 104 of file modbus_controller.h.