Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- substitutions:
- name: jbd-bms-ble
- device_description: "Monitor and control a Xiaoxiang Battery Management System (JBD-BMS) via BLE"
- external_components_source: github://syssi/esphome-jbd-bms@main
- mac_address: A4:C1:37:50:75:C6
- esphome:
- name: fve
- friendly_name: FVE
- esp32:
- board: esp32dev
- framework:
- type: esp-idf
- external_components:
- - source: ${external_components_source}
- refresh: 0s
- # Enable logging
- logger:
- # Enable Home Assistant API
- api:
- encryption:
- key: "BU0whyQh53j42Ve3q3iVoF0iKdaR8A0xFkg+6BUQSXk="
- ota:
- password: "b94a5f5ca6b60706d3dfa93d65e1e2bc"
- wifi:
- ssid: !secret wifi_ssid
- password: !secret wifi_password
- # Enable fallback hotspot (captive portal) in case wifi connection fails
- ap:
- ssid: "Fve Fallback Hotspot"
- password: "ZdCryXqsJvGW"
- uart:
- id: mod_bus
- tx_pin: GPIO19
- rx_pin: GPIO23
- baud_rate: 19200
- stop_bits: 1
- parity: NONE
- data_bits: 8
- modbus:
- id: mod_bus_must
- send_wait_time: 1250ms
- modbus_controller:
- - id: must
- address: 0x4
- modbus_id: mod_bus_must
- setup_priority: -10
- update_interval: 2s
- esp32_ble_tracker:
- on_ble_advertise:
- then:
- - lambda: |-
- if (x.get_name().rfind("xiaoxiang", 0) == 0) {
- ESP_LOGI("ble_adv", "New JBD-BMS found");
- ESP_LOGI("ble_adv", " Name: %s", x.get_name().c_str());
- ESP_LOGI("ble_adv", " MAC address: %s", x.address_str().c_str());
- ESP_LOGD("ble_adv", " Advertised service UUIDs:");
- for (auto uuid : x.get_service_uuids()) {
- ESP_LOGD("ble_adv", " - %s", uuid.to_string().c_str());
- }
- }
- ble_client:
- - id: client0
- mac_address: ${mac_address}
- jbd_bms_ble:
- - id: bms0
- ble_client_id: client0
- update_interval: 2s
- binary_sensor:
- - platform: jbd_bms_ble
- jbd_bms_ble_id: bms0
- balancing:
- name: "${name} balancing"
- charging:
- name: "${name} charging"
- discharging:
- name: "${name} discharging"
- online_status:
- name: "${name} online status"
- switch:
- - platform: restart
- name: "ESPhome PV18 Restart"
- - platform: ble_client
- ble_client_id: client0
- name: "${name} enable bluetooth connection"
- - platform: jbd_bms_ble
- jbd_bms_ble_id: bms0
- charging:
- name: "${name} charging"
- discharging:
- name: "${name} discharging"
- balancer:
- name: "${name} balancer"
- sensor:
- - platform: uptime
- name: Uptime Sensor
- # charger sensors
- - platform: modbus_controller
- address: 15201
- name: "Charger workstate"
- register_type: holding
- - platform: modbus_controller
- address: 15202
- name: "MPPT state"
- register_type: holding
- - platform: modbus_controller
- address: 15203
- name: "Charging state"
- register_type: holding
- - platform: modbus_controller
- address: 15205
- name: "PV voltage"
- register_type: holding
- unit_of_measurement: "V"
- accuracy_decimals: 1
- icon: mdi:sine-wave
- filters:
- multiply: 0.1
- - platform: modbus_controller
- address: 15206
- name: "Battery voltage (charger side)"
- register_type: holding
- unit_of_measurement: "V"
- accuracy_decimals: 1
- icon: mdi:sine-wave
- filters:
- multiply: 0.1
- - platform: modbus_controller
- address: 15207
- name: "Charger Current"
- register_type: holding
- unit_of_measurement: "A"
- accuracy_decimals: 1
- icon: mdi:current-dc
- filters:
- multiply: 0.1
- - platform: modbus_controller
- address: 15208
- register_type: holding
- name: "Charger power"
- unit_of_measurement: "W"
- accuracy_decimals: 1
- icon: mdi:flash
- - platform: modbus_controller
- address: 15211
- register_type: holding
- name: "Battery Relay"
- - platform: modbus_controller
- address: 15212
- register_type: holding
- name: "PV Relay"
- icon: mdi:electric-switch
- - platform: modbus_controller
- address: 15218
- register_type: holding
- name: "Accumulated charger power"
- unit_of_measurement: "kWh"
- accuracy_decimals: 1
- icon: mdi:flash
- filters:
- multiply: 0.1
- # 15217 RO Accumulated power high 1000KWH
- # inverter sensors
- - platform: modbus_controller
- address: 25201
- register_type: holding
- name: "Inverter Work state"
- - platform: modbus_controller
- address: 25205
- name: "Battery voltage"
- register_type: holding
- unit_of_measurement: "V"
- accuracy_decimals: 1
- icon: mdi:sine-wave
- filters:
- multiply: 0.1
- - platform: modbus_controller
- address: 25206
- name: "Inverter voltage"
- register_type: holding
- unit_of_measurement: "V"
- accuracy_decimals: 1
- icon: mdi:sine-wave
- filters:
- multiply: 0.1
- - platform: modbus_controller
- address: 25207
- name: "Grid voltage"
- register_type: holding
- unit_of_measurement: "V"
- accuracy_decimals: 1
- icon: mdi:sine-wave
- filters:
- multiply: 0.1
- - platform: modbus_controller
- address: 25208
- name: "Bus voltage"
- register_type: holding
- unit_of_measurement: "V"
- accuracy_decimals: 1
- icon: mdi:sine-wave
- filters:
- multiply: 0.1
- - platform: modbus_controller
- address: 25209
- name: "Control current"
- register_type: holding
- unit_of_measurement: "A"
- accuracy_decimals: 1
- icon: mdi:current-dc
- filters:
- multiply: 0.1
- - platform: modbus_controller
- address: 25210
- name: "Inverter current"
- register_type: holding
- unit_of_measurement: "A"
- accuracy_decimals: 1
- icon: mdi:current-dc
- filters:
- multiply: 0.1
- - platform: modbus_controller
- address: 25211
- name: "Grid current"
- register_type: holding
- unit_of_measurement: "A"
- accuracy_decimals: 1
- icon: mdi:current-dc
- filters:
- multiply: 0.1
- - platform: modbus_controller
- address: 25212
- name: "Load current"
- register_type: holding
- unit_of_measurement: "A"
- accuracy_decimals: 1
- icon: mdi:current-dc
- filters:
- multiply: 0.1
- - platform: modbus_controller
- address: 25213
- name: "Inverter power"
- register_type: holding
- unit_of_measurement: "W"
- accuracy_decimals: 1
- icon: mdi:flash
- - platform: modbus_controller
- address: 25214
- name: "Grid power"
- register_type: holding
- unit_of_measurement: "W"
- accuracy_decimals: 1
- value_type: S_WORD
- icon: mdi:flash
- - platform: modbus_controller
- address: 25215
- name: "Load power"
- register_type: holding
- unit_of_measurement: "W"
- accuracy_decimals: 1
- icon: mdi:flash
- - platform: modbus_controller
- address: 25216
- name: "System load"
- register_type: holding
- unit_of_measurement: "%"
- accuracy_decimals: 1
- icon: mdi:flash
- # 25217 Inverter complex power(S) 1 VA
- # 25218 Grid complex power(S) 1 VA
- # 25219 Load complex power(S) 1 VA
- # 25221 Inverter reactive power(Q) 1 var
- # 25222 Grid reactive power(Q) 1 var
- # 25223 Load reactive power(Q) 1 var
- # 25225 Inverter frequency 0.01 Hz
- # 25226 Grid frequency 0.01 Hz
- - platform: modbus_controller
- address: 25233
- register_type: holding
- name: "AC radiator temp"
- accuracy_decimals: 1
- unit_of_measurement: "°C"
- - platform: modbus_controller
- address: 25234
- register_type: holding
- name: "Transformer temp"
- unit_of_measurement: "°C"
- accuracy_decimals: 1
- - platform: modbus_controller
- address: 25235
- register_type: holding
- name: "DC Radiator temp"
- unit_of_measurement: "°C"
- accuracy_decimals: 1
- - platform: modbus_controller
- address: 25237
- register_type: holding
- name: "Inverter Relay"
- icon: mdi:electric-switch
- - platform: modbus_controller
- address: 25238
- register_type: holding
- name: "Grid Relay"
- icon: mdi:electric-switch
- - platform: modbus_controller
- address: 25239
- register_type: holding
- name: "Load Relay"
- icon: mdi:electric-switch
- - platform: modbus_controller
- address: 25240
- register_type: holding
- name: "N_Line Relay"
- icon: mdi:electric-switch
- - platform: modbus_controller
- address: 25241
- register_type: holding
- name: "DC Relay"
- icon: mdi:electric-switch
- - platform: modbus_controller
- address: 25242
- register_type: holding
- name: "Earth Relay"
- icon: mdi:electric-switch
- # statistics sensors
- # - platform: modbus_controller
- # address: 25246
- # register_type: holding
- # name: "Accumulated charger power"
- # unit_of_measurement: "kW"
- # accuracy_decimals: 1
- # icon: mdi:flash
- # filters:
- # multiply: 0.1
- - platform: modbus_controller
- address: 25248
- register_type: holding
- name: "Accumulated discharger power"
- unit_of_measurement: "kWh"
- accuracy_decimals: 1
- icon: mdi:flash
- filters:
- multiply: 0.1
- - platform: modbus_controller
- address: 25250
- register_type: holding
- name: "Accumulated buy power"
- unit_of_measurement: "kWh"
- accuracy_decimals: 1
- icon: mdi:flash
- filters:
- multiply: 0.1
- - platform: modbus_controller
- address: 25252
- register_type: holding
- name: "Accumulated sell power"
- unit_of_measurement: "kWh"
- accuracy_decimals: 1
- icon: mdi:flash
- filters:
- multiply: 0.1
- - platform: modbus_controller
- address: 25254
- register_type: holding
- name: "Accumulated load power"
- unit_of_measurement: "kWh"
- accuracy_decimals: 1
- icon: mdi:flash
- filters:
- multiply: 0.1
- - platform: modbus_controller
- address: 25256
- register_type: holding
- name: "Accumulated self_use power"
- unit_of_measurement: "kWh"
- accuracy_decimals: 1
- icon: mdi:flash
- filters:
- multiply: 0.1
- - platform: modbus_controller
- address: 25258
- register_type: holding
- name: "Accumulated PV_sell power"
- unit_of_measurement: "kWh"
- accuracy_decimals: 1
- icon: mdi:flash
- filters:
- multiply: 0.1
- - platform: modbus_controller
- address: 25260
- register_type: holding
- name: "Accumulated grid_charger power"
- unit_of_measurement: "kWh"
- accuracy_decimals: 1
- icon: mdi:flash
- filters:
- multiply: 0.1
- - platform: modbus_controller
- address: 25273
- register_type: holding
- value_type: S_WORD
- name: "Battery power"
- unit_of_measurement: "W"
- accuracy_decimals: 1
- icon: mdi:flash
- - platform: modbus_controller
- address: 25274
- register_type: holding
- value_type: S_WORD
- name: "Battery current"
- unit_of_measurement: "A"
- accuracy_decimals: 1
- icon: mdi:current-dc
- - platform: jbd_bms_ble
- jbd_bms_ble_id: bms0
- battery_strings:
- name: "${name} battery strings"
- current:
- name: "${name} current"
- power:
- name: "${name} power"
- charging_power:
- name: "${name} charging power"
- discharging_power:
- name: "${name} discharging power"
- state_of_charge:
- name: "${name} state of charge"
- nominal_capacity:
- name: "${name} nominal capacity"
- charging_cycles:
- name: "${name} charging cycles"
- capacity_remaining:
- name: "${name} capacity remaining"
- battery_cycle_capacity:
- name: "${name} battery cycle capacity"
- total_voltage:
- name: "${name} total voltage"
- average_cell_voltage:
- name: "${name} average cell voltage"
- delta_cell_voltage:
- name: "${name} delta cell voltage"
- min_cell_voltage:
- name: "${name} min cell voltage"
- max_cell_voltage:
- name: "${name} max cell voltage"
- min_voltage_cell:
- name: "${name} min voltage cell"
- max_voltage_cell:
- name: "${name} max voltage cell"
- temperature_1:
- name: "${name} temperature 1"
- temperature_2:
- name: "${name} temperature 2"
- temperature_3:
- name: "${name} temperature 3"
- cell_voltage_1:
- name: "${name} cell voltage 01"
- cell_voltage_2:
- name: "${name} cell voltage 02"
- cell_voltage_3:
- name: "${name} cell voltage 03"
- cell_voltage_4:
- name: "${name} cell voltage 04"
- cell_voltage_5:
- name: "${name} cell voltage 05"
- cell_voltage_6:
- name: "${name} cell voltage 06"
- cell_voltage_7:
- name: "${name} cell voltage 07"
- cell_voltage_8:
- name: "${name} cell voltage 08"
- cell_voltage_9:
- name: "${name} cell voltage 09"
- cell_voltage_10:
- name: "${name} cell voltage 10"
- cell_voltage_11:
- name: "${name} cell voltage 11"
- cell_voltage_12:
- name: "${name} cell voltage 12"
- cell_voltage_13:
- name: "${name} cell voltage 13"
- cell_voltage_14:
- name: "${name} cell voltage 14"
- operation_status_bitmask:
- name: "${name} operation status bitmask"
- errors_bitmask:
- name: "${name} errors bitmask"
- balancer_status_bitmask:
- name: "${name} balancer status bitmask"
- software_version:
- name: "${name} software version"
- # RSSI based on MAC address
- - platform: ble_rssi
- mac_address: A4:C1:37:50:75:C6
- name: "rssi jbd"
- - platform: wifi_signal
- name: "WiFi FVE"
- update_interval: 60s
- text_sensor:
- - platform: jbd_bms_ble
- jbd_bms_ble_id: bms0
- errors:
- name: "${name} errors"
- operation_status:
- name: "${name} operation status"
- device_model:
- name: "${name} device model"
Advertisement
Add Comment
Please, Sign In to add comment