Skip to content

Commit

Permalink
Add new range of JK BMS (JK-PB) support
Browse files Browse the repository at this point in the history
See #390
  • Loading branch information
syssi committed Jan 11, 2024
1 parent fce880e commit be6c353
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ jobs:
esphome -s external_components_source components config esp32-ble-example-multiple-devices.yaml
esphome -s external_components_source components config esp32-ble-uart-hybrid-example.yaml
esphome -s external_components_source components config esp32-ble-v11-example.yaml
- name: Compile esp32 (modbus) example configurations
run: |
esphome config esp32-jk-pb-modbus-example.yaml
- name: Write yaml-snippets/secrets.yaml
shell: bash
Expand Down Expand Up @@ -249,3 +252,6 @@ jobs:
run: |
esphome -s external_components_source components compile esp32-ble-example-faker.yaml
esphome -s external_components_source components compile esp32-ble-v11-example.yaml
- name: Compile esp32 (modbus) example configurations
run: |
esphome compile esp32-jk-pb-modbus-example.yaml
71 changes: 71 additions & 0 deletions esp32-jk-pb-modbus-example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
substitutions:
name: jk-bms
device_description: "Monitor a JK-BMS (JK-PB series) via Modbus"
external_components_source: github://syssi/esphome-jk-bms@main
tx_pin: GPIO16
rx_pin: GPIO17

esphome:
name: ${name}
comment: ${device_description}
project:
name: "syssi.esphome-jk-bms"
version: 1.5.0

esp32:
board: wemos_d1_mini32
framework:
type: esp-idf

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password

ota:

logger:
level: DEBUG

# If you use Home Assistant please remove this `mqtt` section and uncomment the `api` component!
# The native API has many advantages over MQTT: https://esphome.io/components/api.html#advantages-over-mqtt
mqtt:
broker: !secret mqtt_host
username: !secret mqtt_username
password: !secret mqtt_password
id: mqtt_client

# api:

uart:
- id: uart_0
baud_rate: 115200
rx_buffer_size: 384
tx_pin: ${tx_pin}
rx_pin: ${rx_pin}

modbus:
id: modbus0

modbus_controller:
- id: bms0
# Address of the Modbus slave device on the bus
address: 0x01
modbus_id: modbus0
setup_priority: -10
update_interval: 5s
command_throttle: 50ms

sensor:
# 0x1200 index 0x90 Battery Voltage
- platform: modbus_controller
modbus_controller_id: bms0
name: "${name} total voltage"
address: 0x1290
register_type: holding
value_type: U_DWORD_R
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 3
filters:
- multiply: 0.001

0 comments on commit be6c353

Please sign in to comment.