diff --git a/YamBMS_LP_BASEN_RS485.yaml b/YamBMS_LP_BASEN_RS485.yaml new file mode 100644 index 0000000..83a812d --- /dev/null +++ b/YamBMS_LP_BASEN_RS485.yaml @@ -0,0 +1,221 @@ +# Updated : 2025.06.17 +# Version : 1.5.6 +# 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 . + +######################## YamBMS Local Packages Version ######################### + +# You need to copy the `packages` folder into the same folder as this YAML in order to compile it. +# Don't forget to configure your WiFi credentials in the secrets.yaml + +################################################################################ + +# Don't forget to configure your WiFi credentials in the secrets.yaml +# +# If needed, configure a static IP here +# wifi: +# manual_ip: +# static_ip: 192.168.0.85 +# gateway: 192.168.0.1 +# subnet: 255.255.255.0 +# dns1: 8.8.8.8 +# dns2: 8.8.4.4 + +logger: + level: INFO # VERBOSE / DEBUG / INFO / WARN + +ota: + platform: esphome + +# Please use the native `api` component instead of the `mqtt` section. +# If you use Home Assistant, the native API is more lightweight. +# If there is no HA server connected to this API, the ESP32 reboots every 15 minutes to try to resolve the problem. +# The "reboot_timeout: 0s" option will keep your ESP32 up and running even if you lose connection to your HA server. +api: + reboot_timeout: 0s + +# If you don't want to use ESPHome's native API you can use MQTT instead. +# In this case don't forget to remove the 'api:' section. +# mqtt: +# broker: !secret mqtt_host +# username: !secret mqtt_username +# password: !secret mqtt_password +# id: mqtt_client + +# Please note that enabling this component will take up a lot of memory and may decrease +# stability and be the cause of reboot depending on the capabilities of the board used. +# web_server: +# port: 80 +# log: false +# ota: false + +# +--------------------------------------+ +# | Global Settings | +# +--------------------------------------+ +substitutions: + # Name + name: '' # Name that can be added as a second prefix after the friendly name, you can leave it blank. + hostname: 'yambms' # This is the name of the node. It should always be unique in your ESPHome network. + friendly_name : 'YamBMS' # Prefix added in front of all entity names and also to classify them. + # +--------------------------------------+ + # | YamBMS Settings | + # +--------------------------------------+ + # Please read the cut-off charging logic README to understand how the YamBMS works + yambms_id: 'yambms1' + yambms_name: 'YamBMS 1' + yambms_update_interval: '1s' + # Input numbers can be displayed as a slider or an input box, options are 'slider' or 'box'. + yambms_input_number_mode: 'slider' + # Please check and fill in the options below correctly according to your battery chemistry and number of cells in series. + # These parameters are important and used for charging logic. + # Battery Chemistry + yambms_battery_chemistry: '1' # 1-LFP | 2-Li-ion | 3-LTO + # Number of cells in series + yambms_cell_count: '16' + # Bulk / Absorption Voltage : corresponds to the Bulk voltage that will be used to charge the battery. (LFP : 55.2V = 3.45V/Cell for 16S battery) + yambms_bulk_v: '55.2' + # Float Voltage : corresponds to the voltage at which the battery would be maintained at the end of charge. (LFP : 53.6V = 3.35V/Cell for 16S battery) + yambms_float_v: '53.6' + # Rebulk voltage, voltage from which a new Bulk charge can start. (LFP : 52.8V = 3.3V/Cell for 16S battery) + yambms_rebulk_v: '52.8' + # Maximum time in minutes that the cut-off step can last before charging is complete + # If your cells are properly balanced this step ends at the fastest after the `cut-off timer` + # This timer can be deactivated with a switch + yambms_eoc_timer: '30' + # Time in seconds during which the end of charge conditions must be respected (cut-off + cells not equalizing) + yambms_cutoff_timer: '60' + # +--------------------------------------+ + # | Shunt Settings | + # +--------------------------------------+ + shunt_update_interval: '3s' # frequency at which Shunt data is refreshed + shunt_combine_interval: '1s' # frequency at which Shunt data is combined in YamBMS + # +--------------------------------------+ + # | BMS Settings | + # +--------------------------------------+ + bms_update_interval: '3s' # frequency at which BMS data is refreshed, going below '3s' can cause problems + bms_combine_interval: '1s' # frequency at which BMS data is combined in YamBMS + bms_cutoff_timer: '50s' # time during which the end of charge conditions must be respected (cut-off + cells not equalizing) + +# +--------------------------------------+ +# | Packages | +# +--------------------------------------+ + +# PLEASE READ : https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_main_YAML_HowTo.md + +packages: + + ############### >>> UNCOMMENT YOUR BOARD <<< ############### + ############### >>> ONLY ONE BOARD ! <<< ############### + + # This list is incomplete, other board.yaml are available in the board folder + + # device_board: !include 'packages/board/board_ESP32_Generic.yaml' + # device_board: !include 'packages/board/board_ESP32_DevKit-V1.yaml' + # device_board: !include 'packages/board/board_ESP32_Atom-Lite.yaml' + # device_board: !include 'packages/board/board_ESP32_EVB.yaml' + device_board: !include 'packages/board/board_ESP32_LilyGo-T-CAN485.yaml' + # device_board: !include 'packages/board/board_ESP32-C3_DevKitM-1.yaml' + # device_board: !include 'packages/board/board_ESP32-C3_ETH01-EVO.yaml' + # device_board: !include 'packages/board/board_ESP32-S3_AtomS3-Lite.yaml' + # device_board: !include 'packages/board/board_ESP32-S3_DevKitC-1_LED-38.yaml' + # device_board: !include 'packages/board/board_ESP32-S3_DevKitC-1_LED-48.yaml' + # device_board: !include 'packages/board/board_ESP32-S3_LilyGo-T-Connect.yaml' + # device_board: !include 'packages/board/board_ESP32-S3_Touch-LCD-4.3.yaml' + # device_board: !include 'packages/board/board_ESP32-S3_Touch-LCD-7.yaml' + # device_board: !include 'packages/board/board_ESP32-S3_XIAO.yaml' + # device_board: !include 'packages/board/board_ESP32-S3_YBoard.yaml' + + # device_board: !include + # file: 'packages/board/board_ESP32-S3_AtomS3.yaml' + # vars: + # display_auto_next_page_interval: '5s' + # display_rotation: '0' # 0/90/180/270 rotation angle in degrees + + # device_board: !include + # file: 'packages/board/board_ESP32-S3_AtomS3R.yaml' + # vars: + # display_auto_next_page_interval: '5s' + # display_rotation: '0' # 0/90/180/270 rotation angle in degrees + + ########### >>> UNCOMMENT YOUR BOARD OPTIONS <<< ########### + + uart_esp_1: !include packages/board/board_options_itf_uart_esp_1.yaml + # uart_esp_2: !include packages/board/board_options_itf_uart_esp_2.yaml + # uart_esp_3: !include packages/board/board_options_itf_uart_esp_3.yaml + + # ESP32_CAN (TJA105x, SN65HVD230, M5Stack CAN base/unit) + canbus_node_1: !include + file: packages/board/board_options_itf_canbus_esp32_can.yaml + vars: + canbus_node_id: 'canbus_inverter_1' + + # MCP2515 + # canbus_node_2: !include + # file: packages/board/board_options_itf_canbus_mcp2515.yaml + # vars: + # canbus_node_id: 'canbus_inverter_1' + + # captive_portal: !include packages/board/board_options_captive_portal.yaml + + ############################################################ + + # Basen controller + controller: !include + file: packages/bms/bms_combine_BASEN_RS485_controller.yaml + vars: + basen_uart_id: 'uart_esp_1' + basen_uart_baud_rate: '9600' + basen_controller_id: "basen_controller_1" + + # Basen module 1 + bms1: !include + file: packages/bms/bms_combine_BASEN_RS485_full.yaml + vars: + bms_id: '1' # must be a number + bms_name: 'BASEN-BMS 1' + bms_address: '0x01' + + # Basen module 2 + bms2: !include + file: packages/bms/bms_combine_BASEN_RS485_full.yaml + vars: + bms_id: '2' # must be a number + bms_name: 'BASEN-BMS 2' + bms_address: '0x02' + + yambms: !include packages/yambms/yambms.yaml + + canbus1: !include + file: packages/yambms/yambms_canbus.yaml + vars: + canbus_id: 'canbus1' + canbus_name: 'CANBUS 1' + canbus_node_id: 'canbus_inverter_1' + canbus_light_id: 'esp_light' + # The CANBUS link will be considered down if no response from the inverter (ID 0x305) for 5s + # The Deye inverter sends the ACK (can_id 0x305) only when it receives the can_id 0x356 + canbus_link_timer: '5s' + +# +--------------------------------------+ +# | DEBUG ( logger level must be DEBUG ) | +# +--------------------------------------+ + + device_debug: !include + file: packages/base/device_debug_ESP32.yaml + vars: + debug_name: 'Debug' + debug_update_interval: '5s' diff --git a/YamBMS_RP_BASEN_RS485.yaml b/YamBMS_RP_BASEN_RS485.yaml new file mode 100644 index 0000000..0fb0321 --- /dev/null +++ b/YamBMS_RP_BASEN_RS485.yaml @@ -0,0 +1,286 @@ +# Updated : 2025.06.17 +# Version : 1.5.6 +# 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 . + +######################## YamBMS Remote Packages Version ######################## + +# You can compile this YAML directly without the `packages` folder. +# The packages will be automatically downloaded from GitHub. +# Don't forget to configure your WiFi credentials in the secrets.yaml + +################################################################################ + +# If needed, configure a static IP here +# wifi: +# manual_ip: +# static_ip: 192.168.0.85 +# gateway: 192.168.0.1 +# subnet: 255.255.255.0 +# dns1: 8.8.8.8 +# dns2: 8.8.4.4 + +logger: + level: INFO # VERBOSE / DEBUG / INFO / WARN + +ota: + platform: esphome + +# Please use the native `api` component instead of the `mqtt` section. +# If you use Home Assistant, the native API is more lightweight. +# If there is no HA server connected to this API, the ESP32 reboots every 15 minutes to try to resolve the problem. +# The "reboot_timeout: 0s" option will keep your ESP32 up and running even if you lose connection to your HA server. +api: + reboot_timeout: 0s + +# If you don't want to use ESPHome's native API you can use MQTT instead. +# In this case don't forget to remove the 'api:' section. +# mqtt: +# broker: !secret mqtt_host +# username: !secret mqtt_username +# password: !secret mqtt_password +# id: mqtt_client + +# Please note that enabling this component will take up a lot of memory and may decrease +# stability and be the cause of reboot depending on the capabilities of the board used. +# web_server: +# port: 80 +# log: false +# ota: false + +# +--------------------------------------+ +# | Global Settings | +# +--------------------------------------+ +substitutions: + # Name + name: '' # Name that can be added as a second prefix after the friendly name, you can leave it blank. + hostname: 'yambms' # This is the name of the node. It should always be unique in your ESPHome network. + friendly_name : 'YamBMS' # Prefix added in front of all entity names and also to classify them. + # +--------------------------------------+ + # | YamBMS Settings | + # +--------------------------------------+ + # Please read the cut-off charging logic README to understand how the YamBMS works + yambms_id: 'yambms1' + yambms_name: 'YamBMS 1' + yambms_update_interval: '1s' + # Input numbers can be displayed as a slider or an input box, options are 'slider' or 'box'. + yambms_input_number_mode: 'slider' + # Please check and fill in the options below correctly according to your battery chemistry and number of cells in series. + # These parameters are important and used for charging logic. + # Battery Chemistry + yambms_battery_chemistry: '1' # 1-LFP | 2-Li-ion | 3-LTO + # Number of cells in series + yambms_cell_count: '16' + # Bulk / Absorption Voltage : corresponds to the Bulk voltage that will be used to charge the battery. (LFP : 55.2V = 3.45V/Cell for 16S battery) + yambms_bulk_v: '55.2' + # Float Voltage : corresponds to the voltage at which the battery would be maintained at the end of charge. (LFP : 53.6V = 3.35V/Cell for 16S battery) + yambms_float_v: '53.6' + # Rebulk voltage, voltage from which a new Bulk charge can start. (LFP : 52.8V = 3.3V/Cell for 16S battery) + yambms_rebulk_v: '52.8' + # Maximum time in minutes that the cut-off step can last before charging is complete + # If your cells are properly balanced this step ends at the fastest after the `cut-off timer` + # This timer can be deactivated with a switch + yambms_eoc_timer: '30' + # Time in seconds during which the end of charge conditions must be respected (cut-off + cells not equalizing) + yambms_cutoff_timer: '60' + # +--------------------------------------+ + # | Shunt Settings | + # +--------------------------------------+ + shunt_update_interval: '3s' # frequency at which Shunt data is refreshed + shunt_combine_interval: '1s' # frequency at which Shunt data is combined in YamBMS + # +--------------------------------------+ + # | BMS Settings | + # +--------------------------------------+ + bms_update_interval: '3s' # frequency at which BMS data is refreshed, going below '3s' can cause problems + bms_combine_interval: '1s' # frequency at which BMS data is combined in YamBMS + bms_cutoff_timer: '50s' # time during which the end of charge conditions must be respected (cut-off + cells not equalizing) + +# +--------------------------------------+ +# | Packages | +# +--------------------------------------+ + +# PLEASE READ : https://github.com/Sleeper85/esphome-yambms/blob/main/documents/README/YamBMS_main_YAML_HowTo.md + +packages: + + ################ >>> CONFIG & CUSTOM LP <<< ################ + + # Local Packages intended for creating custom codes + # or sharing settings between several main.yaml + + # yambms_config: !include yambms_config.yaml + # yambms_custom: !include yambms_custom.yaml + + ############### >>> UNCOMMENT YOUR BOARD <<< ############### + ############### >>> ONLY ONE BOARD ! <<< ############### + + board: + url: https://github.com/Sleeper85/esphome-yambms + ref: main + refresh: 0s + files: + # - path: 'packages/board/board_ESP32_Generic.yaml' + # - path: 'packages/board/board_ESP32_DevKit-V1.yaml' + # - path: 'packages/board/board_ESP32_Atom-Lite.yaml' + # - path: 'packages/board/board_ESP32_EVB.yaml' + - path: 'packages/board/board_ESP32_LilyGo-T-CAN485.yaml' + # - path: 'packages/board/board_ESP32-C3_DevKitM-1.yaml' + # - path: 'packages/board/board_ESP32-C3_ETH01-EVO.yaml' + # - path: 'packages/board/board_ESP32-S3_AtomS3-Lite.yaml' + # - path: 'packages/board/board_ESP32-S3_DevKitC-1_LED-38.yaml' + # - path: 'packages/board/board_ESP32-S3_DevKitC-1_LED-48.yaml' + # - path: 'packages/board/board_ESP32-S3_LilyGo-T-Connect.yaml' + # - path: 'packages/board/board_ESP32-S3_Touch-LCD-4.3.yaml' + # - path: 'packages/board/board_ESP32-S3_Touch-LCD-7.yaml' + # - path: 'packages/board/board_ESP32-S3_XIAO.yaml' + # - path: 'packages/board/board_ESP32-S3_YBoard.yaml' + + # - path: 'packages/board/board_ESP32-S3_AtomS3.yaml' + # vars: + # display_auto_next_page_interval: '5s' + # display_rotation: '0' # 0/90/180/270 rotation angle in degrees + + # - path: 'packages/board/board_ESP32-S3_AtomS3R.yaml' + # vars: + # display_auto_next_page_interval: '5s' + # display_rotation: '0' # 0/90/180/270 rotation angle in degrees + + # LilyGo T-Connect Pro + # Importing the display also activates PSRAM. + # Also note that the display update takes about 120 ms, as indicated in the logs: + # "Component display took a long time for an operation (124 ms)." + # Board + # - path: 'packages/board/board_ESP32-S3_LilyGo-T-Connect-Pro.yaml' + # Display + # - path: 'packages/board/board_options_display_480x222.yaml' + # vars: + # display_auto_next_page_interval: '5s' + + ########### >>> UNCOMMENT YOUR BOARD OPTIONS <<< ########### + + board_options: + url: https://github.com/Sleeper85/esphome-yambms + ref: main + refresh: 0s + files: + # UART 1 + - path: 'packages/board/board_options_itf_uart_esp_1.yaml' + # UART 2 + # - path: 'packages/board/board_options_itf_uart_esp_2.yaml' + # UART 3 + # - path: 'packages/board/board_options_itf_uart_esp_3.yaml' + + # ESP32_CAN (TJA105x, SN65HVD230, M5Stack CAN base/unit) + - path: 'packages/board/board_options_itf_canbus_esp32_can.yaml' + vars: + canbus_node_id: 'canbus_inverter_1' + + # MCP2515 + # - path: 'packages/board/board_options_itf_canbus_mcp2515.yaml' + # vars: + # canbus_node_id: 'canbus_inverter_1' + + ############################################################ + + # You don't have to import a shunt but you must import at least one BMS. + + # UART Shunt + # shunt: + # url: https://github.com/Sleeper85/esphome-yambms + # ref: main + # refresh: 0s + # files: + # # Shunt 1 + # - path: 'packages/shunt/shunt_combine_Victron_SmartShunt_UART.yaml' # shunt_combine_Junctek_KHF_UART.yaml + # vars: + # shunt_id: '1' # must be a number + # shunt_name: 'Shunt 1' + # shunt_uart_id: 'uart_esp_3' + + # BLE Shunt + # shunt: + # url: https://github.com/Sleeper85/esphome-yambms + # ref: main + # refresh: 0s + # files: + # # Shunt 1 + # - path: 'packages/shunt/shunt_combine_Victron_SmartShunt_BLE.yaml' + # vars: + # shunt_id: '1' # must be a number + # shunt_name: 'Shunt 1' + # shunt_mac_address: '60:A4:23:91:8F:55' # Your MAC address + # shunt_encryption_key: '0df4d0395b7d1a876c0c33ecb9e70dcd' # Your encryption key + + bms: + url: https://github.com/Sleeper85/esphome-yambms + ref: main + refresh: 0s + files: + # Basen controller + - path: packages/bms/bms_combine_BASEN_RS485_controller.yaml + vars: + basen_uart_id: 'uart_esp_1' + basen_uart_baud_rate: '9600' + basen_controller_id: "basen_controller_1" + # Basen module 1 + - path: packages/bms/bms_combine_BASEN_RS485_full.yaml + vars: + bms_id: '1' # must be a number + bms_name: 'BASEN-BMS 1' + bms_address: '0x01' + # Basen module 2 + - path: packages/bms/bms_combine_BASEN_RS485_full.yaml + vars: + bms_id: '2' # must be a number + bms_name: 'BASEN-BMS 2' + bms_address: '0x02' + + yambms: + url: https://github.com/Sleeper85/esphome-yambms + ref: main + refresh: 0s + files: + - path: 'packages/yambms/yambms.yaml' + + canbus: + url: https://github.com/Sleeper85/esphome-yambms + ref: main + refresh: 0s + files: + - path: 'packages/yambms/yambms_canbus.yaml' + vars: + canbus_id: 'canbus1' + canbus_name: 'CANBUS 1' + canbus_node_id: 'canbus_inverter_1' + canbus_light_id: 'esp_light' + # The CANBUS link will be considered down if no response from the inverter (0x305 frame) for 5s + # The Deye inverter sends the ACK 0x305 only when it receives the 0x356 frame. + canbus_link_timer: '5s' + +# +--------------------------------------+ +# | DEBUG ( logger level must be DEBUG ) | +# +--------------------------------------+ + + debug: + url: https://github.com/Sleeper85/esphome-yambms + ref: main + refresh: 0s + files: + - path: packages/base/device_debug_ESP32.yaml + vars: + debug_name: 'Debug' + debug_update_interval: '5s'