Hey folks,
After (… a lot of …), I’ve finally uncovered how to natively integrate the REC BMS with Home Assistant using its built-in JSON API! This works with the optional WiFi module.
Key discovery:
The WiFi module exposes a REST endpoint at:
http://<your_wifi_module_ip>/cell
returning a comprehensive JSON structure with all essential BMS data.
API response structure:
{
"bms_array": {
"master": {
"time_remaining": "...",
"st_naprav": ...,
"mincell": ...,
"maxcell": ...,
"ibat": ...,
"tmax": ...,
"vbat": ...,
"soc": ...,
"soh": ...,
"erro": {
"present": 0,
"addr": 1,
"st": 0,
"con_st": 0
}
},
"slave": {
"0": {
"temp_bms": ...,
"temp": [...],
"res": [...],
"nap": [...]
}
}
}
}
Implementation steps:
- REST Sensor Configuration (YAML):
# REST sensor to fetch BMS data
- platform: rest
name: BMS Master Data
resource: http://[BMS_IP_ADDRESS]/cell
scan_interval: 60
json_attributes_path: "$.bms_array"
json_attributes:
- master
- slave
value_template: "{{ 'OK' if value_json.bms_array.master.error == '' else 'ERROR' }}"
- Template Sensors (Partial YAML example):
# Voltage/Current/SOC
- platform: template
sensors:
bms_master_vbat:
friendly_name: "Battery Voltage"
unit_of_measurement: "V"
value_template: "{{ state_attr('sensor.bms_master_data', 'master')['vbat'] | float }}"
device_class: voltage
bms_master_soc:
friendly_name: "State of Charge"
unit_of_measurement: "%"
value_template: "{{ (state_attr('sensor.bms_master_data', 'master')['soc'] * 100) | int }}"
device_class: battery
# Cell voltages (Slave 0)
bms_slave0_cell0_voltage:
friendly_name: "Cell 0 Voltage"
unit_of_measurement: "V"
value_template: "{{ state_attr('sensor.bms_master_data', 'slave')['0']['nap']['0'] | float }}"
device_class: voltage
# Temperature monitoring
bms_slave0_temp_bms:
friendly_name: "BMS Temperature"
unit_of_measurement: "°C"
value_template: "{{ state_attr('sensor.bms_master_data', 'slave')['0']['temp_bms'] | float }}"
cheers
Mikel