|
ESPHome 2026.11.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 | |
| ESPHOME_LOG_TAG (TAG, "modbus_controller.binary_sensor") | |
| ESPHOME_LOG_TAG (TAG, "modbus_controller") | |
| 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 | |
| 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 | |
| ESPHOME_LOG_TAG (TAG, "modbus.number") | |
| ESPHOME_LOG_TAG (TAG, "modbus_controller.output") | |
| ESPHOME_LOG_TAG (TAG, "modbus_controller.select") | |
| ESPHOME_LOG_TAG (TAG, "modbus_controller.sensor") | |
| ESPHOME_LOG_TAG (TAG, "modbus_controller.switch") | |
| ESPHOME_LOG_TAG (TAG, "modbus_controller.text_sensor") | |
Variables | |
| const std::vector< uint8_t > & | data |
| using esphome::modbus_controller::SensorSet = std::set<SensorItem *, SensorItemsComparator> |
Definition at line 182 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 63 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 633 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::get_data() instead. Removed in 2027.2.0" | , |
| "2026.8.0" | ) |
Definition at line 42 of file modbus_controller.h.
| esphome::modbus_controller::ESPHOME_LOG_TAG | ( | TAG | , |
| "modbus.number" | ) |
| esphome::modbus_controller::ESPHOME_LOG_TAG | ( | TAG | , |
| "modbus_controller" | ) |
| esphome::modbus_controller::ESPHOME_LOG_TAG | ( | TAG | , |
| "modbus_controller.binary_sensor" | ) |
| esphome::modbus_controller::ESPHOME_LOG_TAG | ( | TAG | , |
| "modbus_controller.output" | ) |
| esphome::modbus_controller::ESPHOME_LOG_TAG | ( | TAG | , |
| "modbus_controller.select" | ) |
| esphome::modbus_controller::ESPHOME_LOG_TAG | ( | TAG | , |
| "modbus_controller.sensor" | ) |
| esphome::modbus_controller::ESPHOME_LOG_TAG | ( | TAG | , |
| "modbus_controller.switch" | ) |
| esphome::modbus_controller::ESPHOME_LOG_TAG | ( | TAG | , |
| "modbus_controller.text_sensor" | ) |
|
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 484 of file modbus_controller.h.
|
inline |
Convert vector<uint8_t> response payload to float.
| data | payload with data |
| item | SensorItem object |
Definition at line 617 of file modbus_controller.h.
| std::span< const uint8_t > esphome::modbus_controller::data |
Definition at line 49 of file modbus_controller.h.