Skip to content

Commit

Permalink
Fix delta cell voltage sensor (#27)
Browse files Browse the repository at this point in the history
See #25
  • Loading branch information
syssi authored Nov 7, 2024
1 parent 584aaaf commit be4ca95
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ esphome run esp32-ble-example.yaml
[11:50:17][D][binary_sensor:036]: 'daly-bms-ble balancing': Sending state ON
[11:50:17][D][binary_sensor:036]: 'daly-bms-ble charging': Sending state OFF
[11:50:17][D][binary_sensor:036]: 'daly-bms-ble discharging': Sending state ON
[D][sensor:094]: 'daly-bms-ble delta cell voltage': Sending state 0.02040 V with 4 decimals of accuracy
[D][sensor:094]: 'daly-bms-ble delta cell voltage': Sending state 0.204 V with 3 decimals of accuracy
[D][sensor:094]: 'daly-bms-ble power': Sending state 0.00000 W with 0 decimals of accuracy
[D][sensor:094]: 'daly-bms-ble charging power': Sending state 0.00000 W with 0 decimals of accuracy
[D][sensor:094]: 'daly-bms-ble discharging power': Sending state 0.00000 W with 0 decimals of accuracy
Expand Down
2 changes: 1 addition & 1 deletion components/daly_bms_ble/daly_bms_ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void DalyBmsBle::decode_status_data_(const std::vector<uint8_t> &data) {
ESP_LOGV(TAG, "Average cell voltage: %.3f V", daly_get_16bit(113) * 0.001f);

// 115 2 0x01 0x41 Delta cell voltage
this->publish_state_(this->delta_cell_voltage_sensor_, daly_get_16bit(115) * 0.0001f);
this->publish_state_(this->delta_cell_voltage_sensor_, daly_get_16bit(115) * 0.001f);

// 117 2 0x00 0x2A Power
float power = daly_get_16bit(117) * 1.0f;
Expand Down
2 changes: 1 addition & 1 deletion components/daly_bms_ble/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
cv.Optional(CONF_DELTA_CELL_VOLTAGE): sensor.sensor_schema(
unit_of_measurement=UNIT_VOLT,
icon=ICON_EMPTY,
accuracy_decimals=4,
accuracy_decimals=3,
device_class=DEVICE_CLASS_VOLTAGE,
state_class=STATE_CLASS_MEASUREMENT,
),
Expand Down

0 comments on commit be4ca95

Please sign in to comment.