From e3f35aedb0cac235c743aaf7dabbb183f1cf4bd5 Mon Sep 17 00:00:00 2001 From: Sleeper85 Date: Thu, 5 Nov 2026 22:18:10 +0100 Subject: [PATCH] Packages: Declare each UART in the package that consumes it Each package now imports its UART from its *_uart_id var and keeps its own baud rate key. WK2168 channels work the same way, uart_flow_control_pin replaces the flow control include, and min_version moves to 2026.10.0. Breaking change. --- .../Board_Waveshare_ESP32-S3-RS485-CAN.md | 1 + documents/README/YamBMS_LP_YAML.md | 22 ++++-- documents/README/YamBMS_RP_YAML.md | 22 ++++-- documents/README/changelog/Changelog.md | 7 +- documents/README/dev/Coding_conventions.md | 18 +++++ documents/README/dev/Design_decisions.md | 75 +++++++++++++++++++ documents/README/dev/Project_structure.md | 10 ++- packages/base/device_base_esphome.yaml | 2 +- .../bms_combine_BASEN_RS485_controller.yaml | 12 +-- ...mbine_BASEN_RS485_controller_talk_pin.yaml | 12 +-- .../bms/bms_combine_EG4_RS485_modbus.yaml | 12 +-- .../bms_combine_Ecoworthy_RS485_modbus.yaml | 13 ++-- .../bms_combine_JK_RS485_DISPLAY_full.yaml | 12 +-- .../bms_combine_JK_RS485_Modbus_sniffer.yaml | 8 +- ...bine_JK_RS485_Modbus_sniffer_talk_pin.yaml | 8 +- .../bms/bms_combine_PACE_RS485_modbus.yaml | 12 +-- ...bms_combine_SEPLOS_V1_V2_RS485_modbus.yaml | 12 +-- ...ombine_SEPLOS_V3_RS485_modbus_sniffer.yaml | 16 ++-- packages/bms/bms_sensors_JBD_UART_full.yaml | 12 +-- .../bms/bms_sensors_JK_UART_4G-GPS_full.yaml | 8 +- .../board/board_ESP32-P4_M5Stack-Tab5.yaml | 6 +- packages/board/board_options_itf_modbus.yaml | 12 +-- packages/board/board_options_itf_uart_1.yaml | 10 ++- packages/board/board_options_itf_uart_2.yaml | 10 ++- packages/board/board_options_itf_uart_3.yaml | 10 ++- packages/board/board_options_itf_uart_4.yaml | 10 ++- packages/board/board_options_itf_uart_5.yaml | 10 ++- packages/board/board_options_itf_uart_6.yaml | 10 ++- .../board/board_options_itf_uart_esp_1.yaml | 18 ++++- .../board/board_options_itf_uart_esp_2.yaml | 18 ++++- .../board/board_options_itf_uart_esp_3.yaml | 18 ++++- .../board_options_itf_uart_i2c_0.yaml} | 16 ++-- ...yaml => board_options_itf_uart_i2c_1.yaml} | 27 +++---- .../board/board_options_itf_uart_i2c_2.yaml | 28 +++++++ .../board/board_options_itf_uart_i2c_3.yaml | 28 +++++++ .../board/board_options_itf_uart_i2c_4.yaml | 28 +++++++ .../board/board_options_itf_uart_i2c_5.yaml | 28 +++++++ .../board/board_options_itf_uart_i2c_6.yaml | 28 +++++++ .../board/board_options_itf_uart_i2c_7.yaml | 28 +++++++ .../board/board_options_itf_uart_spi_0.yaml | 28 +++++++ .../board/board_options_itf_uart_spi_1.yaml | 28 +++++++ .../board/board_options_itf_uart_spi_2.yaml | 28 +++++++ .../board/board_options_itf_uart_spi_3.yaml | 28 +++++++ .../board/board_options_itf_uart_spi_4.yaml | 28 +++++++ .../board/board_options_itf_uart_spi_5.yaml | 28 +++++++ .../board/board_options_itf_uart_spi_6.yaml | 28 +++++++ .../board/board_options_itf_uart_spi_7.yaml | 28 +++++++ ...yaml => board_options_itf_wk2168_i2c.yaml} | 34 +-------- ...yaml => board_options_itf_wk2168_spi.yaml} | 35 +-------- ...shunt_combine_Victron_SmartShunt_UART.yaml | 8 +- .../shunt_modbus_Victron_SmartShunt_UART.yaml | 8 +- ...odbus_Victron_SmartShunt_UART_minimal.yaml | 8 +- .../shunt/shunt_sensors_Junctek_KHF_UART.yaml | 10 ++- ...shunt_sensors_Victron_SmartShunt_UART.yaml | 9 ++- ...nsors_Victron_SmartShunt_UART_minimal.yaml | 9 ++- packages/yambms/yambms_rs485.yaml | 14 +--- 56 files changed, 757 insertions(+), 239 deletions(-) rename packages/{shunt/shunt_combine_Victron_SmartShunt_UART_expander.yaml => board/board_options_itf_uart_i2c_0.yaml} (65%) rename packages/board/{board_options_itf_modbus_expander.yaml => board_options_itf_uart_i2c_1.yaml} (52%) create mode 100644 packages/board/board_options_itf_uart_i2c_2.yaml create mode 100644 packages/board/board_options_itf_uart_i2c_3.yaml create mode 100644 packages/board/board_options_itf_uart_i2c_4.yaml create mode 100644 packages/board/board_options_itf_uart_i2c_5.yaml create mode 100644 packages/board/board_options_itf_uart_i2c_6.yaml create mode 100644 packages/board/board_options_itf_uart_i2c_7.yaml create mode 100644 packages/board/board_options_itf_uart_spi_0.yaml create mode 100644 packages/board/board_options_itf_uart_spi_1.yaml create mode 100644 packages/board/board_options_itf_uart_spi_2.yaml create mode 100644 packages/board/board_options_itf_uart_spi_3.yaml create mode 100644 packages/board/board_options_itf_uart_spi_4.yaml create mode 100644 packages/board/board_options_itf_uart_spi_5.yaml create mode 100644 packages/board/board_options_itf_uart_spi_6.yaml create mode 100644 packages/board/board_options_itf_uart_spi_7.yaml rename packages/board/{board_options_itf_pvbrain2_wk2168_i2c.yaml => board_options_itf_wk2168_i2c.yaml} (57%) rename packages/board/{board_options_itf_pvbrain2_wk2168_spi.yaml => board_options_itf_wk2168_spi.yaml} (59%) diff --git a/documents/README/Board_Waveshare_ESP32-S3-RS485-CAN.md b/documents/README/Board_Waveshare_ESP32-S3-RS485-CAN.md index 1665014..5d95163 100644 --- a/documents/README/Board_Waveshare_ESP32-S3-RS485-CAN.md +++ b/documents/README/Board_Waveshare_ESP32-S3-RS485-CAN.md @@ -8,6 +8,7 @@ > [!IMPORTANT] > This board uses a `flow_control_pin`, also called a `talk_pin` in the YamBMS documentation and used to manage the direction of data transmission for RS485 transceiver that do not handle this automatically. This `talk_pin` must be specified in your YAML. +> Set it with `uart_flow_control_pin: ${talk_pin}` in the `vars:` of the package that uses the UART. ## Overview diff --git a/documents/README/YamBMS_LP_YAML.md b/documents/README/YamBMS_LP_YAML.md index f2e0440..16828a5 100644 --- a/documents/README/YamBMS_LP_YAML.md +++ b/documents/README/YamBMS_LP_YAML.md @@ -422,17 +422,27 @@ You can keep the default configuration. The RS485 bus connected to your inverter via the RS485 transceiver `uart_esp_3`. +> [!NOTE] +> A package that uses a UART declares it itself from its `*_uart_id` var, so there is no UART to +> include separately. Each UART can only be used by one package. If your RS485 transceiver needs a +> `flow_control_pin`, add `uart_flow_control_pin: ${talk_pin}` to the `vars:` of that package +> (native ESP32 UART only, not on a WK2168 channel). + You can keep the default configuration and adapt the `uart` port on which the component must connect. ```YAML - rs485_pylon: !include - file: packages/yambms/yambms_rs485_pylon.yaml + rs485_1: !include + file: 'packages/yambms/yambms_rs485.yaml' + # file: 'packages/yambms/yambms_rs485_web_server.yaml' vars: - rs485_id: 'rs485_1' + rs485_id: '1' # Must be a number rs485_name: 'RS485 1' - rs485_uart_id: 'uart_esp_3' # UART interface to which your inverter is connected - rs485_uart_baud_rate: '9600' - rs485_update_timeout: '5s' + rs485_protocol: 'pylon' # pylon / voltronic + rs485_update_timeout: '10s' + rs485_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable + # UART setup + rs485_uart_id: 'uart_esp_3' # UART interface to which your inverter is connected + rs485_uart_baud_rate: '9600' # Default : 9600 / Epever : 115200 ``` ## Debug diff --git a/documents/README/YamBMS_RP_YAML.md b/documents/README/YamBMS_RP_YAML.md index 028c1b7..823a6db 100644 --- a/documents/README/YamBMS_RP_YAML.md +++ b/documents/README/YamBMS_RP_YAML.md @@ -434,21 +434,31 @@ You can keep the default configuration and adapt the `canbus` node on which the The RS485 bus connected to your inverter via the RS485 transceiver `uart_esp_3`. +> [!NOTE] +> A package that uses a UART declares it itself from its `*_uart_id` var, so there is no UART to +> include separately. Each UART can only be used by one package. If your RS485 transceiver needs a +> `flow_control_pin`, add `uart_flow_control_pin: ${talk_pin}` to the `vars:` of that package +> (native ESP32 UART only, not on a WK2168 channel). + You can keep the default configuration and adapt the `uart` port on which the component must connect. ```YAML - rs485_pylon: + rs485_1: url: https://github.com/Sleeper85/esphome-yambms ref: main refresh: 0s files: - - path: 'packages/yambms/yambms_rs485_pylon.yaml' + - path: 'packages/yambms/yambms_rs485.yaml' + # - path: 'packages/yambms/yambms_rs485_web_server.yaml' vars: - rs485_id: 'rs485_1' + rs485_id: '1' # Must be a number rs485_name: 'RS485 1' - rs485_uart_id: 'uart_esp_3' # UART interface to which your inverter is connected - rs485_uart_baud_rate: '9600' - rs485_update_timeout: '5s' + rs485_protocol: 'pylon' # pylon / voltronic + rs485_update_timeout: '10s' + rs485_status_led_id: 'esp_light' # LED used to show status; default = esp_light, comment out to disable + # UART setup + rs485_uart_id: 'uart_esp_3' # UART interface to which your inverter is connected + rs485_uart_baud_rate: '9600' # Default : 9600 / Epever : 115200 ``` ## Debug diff --git a/documents/README/changelog/Changelog.md b/documents/README/changelog/Changelog.md index c87f92f..841a715 100644 --- a/documents/README/changelog/Changelog.md +++ b/documents/README/changelog/Changelog.md @@ -7,11 +7,16 @@ ![GitHub watchers](https://img.shields.io/github/watchers/Sleeper85/esphome-yambms) * YamBMS 1.8.1 : + * Set esphome `min_version` to `2026.10.0` * **Breaking change** - New `Inverter brand` select and reworked `Protocol` select : selecting your inverter brand is enough, the protocol follows ; a protocol chosen explicitly still takes priority over the brand. Both selects are renamed, so their stored value is reset : **the inverter link stays inactive until you select your inverter brand**, see [release note](documents/README/changelog/Changelog_Inverter_brand_and_protocol.md) * Removed the `YamBMS name` select : the manufacturer name sent on CAN frame `0x35E` is now derived from the protocol in use, which is what the `Automatic` mode already did ; the `GOODWE`, `SHEnergy` and `BYD` names are no longer selectable - * The RS485 baud rate is now applied at runtime with `set_baud_rate()` + `load_settings()` instead of extending the `uart` component : `uart: !extend` only works on a native ESP32 UART, so boards using a UART expander (`wk2168` on the PVbrain2) had to include an internal file to avoid it ; every board now includes the same entry point + * **Breaking change** - A package that uses a UART now declares it itself from its `*_uart_id` var : remove the `board_options_itf_uart_*.yaml` includes and the `UART flow control` block from your YAML, otherwise ESPHome reports `ID uart_esp_1 redefined`. Each UART can only be used by one package + * Baud rates are set in the `vars:` of the package and keep their names ; packages that had none get `bms_uart_baud_rate`, `sniffer_uart_baud_rate` and `shunt_uart_baud_rate`, with the speed of the device as default + * New `uart_flow_control_pin` var on any package using a native ESP32 UART, which replaces the `board_options_itf_uart_flow_control.yaml` include ; the `_talk_pin` packages stay available for the rare setups that need them but are no longer shown in the examples + * WK2168 channels are now declared the same way : `board_options_itf_wk2168_spi.yaml` or `board_options_itf_wk2168_i2c.yaml` replaces the PVbrain2 files in your YAML, the `uartN_baudrate` substitutions and `uart_hub_bus` are removed (write `uart_spi_3`), and `board_options_itf_modbus_expander.yaml` and `shunt_combine_Victron_SmartShunt_UART_expander.yaml` are removed + * RS485 packages reorganised for the additional protocols to come : the file you include changes from `yambms_rs485_pylon.yaml` to `yambms_rs485.yaml`, which now takes a `rs485_protocol` var (`pylon` or `voltronic`) and includes the matching protocol implementation for you ; a node with several RS485 links on different UARTs can run a different protocol on each, one var per link ; `yambms_rs485_pylon_web_server.yaml` becomes `yambms_rs485_web_server.yaml` and must now be included alongside the entry point with its own `rs485_id`, instead of swapping one for the other, see [release note](documents/README/changelog/Changelog_Inverter_brand_and_protocol.md) * New diagnostic entities per inverter link : `Inverter link protocol` (what the link is actually doing, e.g. `Solis - CAN SMA`), `Inverter battery mode` (how to configure the battery type on the inverter, keyed on brand *and* protocol so that forcing a protocol never displays a wrong instruction) and `Note` (what is specific to that brand and protocol) diff --git a/documents/README/dev/Coding_conventions.md b/documents/README/dev/Coding_conventions.md index ad33744..29ad424 100644 --- a/documents/README/dev/Coding_conventions.md +++ b/documents/README/dev/Coding_conventions.md @@ -50,6 +50,24 @@ processes instances in the order their lambdas run, so ascending order completes round per interval; an out-of-order include still converges but spreads the round over several intervals. +## UART declaration + +A package that needs a UART imports it itself, from its `*_uart_id` var, and exposes the baud rate +under its own key. `uart_baud_rate` is the internal parameter of the UART file: never a key of a +package. + +```yaml +packages: + shunt_uart: !include + file: ../board/board_options_itf_${shunt_uart_id}.yaml + vars: + uart_baud_rate: ${shunt_uart_baud_rate | default(115200)} +``` + +Use `| default(...)` when the device has a usual speed, and leave it out when the speed depends on +the installation. Never put a fixed value there, nor the default in `substitutions:`. See +[Design_decisions.md](Design_decisions.md) for the reasons. + ## Entity IDs Entity IDs follow `${xxx_id}_`: diff --git a/documents/README/dev/Design_decisions.md b/documents/README/dev/Design_decisions.md index 679aec8..15223bc 100644 --- a/documents/README/dev/Design_decisions.md +++ b/documents/README/dev/Design_decisions.md @@ -384,6 +384,81 @@ This is why the Schneider XW Pro extended ACK needs no configuration, and why th `canbus_extended_ack` substitution was removed. Both triggers call the same script so the handler is not duplicated. +## A UART is declared by the package that consumes it + +**Files:** `packages/board/board_options_itf_uart_*.yaml`, every package taking a `*_uart_id` + +The main YAML names a UART once, in the `vars:` of the package that uses it, and that package +imports the matching `board_options_itf_${xxx_uart_id}.yaml`. It replaces a two-step declaration, +an `uart_esp_N` include followed by a `!extend` of the baud rate, which could not reach a WK2168 +channel: those live under `wk2168_spi[].uart[]`, so every consumer needed an `_expander` twin +without the `uart:` block. + +### One importer per UART + +Two imports of the same UART fail with `ID uart_esp_1 redefined`, on an expander channel too. Keep +it that way. Sharing a UART at two speeds has no valid meaning, and with the old `!extend` it did +not fail: the extended value simply won, so an inverter link declared at 115200 silently ran at +the 9600 of a BMS package on the same UART. + +This is why bus-level packages import the UART, not the per-BMS ones: a bus package is included +once, the BMS packages on that bus several times. + +### Each package keeps its key, `uart_baud_rate` stays internal + +Every package exposes its own key (`rs485_uart_baud_rate`, `pace_modbus_baud_rate`, +`shunt_uart_baud_rate`...) and maps it to `uart_baud_rate` in the `vars:` of the import. Do not +expose `uart_baud_rate` itself: with `${uart_baud_rate | default(...)}` in every package, one value +in a root `substitutions:` block would override all the consumers of the node, defaults included. + +The defaults live in that `| default()` and nowhere else: + +- **Not in `substitutions:`.** Package substitutions are merged into one global block, so + `bms_uart_baud_rate` would get the same value for JBD (9600), JK UART (115200) and JK Display + (2400), with no error. +- **Not in the UART file.** It does not know who imports it, and a wrong speed is valid + configuration that fails silently on the wire. This is what the old fixed `115200` hid: the JK + UART, JK sniffer and Junctek packages only worked because that value happened to suit them. +- **Not as a fixed value.** A value written in the `vars:` of the import takes priority over the + one passed by the user, who is ignored without a message. + +Leave `| default()` out when the speed depends on the installation (PACE, EG4, Seplos, BASEN): a +missing key then fails validation instead of picking a speed. + +`modbus_baud_rate` is the exception that keeps its place in `substitutions:`: `yambms_config.yaml` +shares it between the nodes of a multi-node setup from the root. + +### `flow_control` is enabled by a var, so `min_version` is 2026.10.0 + +`uart_flow_control_pin` is passed like any other var of the import and reaches the UART file, +which includes `board_options_itf_uart_flow_control.yaml` only when it is defined. So no consumer +has to know about it. + +`flow_control_pin: ${uart_flow_control_pin}` with an empty default is not an option, the UART +schema refuses a null pin. The `condition:` key of `!include` is what makes the pin optional, and +ESPHome 2026.8.0 ignores it: the file is included anyway and the configuration fails. Do not lower +`min_version` without replacing it. + +This `!extend` is the last one on a UART. It is not exposed to the user, and it works whatever the +order of the packages. + +### Expander channels + +`uart_spi_N` and `uart_i2c_N` are numbered like the PVbrain2 connectors: `0` to `3` on bridge 0, +`4` to `7` on bridge 1. Do not shift them to start at 1, every existing wiring would move by one +channel. + +Each channel adds itself with `!extend uart_bridgeN`, and the bridges are declared with an empty +`uart:` by `board_options_itf_wk2168_spi.yaml` or `board_options_itf_wk2168_i2c.yaml`. + +A WK2168 channel has no `flow_control_pin`, so `uart_flow_control_pin` is ignored there, without a +message. Its RS485 transceivers must handle the direction automatically. The `_talk_pin` packages +are kept for that one case: they drive a plain GPIO from the component, which works on any UART. +Everywhere else `uart_flow_control_pin` replaces them, and the examples no longer show them. + +The UART id must be readable when the `!include` filename is resolved. A value built from a +substitution declared in a package, such as `uart_${uart_hub_bus}_3`, is not, so write `uart_spi_3`. + ## Empirical constants Some constants were found by trial on real hardware and must not be rounded or harmonised. diff --git a/documents/README/dev/Project_structure.md b/documents/README/dev/Project_structure.md index 433156f..a8eece4 100644 --- a/documents/README/dev/Project_structure.md +++ b/documents/README/dev/Project_structure.md @@ -34,8 +34,14 @@ registry (`device_base_fault_registry.yaml`), memory and PSRAM debug helpers. ### `board/` One file per board (`board_ESP32-S3_*.yaml`) defining pins and GPIO. The `board_options_*.yaml` -files are optional building blocks — UART, CAN, PSRAM, LVGL display, WiFi AP — included -separately depending on the hardware. +files are optional building blocks — CAN, PSRAM, LVGL display, WiFi AP — included separately +depending on the hardware. + +The `board_options_itf_uart_*.yaml` files are the exception: they are not included from the main +YAML. Each one declares a single UART (`uart_esp_N`, `uart_N` on the RPi Pico, `uart_spi_N` and +`uart_i2c_N` on a WK2168) and is imported by the package that consumes that UART, from its +`*_uart_id` var. A WK2168 only needs `board_options_itf_wk2168_spi.yaml` or +`board_options_itf_wk2168_i2c.yaml` in the main YAML, which declares the bridges. ### `bms/`, `shunt/`, `balancer/` diff --git a/packages/base/device_base_esphome.yaml b/packages/base/device_base_esphome.yaml index a2b8484..7dfc540 100644 --- a/packages/base/device_base_esphome.yaml +++ b/packages/base/device_base_esphome.yaml @@ -1,4 +1,4 @@ -# Updated : 2026.09.02 +# Updated : 2026.11.05 # Version : 1.8.1 # GitHub : https://github.com/Sleeper85/esphome-yambms diff --git a/packages/bms/bms_combine_BASEN_RS485_controller.yaml b/packages/bms/bms_combine_BASEN_RS485_controller.yaml index 981d858..f9b5628 100644 --- a/packages/bms/bms_combine_BASEN_RS485_controller.yaml +++ b/packages/bms/bms_combine_BASEN_RS485_controller.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.08.14 -# Version : 1.1.3 +# Updated : 2026.11.05 +# Version : 1.1.4 # GitHub : https://github.com/GHswitt/esphome-basen # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -25,9 +25,11 @@ external_components: - source: github://GHswitt/esphome-basen@main refresh: 0s -uart: - - id: !extend ${basen_uart_id} - baud_rate: ${basen_uart_baud_rate} +packages: + basen_uart: !include + file: ../board/board_options_itf_${basen_uart_id}.yaml + vars: + uart_baud_rate: ${basen_uart_baud_rate} basen_controller: - uart_id: ${basen_uart_id} diff --git a/packages/bms/bms_combine_BASEN_RS485_controller_talk_pin.yaml b/packages/bms/bms_combine_BASEN_RS485_controller_talk_pin.yaml index e002ca7..acd3707 100644 --- a/packages/bms/bms_combine_BASEN_RS485_controller_talk_pin.yaml +++ b/packages/bms/bms_combine_BASEN_RS485_controller_talk_pin.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.08.14 -# Version : 1.1.2 +# Updated : 2026.11.05 +# Version : 1.1.3 # GitHub : https://github.com/GHswitt/esphome-basen # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -28,9 +28,11 @@ external_components: - source: github://GHswitt/esphome-basen@main refresh: 0s -uart: - - id: !extend ${basen_uart_id} - baud_rate: ${basen_uart_baud_rate} +packages: + basen_uart: !include + file: ../board/board_options_itf_${basen_uart_id}.yaml + vars: + uart_baud_rate: ${basen_uart_baud_rate} basen_controller: - uart_id: ${basen_uart_id} diff --git a/packages/bms/bms_combine_EG4_RS485_modbus.yaml b/packages/bms/bms_combine_EG4_RS485_modbus.yaml index 557eba9..67d249d 100644 --- a/packages/bms/bms_combine_EG4_RS485_modbus.yaml +++ b/packages/bms/bms_combine_EG4_RS485_modbus.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.08.15 -# Version : 2.0.2 +# Updated : 2026.11.05 +# Version : 2.0.3 # GitHub : https://github.com/RAR/esphome-eg4-bms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -25,9 +25,11 @@ external_components: - source: github://RAR/esphome-eg4-bms@v1.1.0 refresh: 0s -uart: - - id: !extend ${eg4_modbus_uart_id} - baud_rate: ${eg4_modbus_baud_rate} +packages: + eg4_uart: !include + file: ../board/board_options_itf_${eg4_modbus_uart_id}.yaml + vars: + uart_baud_rate: ${eg4_modbus_baud_rate} eg4_modbus: - uart_id: ${eg4_modbus_uart_id} diff --git a/packages/bms/bms_combine_Ecoworthy_RS485_modbus.yaml b/packages/bms/bms_combine_Ecoworthy_RS485_modbus.yaml index 1c1a1c6..b39cba5 100644 --- a/packages/bms/bms_combine_Ecoworthy_RS485_modbus.yaml +++ b/packages/bms/bms_combine_Ecoworthy_RS485_modbus.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.02.05 -# Version : 1.0.1 +# Updated : 2026.11.05 +# Version : 1.0.2 # GitHub : https://github.com/RAR/esphome-ecoworthy-bms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -30,15 +30,16 @@ substitutions: ecoworthy_modbus_id: modbus_ecoworthy - ecoworthy_modbus_baud_rate: '9600' external_components: - source: github://RAR/esphome-ecoworthy-bms@v1.0.0 refresh: 0s -uart: - - id: !extend ${ecoworthy_modbus_uart_id} - baud_rate: ${ecoworthy_modbus_baud_rate} +packages: + ecoworthy_uart: !include + file: ../board/board_options_itf_${ecoworthy_modbus_uart_id}.yaml + vars: + uart_baud_rate: ${ecoworthy_modbus_baud_rate | default(9600)} ecoworthy_modbus: - id: ${ecoworthy_modbus_id} diff --git a/packages/bms/bms_combine_JK_RS485_DISPLAY_full.yaml b/packages/bms/bms_combine_JK_RS485_DISPLAY_full.yaml index 72ff96b..abe0b60 100644 --- a/packages/bms/bms_combine_JK_RS485_DISPLAY_full.yaml +++ b/packages/bms/bms_combine_JK_RS485_DISPLAY_full.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.10.18 -# Version : 1.2.3 +# Updated : 2026.11.05 +# Version : 1.2.4 # GitHub : https://github.com/syssi/esphome-jk-bms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -27,6 +27,10 @@ packages: bms_protocol: "DISPLAY" bms_temperature_sensor: !include bms_temperature_sensor_2.yaml bms_battery_soh: !include bms_base_battery_soh.yaml + bms_uart: !include + file: ../board/board_options_itf_${bms_uart_id}.yaml + vars: + uart_baud_rate: ${bms_uart_baud_rate | default(2400)} substitutions: # (V) cell spread at which this BMS starts balancing. Not readable over the display @@ -81,10 +85,6 @@ external_components: - source: github://syssi/esphome-jk-bms@main refresh: 0s -uart: - - id: !extend ${bms_uart_id} - baud_rate: 2400 - jk_bms_display: - id: jk_bms_display${bms_id} uart_id: ${bms_uart_id} diff --git a/packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml b/packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml index 0d4e8a2..7f86ee3 100644 --- a/packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml +++ b/packages/bms/bms_combine_JK_RS485_Modbus_sniffer.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.09.02 -# Version : 1.3.4 +# Updated : 2026.11.05 +# Version : 1.3.5 # GitHub : https://github.com/txubelaxu/esphome-jk-bms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -23,6 +23,10 @@ substitutions: packages: modbus_sniffer: !include bms_base_sniffer_sub_device.yaml + sniffer_uart: !include + file: ../board/board_options_itf_${sniffer_uart_id}.yaml + vars: + uart_baud_rate: ${sniffer_uart_baud_rate | default(115200)} logger: tx_buffer_size: 1024 diff --git a/packages/bms/bms_combine_JK_RS485_Modbus_sniffer_talk_pin.yaml b/packages/bms/bms_combine_JK_RS485_Modbus_sniffer_talk_pin.yaml index cc67a56..7af5437 100644 --- a/packages/bms/bms_combine_JK_RS485_Modbus_sniffer_talk_pin.yaml +++ b/packages/bms/bms_combine_JK_RS485_Modbus_sniffer_talk_pin.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.08.14 -# Version : 1.3.3 +# Updated : 2026.11.05 +# Version : 1.3.4 # GitHub : https://github.com/txubelaxu/esphome-jk-bms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -23,6 +23,10 @@ substitutions: packages: modbus_sniffer: !include bms_base_sniffer_sub_device.yaml + sniffer_uart: !include + file: ../board/board_options_itf_${sniffer_uart_id}.yaml + vars: + uart_baud_rate: ${sniffer_uart_baud_rate | default(115200)} logger: tx_buffer_size: 1024 diff --git a/packages/bms/bms_combine_PACE_RS485_modbus.yaml b/packages/bms/bms_combine_PACE_RS485_modbus.yaml index 8da491a..50f9702 100644 --- a/packages/bms/bms_combine_PACE_RS485_modbus.yaml +++ b/packages/bms/bms_combine_PACE_RS485_modbus.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.08.14 -# Version : 1.1.3 +# Updated : 2026.11.05 +# Version : 1.1.4 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -25,9 +25,11 @@ substitutions: # Modbus Controller pace_modbus_update_interval: '5s' # Frequency with which BMS modbus servers are queried -uart: - - id: !extend ${pace_modbus_uart_id} - baud_rate: ${pace_modbus_baud_rate} +packages: + pace_uart: !include + file: ../board/board_options_itf_${pace_modbus_uart_id}.yaml + vars: + uart_baud_rate: ${pace_modbus_baud_rate} modbus: - uart_id: ${pace_modbus_uart_id} diff --git a/packages/bms/bms_combine_SEPLOS_V1_V2_RS485_modbus.yaml b/packages/bms/bms_combine_SEPLOS_V1_V2_RS485_modbus.yaml index bcb6405..eaf52f6 100644 --- a/packages/bms/bms_combine_SEPLOS_V1_V2_RS485_modbus.yaml +++ b/packages/bms/bms_combine_SEPLOS_V1_V2_RS485_modbus.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.08.14 -# Version : 1.1.3 +# Updated : 2026.11.05 +# Version : 1.1.4 # GitHub : https://github.com/syssi/esphome-seplos-bms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -30,9 +30,11 @@ external_components: - source: github://syssi/esphome-seplos-bms@main refresh: 0s -uart: - - id: !extend ${seplos_modbus_uart_id} - baud_rate: ${seplos_modbus_baud_rate} +packages: + seplos_uart: !include + file: ../board/board_options_itf_${seplos_modbus_uart_id}.yaml + vars: + uart_baud_rate: ${seplos_modbus_baud_rate} seplos_modbus: id: ${seplos_modbus_id} diff --git a/packages/bms/bms_combine_SEPLOS_V3_RS485_modbus_sniffer.yaml b/packages/bms/bms_combine_SEPLOS_V3_RS485_modbus_sniffer.yaml index 829ce8f..055a62c 100644 --- a/packages/bms/bms_combine_SEPLOS_V3_RS485_modbus_sniffer.yaml +++ b/packages/bms/bms_combine_SEPLOS_V3_RS485_modbus_sniffer.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.08.14 -# Version : 1.1.2 +# Updated : 2026.11.05 +# Version : 1.1.3 # GitHub : https://github.com/DpunktS/seplos_v3_sniffer # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -30,11 +30,13 @@ external_components: type: git url: https://github.com/DpunktS/seplos_v3_sniffer -uart: - - id: !extend ${seplos_uart_id} - baud_rate: ${seplos_baud_rate} - rx_buffer_size: 2048 - +packages: + seplos_uart: !include + file: ../board/board_options_itf_${seplos_uart_id}.yaml + vars: + uart_baud_rate: ${seplos_baud_rate} + uart_rx_buffer_size: '2048' + seplos_parser: id: ${seplos_parser_id} uart_id: ${seplos_uart_id} diff --git a/packages/bms/bms_sensors_JBD_UART_full.yaml b/packages/bms/bms_sensors_JBD_UART_full.yaml index 792436c..00ffb68 100644 --- a/packages/bms/bms_sensors_JBD_UART_full.yaml +++ b/packages/bms/bms_sensors_JBD_UART_full.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.02.05 -# Version : 1.2.2 +# Updated : 2026.11.05 +# Version : 1.2.3 # GitHub : https://github.com/syssi/esphome-jdb-bms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -22,6 +22,10 @@ packages: bms_temperature_sensor: !include bms_temperature_sensor_6.yaml bms_errors_bitmask: !include bms_errors_bitmask_JBD.yaml bms_battery_soh: !include bms_base_battery_soh.yaml + bms_uart: !include + file: ../board/board_options_itf_${bms_uart_id}.yaml + vars: + uart_baud_rate: ${bms_uart_baud_rate | default(9600)} # +--------------------------------------+ # | Component settings | @@ -31,10 +35,6 @@ external_components: - source: github://syssi/esphome-jbd-bms@main refresh: 0s -uart: - - id: !extend ${bms_uart_id} - baud_rate: 9600 - jbd_bms: - id: jbd_bms${bms_id} uart_id: ${bms_uart_id} diff --git a/packages/bms/bms_sensors_JK_UART_4G-GPS_full.yaml b/packages/bms/bms_sensors_JK_UART_4G-GPS_full.yaml index b441a6a..6c77d27 100644 --- a/packages/bms/bms_sensors_JK_UART_4G-GPS_full.yaml +++ b/packages/bms/bms_sensors_JK_UART_4G-GPS_full.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.06.22 -# Version : 1.3.7 +# Updated : 2026.11.05 +# Version : 1.3.8 # GitHub : https://github.com/syssi/esphome-jk-bms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -22,6 +22,10 @@ packages: bms_temperature_sensor: !include bms_temperature_sensor_2.yaml bms_errors_bitmask: !include bms_errors_bitmask_JK_UART_4G-GPS.yaml bms_battery_soh: !include bms_base_battery_soh.yaml + bms_uart: !include + file: ../board/board_options_itf_${bms_uart_id}.yaml + vars: + uart_baud_rate: ${bms_uart_baud_rate | default(115200)} # +--------------------------------------+ # | Component settings | diff --git a/packages/board/board_ESP32-P4_M5Stack-Tab5.yaml b/packages/board/board_ESP32-P4_M5Stack-Tab5.yaml index e35abcd..0d6652e 100644 --- a/packages/board/board_ESP32-P4_M5Stack-Tab5.yaml +++ b/packages/board/board_ESP32-P4_M5Stack-Tab5.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.07.30 -# Version : 1.1.4 +# Updated : 2026.11.05 +# Version : 1.1.5 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -32,7 +32,7 @@ # | - RS485 (SP3485): TX=G6, RX=G7 (uses Port C pins on M5-Bus) # | - TTL UART: TX=G37, RX=G38 (uses UART0 pins on M5-Bus) # | Include board_options_itf_canbus_mcp2515.yaml for CAN -# | Include board_options_itf_uart_1.yaml + board_options_itf_modbus.yaml for RS485 +# | Include board_options_itf_modbus.yaml with modbus_uart_id: uart_esp_1 for RS485 # | # +--------------------------------------------------------------------------------------------+ # | DIN BASE (M132) Configuration diff --git a/packages/board/board_options_itf_modbus.yaml b/packages/board/board_options_itf_modbus.yaml index 371b711..d4d3e6b 100644 --- a/packages/board/board_options_itf_modbus.yaml +++ b/packages/board/board_options_itf_modbus.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.08.26 -# Version : 1.1.5 +# Updated : 2026.11.05 +# Version : 1.1.6 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -27,9 +27,11 @@ substitutions: # Modbus Controller modbus_update_interval: '5s' # Frequency with which BMS/Balancer/Shunt (modbus servers) are queried -uart: - - id: !extend ${modbus_uart_id} - baud_rate: ${modbus_baud_rate} +packages: + modbus_uart: !include + file: ../board/board_options_itf_${modbus_uart_id}.yaml + vars: + uart_baud_rate: ${modbus_baud_rate} modbus: - uart_id: ${modbus_uart_id} diff --git a/packages/board/board_options_itf_uart_1.yaml b/packages/board/board_options_itf_uart_1.yaml index 903475e..576603d 100644 --- a/packages/board/board_options_itf_uart_1.yaml +++ b/packages/board/board_options_itf_uart_1.yaml @@ -1,5 +1,5 @@ -# Updated : 2025.06.18 -# Version : 1.1.1 +# Updated : 2026.11.05 +# Version : 1.1.2 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -17,9 +17,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. + uart: - id: uart_1 tx_pin: ${tx_pin_1} rx_pin: ${rx_pin_1} - baud_rate: 19200 - rx_buffer_size: 256 + baud_rate: ${uart_baud_rate} + rx_buffer_size: ${uart_rx_buffer_size | default(256)} diff --git a/packages/board/board_options_itf_uart_2.yaml b/packages/board/board_options_itf_uart_2.yaml index cd0ed65..abf9c83 100644 --- a/packages/board/board_options_itf_uart_2.yaml +++ b/packages/board/board_options_itf_uart_2.yaml @@ -1,5 +1,5 @@ -# Updated : 2025.06.18 -# Version : 1.1.1 +# Updated : 2026.11.05 +# Version : 1.1.2 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -17,9 +17,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. + uart: - id: uart_2 tx_pin: ${tx_pin_2} rx_pin: ${rx_pin_2} - baud_rate: 19200 - rx_buffer_size: 256 + baud_rate: ${uart_baud_rate} + rx_buffer_size: ${uart_rx_buffer_size | default(256)} diff --git a/packages/board/board_options_itf_uart_3.yaml b/packages/board/board_options_itf_uart_3.yaml index c0ad4be..2488ad8 100644 --- a/packages/board/board_options_itf_uart_3.yaml +++ b/packages/board/board_options_itf_uart_3.yaml @@ -1,5 +1,5 @@ -# Updated : 2025.06.18 -# Version : 1.1.1 +# Updated : 2026.11.05 +# Version : 1.1.2 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -17,9 +17,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. + uart: - id: uart_3 tx_pin: ${tx_pin_3} rx_pin: ${rx_pin_3} - baud_rate: 19200 - rx_buffer_size: 256 + baud_rate: ${uart_baud_rate} + rx_buffer_size: ${uart_rx_buffer_size | default(256)} diff --git a/packages/board/board_options_itf_uart_4.yaml b/packages/board/board_options_itf_uart_4.yaml index 5e2548c..0101f96 100644 --- a/packages/board/board_options_itf_uart_4.yaml +++ b/packages/board/board_options_itf_uart_4.yaml @@ -1,5 +1,5 @@ -# Updated : 2025.06.18 -# Version : 1.1.1 +# Updated : 2026.11.05 +# Version : 1.1.2 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -17,9 +17,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. + uart: - id: uart_4 tx_pin: ${tx_pin_4} rx_pin: ${rx_pin_4} - baud_rate: 19200 - rx_buffer_size: 256 + baud_rate: ${uart_baud_rate} + rx_buffer_size: ${uart_rx_buffer_size | default(256)} diff --git a/packages/board/board_options_itf_uart_5.yaml b/packages/board/board_options_itf_uart_5.yaml index 35855fd..760e249 100644 --- a/packages/board/board_options_itf_uart_5.yaml +++ b/packages/board/board_options_itf_uart_5.yaml @@ -1,5 +1,5 @@ -# Updated : 2025.06.18 -# Version : 1.1.1 +# Updated : 2026.11.05 +# Version : 1.1.2 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -17,9 +17,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. + uart: - id: uart_5 tx_pin: ${tx_pin_5} rx_pin: ${rx_pin_5} - baud_rate: 19200 - rx_buffer_size: 256 + baud_rate: ${uart_baud_rate} + rx_buffer_size: ${uart_rx_buffer_size | default(256)} diff --git a/packages/board/board_options_itf_uart_6.yaml b/packages/board/board_options_itf_uart_6.yaml index a1721d4..7bd5942 100644 --- a/packages/board/board_options_itf_uart_6.yaml +++ b/packages/board/board_options_itf_uart_6.yaml @@ -1,5 +1,5 @@ -# Updated : 2025.06.18 -# Version : 1.1.1 +# Updated : 2026.11.05 +# Version : 1.1.2 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -17,9 +17,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. + uart: - id: uart_6 tx_pin: ${tx_pin_6} rx_pin: ${rx_pin_6} - baud_rate: 19200 - rx_buffer_size: 256 + baud_rate: ${uart_baud_rate} + rx_buffer_size: ${uart_rx_buffer_size | default(256)} diff --git a/packages/board/board_options_itf_uart_esp_1.yaml b/packages/board/board_options_itf_uart_esp_1.yaml index 7b6520a..2c620bb 100644 --- a/packages/board/board_options_itf_uart_esp_1.yaml +++ b/packages/board/board_options_itf_uart_esp_1.yaml @@ -1,5 +1,5 @@ -# Updated : 2025.04.02 -# Version : 1.1.1 +# Updated : 2026.11.05 +# Version : 1.1.2 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -17,9 +17,19 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. +# Optional vars of that import : `uart_rx_buffer_size`, `uart_flow_control_pin`. + +packages: + flow_control: !include + file: board_options_itf_uart_flow_control.yaml + condition: ${uart_flow_control_pin is defined} + vars: + uart_id: uart_esp_1 + uart: - id: uart_esp_1 tx_pin: ${tx_pin_1} rx_pin: ${rx_pin_1} - baud_rate: 115200 - rx_buffer_size: 512 + baud_rate: ${uart_baud_rate} + rx_buffer_size: ${uart_rx_buffer_size | default(512)} diff --git a/packages/board/board_options_itf_uart_esp_2.yaml b/packages/board/board_options_itf_uart_esp_2.yaml index ffe8459..adbe096 100644 --- a/packages/board/board_options_itf_uart_esp_2.yaml +++ b/packages/board/board_options_itf_uart_esp_2.yaml @@ -1,5 +1,5 @@ -# Updated : 2025.04.02 -# Version : 1.1.1 +# Updated : 2026.11.05 +# Version : 1.1.2 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -17,9 +17,19 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. +# Optional vars of that import : `uart_rx_buffer_size`, `uart_flow_control_pin`. + +packages: + flow_control: !include + file: board_options_itf_uart_flow_control.yaml + condition: ${uart_flow_control_pin is defined} + vars: + uart_id: uart_esp_2 + uart: - id: uart_esp_2 tx_pin: ${tx_pin_2} rx_pin: ${rx_pin_2} - baud_rate: 115200 - rx_buffer_size: 512 + baud_rate: ${uart_baud_rate} + rx_buffer_size: ${uart_rx_buffer_size | default(512)} diff --git a/packages/board/board_options_itf_uart_esp_3.yaml b/packages/board/board_options_itf_uart_esp_3.yaml index 1747ff1..2883790 100644 --- a/packages/board/board_options_itf_uart_esp_3.yaml +++ b/packages/board/board_options_itf_uart_esp_3.yaml @@ -1,5 +1,5 @@ -# Updated : 2025.04.02 -# Version : 1.1.1 +# Updated : 2026.11.05 +# Version : 1.1.2 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -17,9 +17,19 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. +# Optional vars of that import : `uart_rx_buffer_size`, `uart_flow_control_pin`. + +packages: + flow_control: !include + file: board_options_itf_uart_flow_control.yaml + condition: ${uart_flow_control_pin is defined} + vars: + uart_id: uart_esp_3 + uart: - id: uart_esp_3 tx_pin: ${tx_pin_3} rx_pin: ${rx_pin_3} - baud_rate: 115200 - rx_buffer_size: 512 + baud_rate: ${uart_baud_rate} + rx_buffer_size: ${uart_rx_buffer_size | default(512)} diff --git a/packages/shunt/shunt_combine_Victron_SmartShunt_UART_expander.yaml b/packages/board/board_options_itf_uart_i2c_0.yaml similarity index 65% rename from packages/shunt/shunt_combine_Victron_SmartShunt_UART_expander.yaml rename to packages/board/board_options_itf_uart_i2c_0.yaml index e450526..7bad589 100644 --- a/packages/shunt/shunt_combine_Victron_SmartShunt_UART_expander.yaml +++ b/packages/board/board_options_itf_uart_i2c_0.yaml @@ -1,6 +1,6 @@ -# Updated : 2024.12.23 +# Updated : 2026.11.05 # Version : 1.1.1 -# GitHub : https://github.com/Sleeper85/esphome-junctek_khf +# GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -17,6 +17,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -packages: - shunt_sensors: !include shunt_sensors_Victron_SmartShunt_UART.yaml - shunt_combine: !include shunt_combine.yaml +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. +# `uart_flow_control_pin` does not exist on an expander channel and is ignored. + +wk2168_i2c: + - id: !extend uart_bridge0 + uart: + - id: uart_i2c_0 + channel: 0 + baud_rate: ${uart_baud_rate} diff --git a/packages/board/board_options_itf_modbus_expander.yaml b/packages/board/board_options_itf_uart_i2c_1.yaml similarity index 52% rename from packages/board/board_options_itf_modbus_expander.yaml rename to packages/board/board_options_itf_uart_i2c_1.yaml index 6543435..cec7048 100644 --- a/packages/board/board_options_itf_modbus_expander.yaml +++ b/packages/board/board_options_itf_uart_i2c_1.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.08.26 -# Version : 1.1.5 +# Updated : 2026.11.05 +# Version : 1.1.1 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -17,19 +17,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -substitutions: - # UART - modbus_baud_rate: '19200' # 9600 / 19200 / 115200 - # Modbus - modbus_id: '1' - modbus_send_wait_time: '200ms' # Timeout: max time to wait for the FIRST byte of a response - modbus_turnaround_time: '0ms' # Pause after a completed response before the next command - # Modbus Controller - modbus_update_interval: '5s' # Frequency with which BMS/Balancer/Shunt (modbus servers) are queried +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. +# `uart_flow_control_pin` does not exist on an expander channel and is ignored. -modbus: - - uart_id: ${modbus_uart_id} - id: modbus_${modbus_role}_${modbus_id} - role: ${modbus_role} - send_wait_time: ${modbus_send_wait_time} - turnaround_time: ${modbus_turnaround_time} +wk2168_i2c: + - id: !extend uart_bridge0 + uart: + - id: uart_i2c_1 + channel: 1 + baud_rate: ${uart_baud_rate} diff --git a/packages/board/board_options_itf_uart_i2c_2.yaml b/packages/board/board_options_itf_uart_i2c_2.yaml new file mode 100644 index 0000000..36849b9 --- /dev/null +++ b/packages/board/board_options_itf_uart_i2c_2.yaml @@ -0,0 +1,28 @@ +# Updated : 2026.11.05 +# Version : 1.1.1 +# GitHub : https://github.com/Sleeper85/esphome-yambms + +# YamBMS ( Yet another multi-BMS Merging Solution ) + +# This YAML is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. +# `uart_flow_control_pin` does not exist on an expander channel and is ignored. + +wk2168_i2c: + - id: !extend uart_bridge0 + uart: + - id: uart_i2c_2 + channel: 2 + baud_rate: ${uart_baud_rate} diff --git a/packages/board/board_options_itf_uart_i2c_3.yaml b/packages/board/board_options_itf_uart_i2c_3.yaml new file mode 100644 index 0000000..795461b --- /dev/null +++ b/packages/board/board_options_itf_uart_i2c_3.yaml @@ -0,0 +1,28 @@ +# Updated : 2026.11.05 +# Version : 1.1.1 +# GitHub : https://github.com/Sleeper85/esphome-yambms + +# YamBMS ( Yet another multi-BMS Merging Solution ) + +# This YAML is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. +# `uart_flow_control_pin` does not exist on an expander channel and is ignored. + +wk2168_i2c: + - id: !extend uart_bridge0 + uart: + - id: uart_i2c_3 + channel: 3 + baud_rate: ${uart_baud_rate} diff --git a/packages/board/board_options_itf_uart_i2c_4.yaml b/packages/board/board_options_itf_uart_i2c_4.yaml new file mode 100644 index 0000000..936019e --- /dev/null +++ b/packages/board/board_options_itf_uart_i2c_4.yaml @@ -0,0 +1,28 @@ +# Updated : 2026.11.05 +# Version : 1.1.1 +# GitHub : https://github.com/Sleeper85/esphome-yambms + +# YamBMS ( Yet another multi-BMS Merging Solution ) + +# This YAML is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. +# `uart_flow_control_pin` does not exist on an expander channel and is ignored. + +wk2168_i2c: + - id: !extend uart_bridge1 + uart: + - id: uart_i2c_4 + channel: 0 + baud_rate: ${uart_baud_rate} diff --git a/packages/board/board_options_itf_uart_i2c_5.yaml b/packages/board/board_options_itf_uart_i2c_5.yaml new file mode 100644 index 0000000..30b3bd1 --- /dev/null +++ b/packages/board/board_options_itf_uart_i2c_5.yaml @@ -0,0 +1,28 @@ +# Updated : 2026.11.05 +# Version : 1.1.1 +# GitHub : https://github.com/Sleeper85/esphome-yambms + +# YamBMS ( Yet another multi-BMS Merging Solution ) + +# This YAML is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. +# `uart_flow_control_pin` does not exist on an expander channel and is ignored. + +wk2168_i2c: + - id: !extend uart_bridge1 + uart: + - id: uart_i2c_5 + channel: 1 + baud_rate: ${uart_baud_rate} diff --git a/packages/board/board_options_itf_uart_i2c_6.yaml b/packages/board/board_options_itf_uart_i2c_6.yaml new file mode 100644 index 0000000..988cd62 --- /dev/null +++ b/packages/board/board_options_itf_uart_i2c_6.yaml @@ -0,0 +1,28 @@ +# Updated : 2026.11.05 +# Version : 1.1.1 +# GitHub : https://github.com/Sleeper85/esphome-yambms + +# YamBMS ( Yet another multi-BMS Merging Solution ) + +# This YAML is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. +# `uart_flow_control_pin` does not exist on an expander channel and is ignored. + +wk2168_i2c: + - id: !extend uart_bridge1 + uart: + - id: uart_i2c_6 + channel: 2 + baud_rate: ${uart_baud_rate} diff --git a/packages/board/board_options_itf_uart_i2c_7.yaml b/packages/board/board_options_itf_uart_i2c_7.yaml new file mode 100644 index 0000000..ee19694 --- /dev/null +++ b/packages/board/board_options_itf_uart_i2c_7.yaml @@ -0,0 +1,28 @@ +# Updated : 2026.11.05 +# Version : 1.1.1 +# GitHub : https://github.com/Sleeper85/esphome-yambms + +# YamBMS ( Yet another multi-BMS Merging Solution ) + +# This YAML is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. +# `uart_flow_control_pin` does not exist on an expander channel and is ignored. + +wk2168_i2c: + - id: !extend uart_bridge1 + uart: + - id: uart_i2c_7 + channel: 3 + baud_rate: ${uart_baud_rate} diff --git a/packages/board/board_options_itf_uart_spi_0.yaml b/packages/board/board_options_itf_uart_spi_0.yaml new file mode 100644 index 0000000..c4683ad --- /dev/null +++ b/packages/board/board_options_itf_uart_spi_0.yaml @@ -0,0 +1,28 @@ +# Updated : 2026.11.05 +# Version : 1.1.1 +# GitHub : https://github.com/Sleeper85/esphome-yambms + +# YamBMS ( Yet another multi-BMS Merging Solution ) + +# This YAML is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. +# `uart_flow_control_pin` does not exist on an expander channel and is ignored. + +wk2168_spi: + - id: !extend uart_bridge0 + uart: + - id: uart_spi_0 + channel: 0 + baud_rate: ${uart_baud_rate} diff --git a/packages/board/board_options_itf_uart_spi_1.yaml b/packages/board/board_options_itf_uart_spi_1.yaml new file mode 100644 index 0000000..199a104 --- /dev/null +++ b/packages/board/board_options_itf_uart_spi_1.yaml @@ -0,0 +1,28 @@ +# Updated : 2026.11.05 +# Version : 1.1.1 +# GitHub : https://github.com/Sleeper85/esphome-yambms + +# YamBMS ( Yet another multi-BMS Merging Solution ) + +# This YAML is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. +# `uart_flow_control_pin` does not exist on an expander channel and is ignored. + +wk2168_spi: + - id: !extend uart_bridge0 + uart: + - id: uart_spi_1 + channel: 1 + baud_rate: ${uart_baud_rate} diff --git a/packages/board/board_options_itf_uart_spi_2.yaml b/packages/board/board_options_itf_uart_spi_2.yaml new file mode 100644 index 0000000..17f6a66 --- /dev/null +++ b/packages/board/board_options_itf_uart_spi_2.yaml @@ -0,0 +1,28 @@ +# Updated : 2026.11.05 +# Version : 1.1.1 +# GitHub : https://github.com/Sleeper85/esphome-yambms + +# YamBMS ( Yet another multi-BMS Merging Solution ) + +# This YAML is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. +# `uart_flow_control_pin` does not exist on an expander channel and is ignored. + +wk2168_spi: + - id: !extend uart_bridge0 + uart: + - id: uart_spi_2 + channel: 2 + baud_rate: ${uart_baud_rate} diff --git a/packages/board/board_options_itf_uart_spi_3.yaml b/packages/board/board_options_itf_uart_spi_3.yaml new file mode 100644 index 0000000..cc5f500 --- /dev/null +++ b/packages/board/board_options_itf_uart_spi_3.yaml @@ -0,0 +1,28 @@ +# Updated : 2026.11.05 +# Version : 1.1.1 +# GitHub : https://github.com/Sleeper85/esphome-yambms + +# YamBMS ( Yet another multi-BMS Merging Solution ) + +# This YAML is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. +# `uart_flow_control_pin` does not exist on an expander channel and is ignored. + +wk2168_spi: + - id: !extend uart_bridge0 + uart: + - id: uart_spi_3 + channel: 3 + baud_rate: ${uart_baud_rate} diff --git a/packages/board/board_options_itf_uart_spi_4.yaml b/packages/board/board_options_itf_uart_spi_4.yaml new file mode 100644 index 0000000..446ebe9 --- /dev/null +++ b/packages/board/board_options_itf_uart_spi_4.yaml @@ -0,0 +1,28 @@ +# Updated : 2026.11.05 +# Version : 1.1.1 +# GitHub : https://github.com/Sleeper85/esphome-yambms + +# YamBMS ( Yet another multi-BMS Merging Solution ) + +# This YAML is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. +# `uart_flow_control_pin` does not exist on an expander channel and is ignored. + +wk2168_spi: + - id: !extend uart_bridge1 + uart: + - id: uart_spi_4 + channel: 0 + baud_rate: ${uart_baud_rate} diff --git a/packages/board/board_options_itf_uart_spi_5.yaml b/packages/board/board_options_itf_uart_spi_5.yaml new file mode 100644 index 0000000..db2c0a9 --- /dev/null +++ b/packages/board/board_options_itf_uart_spi_5.yaml @@ -0,0 +1,28 @@ +# Updated : 2026.11.05 +# Version : 1.1.1 +# GitHub : https://github.com/Sleeper85/esphome-yambms + +# YamBMS ( Yet another multi-BMS Merging Solution ) + +# This YAML is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. +# `uart_flow_control_pin` does not exist on an expander channel and is ignored. + +wk2168_spi: + - id: !extend uart_bridge1 + uart: + - id: uart_spi_5 + channel: 1 + baud_rate: ${uart_baud_rate} diff --git a/packages/board/board_options_itf_uart_spi_6.yaml b/packages/board/board_options_itf_uart_spi_6.yaml new file mode 100644 index 0000000..cb7c407 --- /dev/null +++ b/packages/board/board_options_itf_uart_spi_6.yaml @@ -0,0 +1,28 @@ +# Updated : 2026.11.05 +# Version : 1.1.1 +# GitHub : https://github.com/Sleeper85/esphome-yambms + +# YamBMS ( Yet another multi-BMS Merging Solution ) + +# This YAML is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. +# `uart_flow_control_pin` does not exist on an expander channel and is ignored. + +wk2168_spi: + - id: !extend uart_bridge1 + uart: + - id: uart_spi_6 + channel: 2 + baud_rate: ${uart_baud_rate} diff --git a/packages/board/board_options_itf_uart_spi_7.yaml b/packages/board/board_options_itf_uart_spi_7.yaml new file mode 100644 index 0000000..37bc3da --- /dev/null +++ b/packages/board/board_options_itf_uart_spi_7.yaml @@ -0,0 +1,28 @@ +# Updated : 2026.11.05 +# Version : 1.1.1 +# GitHub : https://github.com/Sleeper85/esphome-yambms + +# YamBMS ( Yet another multi-BMS Merging Solution ) + +# This YAML is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Imported by the package that consumes this UART, which passes `uart_baud_rate`. +# `uart_flow_control_pin` does not exist on an expander channel and is ignored. + +wk2168_spi: + - id: !extend uart_bridge1 + uart: + - id: uart_spi_7 + channel: 3 + baud_rate: ${uart_baud_rate} diff --git a/packages/board/board_options_itf_pvbrain2_wk2168_i2c.yaml b/packages/board/board_options_itf_wk2168_i2c.yaml similarity index 57% rename from packages/board/board_options_itf_pvbrain2_wk2168_i2c.yaml rename to packages/board/board_options_itf_wk2168_i2c.yaml index 1915058..f0686e5 100644 --- a/packages/board/board_options_itf_pvbrain2_wk2168_i2c.yaml +++ b/packages/board/board_options_itf_wk2168_i2c.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.08.26 -# Version : 1.1.2 +# Updated : 2026.11.05 +# Version : 1.1.1 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -18,7 +18,6 @@ # along with this program. If not, see . substitutions: - uart_hub_bus: 'i2c' wk2168_i2c_id: 'wk2168_i2c_bus' i2c: @@ -32,36 +31,7 @@ wk2168_i2c: id: uart_bridge0 i2c_id: ${wk2168_i2c_id} uart: - - id: uart_i2c_0 - channel: 0 - baud_rate: ${uart0_baudrate} - # parity: even - - id: uart_i2c_1 - channel: 1 - baud_rate: ${uart1_baudrate} - - id: uart_i2c_2 - channel: 2 - baud_rate: ${uart2_baudrate} - # parity: even - - id: uart_i2c_3 - channel: 3 - baud_rate: ${uart3_baudrate} - - address: 0x70 id: uart_bridge1 i2c_id: ${wk2168_i2c_id} uart: - - id: uart_i2c_4 - channel: 0 - baud_rate: ${uart4_baudrate} - # parity: even - - id: uart_i2c_5 - channel: 1 - baud_rate: ${uart5_baudrate} - - id: uart_i2c_6 - channel: 2 - baud_rate: ${uart6_baudrate} - # parity: even - - id: uart_i2c_7 - channel: 3 - baud_rate: ${uart7_baudrate} diff --git a/packages/board/board_options_itf_pvbrain2_wk2168_spi.yaml b/packages/board/board_options_itf_wk2168_spi.yaml similarity index 59% rename from packages/board/board_options_itf_pvbrain2_wk2168_spi.yaml rename to packages/board/board_options_itf_wk2168_spi.yaml index 91a623b..24b1a0a 100644 --- a/packages/board/board_options_itf_pvbrain2_wk2168_spi.yaml +++ b/packages/board/board_options_itf_wk2168_spi.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.08.26 -# Version : 1.1.2 +# Updated : 2026.11.05 +# Version : 1.1.1 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -18,7 +18,6 @@ # along with this program. If not, see . substitutions: - uart_hub_bus: 'spi' spi_data_rate: '4Mhz' wk2168_spi_id: 'wk2168_spi_bus' @@ -33,39 +32,9 @@ wk2168_spi: spi_id: ${wk2168_spi_id} cs_pin: ${wk2168_spi_cs0} data_rate: ${spi_data_rate} - #test_mode: 1 uart: - - id: uart_spi_0 - channel: 0 - baud_rate: ${uart0_baudrate} - #parity: even - - id: uart_spi_1 - channel: 1 - baud_rate: ${uart1_baudrate} - - id: uart_spi_2 - channel: 2 - baud_rate: ${uart2_baudrate} - #parity: even - - id: uart_spi_3 - channel: 3 - baud_rate: ${uart3_baudrate} - - id: uart_bridge1 spi_id: ${wk2168_spi_id} cs_pin: ${wk2168_spi_cs1} data_rate: ${spi_data_rate} uart: - - id: uart_spi_4 - channel: 0 - baud_rate: ${uart4_baudrate} - #parity: even - - id: uart_spi_5 - channel: 1 - baud_rate: ${uart5_baudrate} - - id: uart_spi_6 - channel: 2 - baud_rate: ${uart6_baudrate} - #parity: even - - id: uart_spi_7 - channel: 3 - baud_rate: ${uart7_baudrate} diff --git a/packages/shunt/shunt_combine_Victron_SmartShunt_UART.yaml b/packages/shunt/shunt_combine_Victron_SmartShunt_UART.yaml index a07d077..5f13fdd 100644 --- a/packages/shunt/shunt_combine_Victron_SmartShunt_UART.yaml +++ b/packages/shunt/shunt_combine_Victron_SmartShunt_UART.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.12.23 -# Version : 1.1.1 +# Updated : 2026.11.05 +# Version : 1.1.2 # GitHub : https://github.com/Sleeper85/esphome-junctek_khf # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -25,7 +25,3 @@ packages: # | Component settings | # +--------------------------------------+ -uart: - - id: !extend ${shunt_uart_id} - baud_rate: 19200 - rx_buffer_size: 256 diff --git a/packages/shunt/shunt_modbus_Victron_SmartShunt_UART.yaml b/packages/shunt/shunt_modbus_Victron_SmartShunt_UART.yaml index 42fc261..522e8a5 100644 --- a/packages/shunt/shunt_modbus_Victron_SmartShunt_UART.yaml +++ b/packages/shunt/shunt_modbus_Victron_SmartShunt_UART.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.12.23 -# Version : 1.1.1 +# Updated : 2026.11.05 +# Version : 1.1.2 # GitHub : https://github.com/Sleeper85/esphome-junctek_khf # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -25,7 +25,3 @@ packages: # | Component settings | # +--------------------------------------+ -uart: - - id: !extend ${shunt_uart_id} - baud_rate: 19200 - rx_buffer_size: 256 diff --git a/packages/shunt/shunt_modbus_Victron_SmartShunt_UART_minimal.yaml b/packages/shunt/shunt_modbus_Victron_SmartShunt_UART_minimal.yaml index 4796728..7778f78 100644 --- a/packages/shunt/shunt_modbus_Victron_SmartShunt_UART_minimal.yaml +++ b/packages/shunt/shunt_modbus_Victron_SmartShunt_UART_minimal.yaml @@ -1,5 +1,5 @@ -# Updated : 2025.04.23 -# Version : 1.1.1 +# Updated : 2026.11.05 +# Version : 1.1.2 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -25,7 +25,3 @@ packages: # | Component settings | # +--------------------------------------+ -uart: - - id: !extend ${shunt_uart_id} - baud_rate: 19200 - rx_buffer_size: 256 diff --git a/packages/shunt/shunt_sensors_Junctek_KHF_UART.yaml b/packages/shunt/shunt_sensors_Junctek_KHF_UART.yaml index 135b0ad..dcc5155 100644 --- a/packages/shunt/shunt_sensors_Junctek_KHF_UART.yaml +++ b/packages/shunt/shunt_sensors_Junctek_KHF_UART.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.02.05 -# Version : 1.1.8 +# Updated : 2026.11.05 +# Version : 1.1.9 # GitHub : https://github.com/Sleeper85/esphome-junctek_khf # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -19,6 +19,10 @@ packages: shunt_base: !include shunt_base.yaml + shunt_uart: !include + file: ../board/board_options_itf_${shunt_uart_id}.yaml + vars: + uart_baud_rate: ${shunt_uart_baud_rate | default(115200)} # +--------------------------------------+ # | Component settings | @@ -31,8 +35,6 @@ external_components: # type: local # path: components -# UART baud_rate : 115200 - # +--------------------------------------+ # | Component entities | # +--------------------------------------+ diff --git a/packages/shunt/shunt_sensors_Victron_SmartShunt_UART.yaml b/packages/shunt/shunt_sensors_Victron_SmartShunt_UART.yaml index 40631bb..d517b69 100644 --- a/packages/shunt/shunt_sensors_Victron_SmartShunt_UART.yaml +++ b/packages/shunt/shunt_sensors_Victron_SmartShunt_UART.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.02.16 -# Version : 1.1.9 +# Updated : 2026.11.05 +# Version : 1.2.0 # GitHub : https://github.com/KinDR007/VictronMPPT-ESPHOME # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -19,6 +19,11 @@ packages: shunt_base: !include shunt_base.yaml + shunt_uart: !include + file: ../board/board_options_itf_${shunt_uart_id}.yaml + vars: + uart_baud_rate: ${shunt_uart_baud_rate | default(19200)} + uart_rx_buffer_size: '256' # +--------------------------------------+ # | Component settings | diff --git a/packages/shunt/shunt_sensors_Victron_SmartShunt_UART_minimal.yaml b/packages/shunt/shunt_sensors_Victron_SmartShunt_UART_minimal.yaml index a2e1e29..24dd2f7 100644 --- a/packages/shunt/shunt_sensors_Victron_SmartShunt_UART_minimal.yaml +++ b/packages/shunt/shunt_sensors_Victron_SmartShunt_UART_minimal.yaml @@ -1,5 +1,5 @@ -# Updated : 2026.02.16 -# Version : 1.1.7 +# Updated : 2026.11.05 +# Version : 1.1.8 # GitHub : https://github.com/KinDR007/VictronMPPT-ESPHOME # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -19,6 +19,11 @@ packages: shunt_base_minimal: !include shunt_base_minimal.yaml + shunt_uart: !include + file: ../board/board_options_itf_${shunt_uart_id}.yaml + vars: + uart_baud_rate: ${shunt_uart_baud_rate | default(19200)} + uart_rx_buffer_size: '256' # +--------------------------------------+ # | Component settings | diff --git a/packages/yambms/yambms_rs485.yaml b/packages/yambms/yambms_rs485.yaml index e0700ee..5cf02f3 100644 --- a/packages/yambms/yambms_rs485.yaml +++ b/packages/yambms/yambms_rs485.yaml @@ -32,26 +32,20 @@ packages: rs485_protocol: !include yambms_rs485_${rs485_protocol}.yaml + rs485_uart: !include + file: ../board/board_options_itf_${rs485_uart_id}.yaml + vars: + uart_baud_rate: ${rs485_uart_baud_rate | default(9600)} substitutions: # The ID of the LED on your board used for this component rs485_status_led_id: "virtual_status_light" - # Baud rate of the link to the inverter, applied at runtime (see on_boot below) - rs485_uart_baud_rate: '9600' esphome: on_boot: - priority: 600.0 then: - lambda: |- - // Apply the baud rate at runtime rather than extending the uart component. - // `uart: !extend` only works on a native ESP32 UART; an expander channel - // (wk2168 and friends) declares its baud rate inside the expander's own - // configuration and cannot be extended. Both expose set_baud_rate() and - // load_settings(), which reprograms the hardware, so this works everywhere. - id(${rs485_uart_id}).set_baud_rate(${rs485_uart_baud_rate}); - id(${rs485_uart_id}).load_settings(); - // Register System id(global_register_led)(${CAT_INV_RS485}, ${rs485_id}, id(${rs485_status_led_id})); // Force register fault as default, will be updated once RS485 is working