From 5ddf954d0ff0cabd7df39c7993df4ad6d412e2ce Mon Sep 17 00:00:00 2001 From: Sleeper85 Date: Sat, 2 Aug 2025 11:02:28 +0200 Subject: [PATCH] Updated YamBMS multi-node modbus YAMLs --- ..._example_multi-node_YamBMS_modbus_client.yaml | 12 +++--------- ...xample_multi-node_YamBMS_modbus_server_1.yaml | 12 +++++------- ...xample_multi-node_YamBMS_modbus_server_2.yaml | 12 +++++------- ..._example_multi-node_YamBMS_modbus_client.yaml | 12 +++--------- ...xample_multi-node_YamBMS_modbus_server_1.yaml | 12 +++++------- ...xample_multi-node_YamBMS_modbus_server_2.yaml | 12 +++++------- packages/bms/bms_combine_modbus_client.yaml | 6 +++--- packages/bms/bms_modbus_server.yaml | 6 +++--- .../board_options_itf_modbus.yaml} | 16 ++++++++++++++-- .../board_options_itf_modbus_expander.yaml} | 16 ++++++++++++++-- packages/shunt/shunt_combine_modbus_client.yaml | 6 +++--- packages/shunt/shunt_modbus_server.yaml | 6 +++--- 12 files changed, 66 insertions(+), 62 deletions(-) rename packages/{base/device_modbus.yaml => board/board_options_itf_modbus.yaml} (58%) rename packages/{base/device_modbus_expander.yaml => board/board_options_itf_modbus_expander.yaml} (56%) diff --git a/examples/multi-node/LP_example_multi-node_YamBMS_modbus_client.yaml b/examples/multi-node/LP_example_multi-node_YamBMS_modbus_client.yaml index 2cb5b81..e78994e 100644 --- a/examples/multi-node/LP_example_multi-node_YamBMS_modbus_client.yaml +++ b/examples/multi-node/LP_example_multi-node_YamBMS_modbus_client.yaml @@ -1,5 +1,5 @@ -# Updated : 2025.07.28 -# Version : 1.1.1 +# Updated : 2025.08.02 +# Version : 1.1.2 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -23,16 +23,10 @@ ################################################################################ -substitutions: - modbus_update_interval: '5s' # frequency with which BMS/Shunt modbus servers are queried - modbus_baud_rate: '19200' # 9600 / 19200 / 115200 - modbus_command_throttle: '0ms' # minimum time in between 2 requests to the device - modbus_send_wait_time: '250ms' # time in milliseconds before the next ModBUS command is sent if an answer from a previous command is pending - packages: modbus: !include - file: packages/base/device_modbus.yaml + file: packages/board/board_options_itf_modbus.yaml vars: modbus_role: 'client' # client / server modbus_uart_id: 'uart_esp_1' # RS485 board diff --git a/examples/multi-node/LP_example_multi-node_YamBMS_modbus_server_1.yaml b/examples/multi-node/LP_example_multi-node_YamBMS_modbus_server_1.yaml index f7cd5c5..c58877e 100644 --- a/examples/multi-node/LP_example_multi-node_YamBMS_modbus_server_1.yaml +++ b/examples/multi-node/LP_example_multi-node_YamBMS_modbus_server_1.yaml @@ -1,5 +1,5 @@ -# Updated : 2025.07.28 -# Version : 1.1.1 +# Updated : 2025.08.02 +# Version : 1.1.2 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -24,15 +24,13 @@ ################################################################################ substitutions: - modbus_update_interval: '5s' # frequency with which BMS/Shunt modbus servers are queried - modbus_baud_rate: '19200' # 9600 / 19200 / 115200 - modbus_command_throttle: '0ms' # minimum time in between 2 requests to the device - modbus_send_wait_time: '250ms' # time in milliseconds before the next ModBUS command is sent if an answer from a previous command is pending + friendly_name : 'YamBMS Modbus Server 1' # Prefix added in front of the `entity display name`, also used to classify them. + hostname: 'yambms-modbus-server-1' # Name of your ESPHome node registered on the IP network (DNS name, must be unique) and prefix added in front of the `entity id`. packages: modbus: !include - file: packages/base/device_modbus.yaml + file: packages/board/board_options_itf_modbus.yaml vars: modbus_role: 'server' # client / server modbus_uart_id: 'uart_esp_1' # RS485 board diff --git a/examples/multi-node/LP_example_multi-node_YamBMS_modbus_server_2.yaml b/examples/multi-node/LP_example_multi-node_YamBMS_modbus_server_2.yaml index 267d1ca..341a443 100644 --- a/examples/multi-node/LP_example_multi-node_YamBMS_modbus_server_2.yaml +++ b/examples/multi-node/LP_example_multi-node_YamBMS_modbus_server_2.yaml @@ -1,5 +1,5 @@ -# Updated : 2025.07.28 -# Version : 1.1.1 +# Updated : 2025.08.02 +# Version : 1.1.2 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -24,15 +24,13 @@ ################################################################################ substitutions: - modbus_update_interval: '5s' # frequency with which BMS/Shunt modbus servers are queried - modbus_baud_rate: '19200' # 9600 / 19200 / 115200 - modbus_command_throttle: '0ms' # minimum time in between 2 requests to the device - modbus_send_wait_time: '250ms' # time in milliseconds before the next ModBUS command is sent if an answer from a previous command is pending + friendly_name : 'YamBMS Modbus Server 2' # Prefix added in front of the `entity display name`, also used to classify them. + hostname: 'yambms-modbus-server-2' # Name of your ESPHome node registered on the IP network (DNS name, must be unique) and prefix added in front of the `entity id`. packages: modbus: !include - file: packages/base/device_modbus.yaml + file: packages/board/board_options_itf_modbus.yaml vars: modbus_role: 'server' # client / server modbus_uart_id: 'uart_esp_1' # RS485 board diff --git a/examples/multi-node/RP_example_multi-node_YamBMS_modbus_client.yaml b/examples/multi-node/RP_example_multi-node_YamBMS_modbus_client.yaml index 60b07f7..cadbba1 100644 --- a/examples/multi-node/RP_example_multi-node_YamBMS_modbus_client.yaml +++ b/examples/multi-node/RP_example_multi-node_YamBMS_modbus_client.yaml @@ -1,5 +1,5 @@ -# Updated : 2025.07.28 -# Version : 1.1.1 +# Updated : 2025.08.02 +# Version : 1.1.2 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -23,12 +23,6 @@ ################################################################################ -substitutions: - modbus_update_interval: '5s' # frequency with which BMS/Shunt modbus servers are queried - modbus_baud_rate: '19200' # 9600 / 19200 / 115200 - modbus_command_throttle: '0ms' # minimum time in between 2 requests to the device - modbus_send_wait_time: '250ms' # time in milliseconds before the next ModBUS command is sent if an answer from a previous command is pending - packages: yambms_modbus_client: @@ -37,7 +31,7 @@ packages: refresh: 0s files: # Modbus client - - path: 'packages/base/device_modbus.yaml' + - path: 'packages/board/board_options_itf_modbus.yaml' vars: modbus_role: 'client' # client / server modbus_uart_id: 'uart_esp_1' # RS485 board diff --git a/examples/multi-node/RP_example_multi-node_YamBMS_modbus_server_1.yaml b/examples/multi-node/RP_example_multi-node_YamBMS_modbus_server_1.yaml index 911743e..43b1b5f 100644 --- a/examples/multi-node/RP_example_multi-node_YamBMS_modbus_server_1.yaml +++ b/examples/multi-node/RP_example_multi-node_YamBMS_modbus_server_1.yaml @@ -1,5 +1,5 @@ -# Updated : 2025.07.28 -# Version : 1.1.1 +# Updated : 2025.08.02 +# Version : 1.1.2 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -24,10 +24,8 @@ ################################################################################ substitutions: - modbus_update_interval: '5s' # frequency with which BMS/Shunt modbus servers are queried - modbus_baud_rate: '19200' # 9600 / 19200 / 115200 - modbus_command_throttle: '0ms' # minimum time in between 2 requests to the device - modbus_send_wait_time: '250ms' # time in milliseconds before the next ModBUS command is sent if an answer from a previous command is pending + friendly_name : 'YamBMS Modbus Server 1' # Prefix added in front of the `entity display name`, also used to classify them. + hostname: 'yambms-modbus-server-1' # Name of your ESPHome node registered on the IP network (DNS name, must be unique) and prefix added in front of the `entity id`. packages: @@ -37,7 +35,7 @@ packages: refresh: 0s files: # Modbus server - - path: 'packages/base/device_modbus.yaml' + - path: 'packages/board/board_options_itf_modbus.yaml' vars: modbus_role: 'server' # client / server modbus_uart_id: 'uart_esp_1' # RS485 board diff --git a/examples/multi-node/RP_example_multi-node_YamBMS_modbus_server_2.yaml b/examples/multi-node/RP_example_multi-node_YamBMS_modbus_server_2.yaml index 8e37258..37e9d14 100644 --- a/examples/multi-node/RP_example_multi-node_YamBMS_modbus_server_2.yaml +++ b/examples/multi-node/RP_example_multi-node_YamBMS_modbus_server_2.yaml @@ -1,5 +1,5 @@ -# Updated : 2025.07.28 -# Version : 1.1.1 +# Updated : 2025.08.02 +# Version : 1.1.2 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -24,10 +24,8 @@ ################################################################################ substitutions: - modbus_update_interval: '5s' # frequency with which BMS/Shunt modbus servers are queried - modbus_baud_rate: '19200' # 9600 / 19200 / 115200 - modbus_command_throttle: '0ms' # minimum time in between 2 requests to the device - modbus_send_wait_time: '250ms' # time in milliseconds before the next ModBUS command is sent if an answer from a previous command is pending + friendly_name : 'YamBMS Modbus Server 2' # Prefix added in front of the `entity display name`, also used to classify them. + hostname: 'yambms-modbus-server-2' # Name of your ESPHome node registered on the IP network (DNS name, must be unique) and prefix added in front of the `entity id`. packages: @@ -37,7 +35,7 @@ packages: refresh: 0s files: # Modbus server - - path: 'packages/base/device_modbus.yaml' + - path: 'packages/board/board_options_itf_modbus.yaml' vars: modbus_role: 'server' # client / server modbus_uart_id: 'uart_esp_1' # RS485 board diff --git a/packages/bms/bms_combine_modbus_client.yaml b/packages/bms/bms_combine_modbus_client.yaml index ec23909..fc930f2 100644 --- a/packages/bms/bms_combine_modbus_client.yaml +++ b/packages/bms/bms_combine_modbus_client.yaml @@ -1,5 +1,5 @@ -# Updated : 2025.06.12 -# Version : 1.1.6 +# Updated : 2025.08.02 +# Version : 1.1.7 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -30,7 +30,7 @@ packages: modbus_controller: - id: modbus_controller${bms_id} - modbus_id: modbus_client + modbus_id: ${modbus_id} setup_priority: -10 address: ${bms_id} update_interval: ${modbus_update_interval} diff --git a/packages/bms/bms_modbus_server.yaml b/packages/bms/bms_modbus_server.yaml index 613148b..e8a4595 100644 --- a/packages/bms/bms_modbus_server.yaml +++ b/packages/bms/bms_modbus_server.yaml @@ -1,5 +1,5 @@ -# Updated : 2025.04.01 -# Version : 1.1.3 +# Updated : 2025.08.02 +# Version : 1.1.4 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -18,7 +18,7 @@ # along with this program. If not, see . modbus_controller: - - modbus_id: modbus_server + - modbus_id: ${modbus_id} address: ${bms_id} # max 255 (8bit) server_registers: # online_status (1/0) diff --git a/packages/base/device_modbus.yaml b/packages/board/board_options_itf_modbus.yaml similarity index 58% rename from packages/base/device_modbus.yaml rename to packages/board/board_options_itf_modbus.yaml index 8c09536..cae584f 100644 --- a/packages/base/device_modbus.yaml +++ b/packages/board/board_options_itf_modbus.yaml @@ -1,4 +1,4 @@ -# Updated : 2025.03.21 +# Updated : 2025.08.02 # Version : 1.1.1 # GitHub : https://github.com/Sleeper85/esphome-yambms @@ -17,12 +17,24 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# The settings below can be changed via `vars` when importing the package +# or by declaring new `substitutions` in the main YAML. +substitutions: + # UART + modbus_baud_rate: '19200' # 9600 / 19200 / 115200 + # Modbus + modbus_id: 'modbus_1' + modbus_send_wait_time: '250ms' # time in milliseconds before the next ModBUS command is sent if an answer from a previous command is pending + # Modbus Controller + modbus_update_interval: '5s' # frequency with which BMS/Shunt modbus servers are queried + modbus_command_throttle: '0ms' # minimum time in between 2 requests to the device + uart: - id: !extend ${modbus_uart_id} baud_rate: ${modbus_baud_rate} modbus: - uart_id: ${modbus_uart_id} - id: modbus_${modbus_role} + id: ${modbus_id} role: ${modbus_role} send_wait_time: ${modbus_send_wait_time} diff --git a/packages/base/device_modbus_expander.yaml b/packages/board/board_options_itf_modbus_expander.yaml similarity index 56% rename from packages/base/device_modbus_expander.yaml rename to packages/board/board_options_itf_modbus_expander.yaml index 5501670..4ba8593 100644 --- a/packages/base/device_modbus_expander.yaml +++ b/packages/board/board_options_itf_modbus_expander.yaml @@ -1,4 +1,4 @@ -# Updated : 2025.03.21 +# Updated : 2025.08.02 # Version : 1.1.1 # GitHub : https://github.com/Sleeper85/esphome-yambms @@ -17,8 +17,20 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# The settings below can be changed via `vars` when importing the package +# or by declaring new `substitutions` in the main YAML. +substitutions: + # UART + modbus_baud_rate: '19200' # 9600 / 19200 / 115200 + # Modbus + modbus_id: 'modbus_1' + modbus_send_wait_time: '250ms' # time in milliseconds before the next ModBUS command is sent if an answer from a previous command is pending + # Modbus Controller + modbus_update_interval: '5s' # frequency with which BMS/Shunt modbus servers are queried + modbus_command_throttle: '0ms' # minimum time in between 2 requests to the device + modbus: - uart_id: ${modbus_uart_id} - id: modbus_${modbus_role} + id: ${modbus_id} role: ${modbus_role} send_wait_time: ${modbus_send_wait_time} diff --git a/packages/shunt/shunt_combine_modbus_client.yaml b/packages/shunt/shunt_combine_modbus_client.yaml index 86dca6b..7825149 100644 --- a/packages/shunt/shunt_combine_modbus_client.yaml +++ b/packages/shunt/shunt_combine_modbus_client.yaml @@ -1,5 +1,5 @@ -# Updated : 2025.05.19 -# Version : 1.1.2 +# Updated : 2025.08.02 +# Version : 1.1.3 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -26,7 +26,7 @@ packages: modbus_controller: - id: modbus_controller20${shunt_id} - modbus_id: modbus_client + modbus_id: ${modbus_id} setup_priority: -10 address: 20${shunt_id} update_interval: ${modbus_update_interval} diff --git a/packages/shunt/shunt_modbus_server.yaml b/packages/shunt/shunt_modbus_server.yaml index 7ed67df..cd711b7 100644 --- a/packages/shunt/shunt_modbus_server.yaml +++ b/packages/shunt/shunt_modbus_server.yaml @@ -1,5 +1,5 @@ -# Updated : 2024.12.23 -# Version : 1.1.1 +# Updated : 2025.08.02 +# Version : 1.1.2 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -18,7 +18,7 @@ # along with this program. If not, see . modbus_controller: - - modbus_id: modbus_server + - modbus_id: ${modbus_id} address: 20${shunt_id} # max 255 (8bit) server_registers: # online_status (1/0)