Commit Graph

5 Commits (8fc10fb496087f8803040ad5d6390efbcaff1d0e)

Author SHA1 Message Date
Tomer27cz 8fc10fb496 Optimize DLMS parser buffers and RX timing
Replace heavy std::string/iostream usage in the DLMS parser with stack-allocated char buffers and snprintf to avoid heap allocations and reduce runtime overhead. Introduce buffer-based helpers (data_to_string_, obis_to_string_) and switch hex formatting to format_hex_pretty_to; remove <sstream>/<iomanip> and include <cstdio>. Update header signatures accordingly. Also change DlmsPushComponent to use App.get_loop_component_start_time() instead of millis() when tracking last_rx_char_time_ for RX timeout handling.

Files changed: components/dlms_push/dlms_parser.cpp/.h (buffer-based string helpers, logging, include changes), components/dlms_push/dlms_push.cpp (use App loop time for timeout).

Note: The string helper APIs were converted to buffer-oriented versions — update any callers to provide an output buffer.
2026-03-07 20:33:20 +01:00
Tomer27cz 1db8e48acf new dlms_push component
dlms_push is a complete rewrite of the component using common esphome structure. The new component no longer uses Gurux library so it is significantly smaller and easier to maintain.

Update README (EN/CZ) to document dlms_push, replace xt211 examples, and expose new config options (show_log, receive_timeout, custom_pattern).

Also update esphome-smartmeter.yaml accordingly.
2026-03-07 13:06:16 +01:00
Tomer27cz ffec2a901f Update xt211_uart.h
remove obsolete UART lock for newer ESPHome versions
2026-02-28 22:36:15 +01:00
Tomer27cz ce199326a1 Improve UART locking and fallback read logic
Refactored XT211Uart to handle cases where the lock is not initialized, preventing null dereference. Added fallback to base read_array for non-hardware UARTs in read_array_quick_, improving compatibility with BLE-backed UARTs.
2026-01-23 21:04:55 +01:00
Tomer27cz 9c23deac0e Initial commit 2025-11-04 18:39:59 +01:00