mirror of
https://github.com/esphome/esphome.git
synced 2025-01-18 12:05:41 +00:00
Increase Daly-BMS coltage cells from 16 to 18 cells (#8057)
This commit is contained in:
parent
820e3488d0
commit
07be7ad7e2
@ -298,6 +298,12 @@ void DalyBmsComponent::decode_data_(std::vector<uint8_t> data) {
|
|||||||
if (this->cell_16_voltage_sensor_) {
|
if (this->cell_16_voltage_sensor_) {
|
||||||
this->cell_16_voltage_sensor_->publish_state((float) encode_uint16(it[5], it[6]) / 1000);
|
this->cell_16_voltage_sensor_->publish_state((float) encode_uint16(it[5], it[6]) / 1000);
|
||||||
}
|
}
|
||||||
|
if (this->cell_17_voltage_sensor_) {
|
||||||
|
this->cell_17_voltage_sensor_->publish_state((float) encode_uint16(it[7], it[8]) / 1000);
|
||||||
|
}
|
||||||
|
if (this->cell_18_voltage_sensor_) {
|
||||||
|
this->cell_18_voltage_sensor_->publish_state((float) encode_uint16(it[9], it[10]) / 1000);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -54,6 +54,8 @@ class DalyBmsComponent : public PollingComponent, public uart::UARTDevice {
|
|||||||
SUB_SENSOR(cell_14_voltage)
|
SUB_SENSOR(cell_14_voltage)
|
||||||
SUB_SENSOR(cell_15_voltage)
|
SUB_SENSOR(cell_15_voltage)
|
||||||
SUB_SENSOR(cell_16_voltage)
|
SUB_SENSOR(cell_16_voltage)
|
||||||
|
SUB_SENSOR(cell_17_voltage)
|
||||||
|
SUB_SENSOR(cell_18_voltage)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_TEXT_SENSOR
|
#ifdef USE_TEXT_SENSOR
|
||||||
|
@ -52,6 +52,8 @@ CONF_CELL_13_VOLTAGE = "cell_13_voltage"
|
|||||||
CONF_CELL_14_VOLTAGE = "cell_14_voltage"
|
CONF_CELL_14_VOLTAGE = "cell_14_voltage"
|
||||||
CONF_CELL_15_VOLTAGE = "cell_15_voltage"
|
CONF_CELL_15_VOLTAGE = "cell_15_voltage"
|
||||||
CONF_CELL_16_VOLTAGE = "cell_16_voltage"
|
CONF_CELL_16_VOLTAGE = "cell_16_voltage"
|
||||||
|
CONF_CELL_17_VOLTAGE = "cell_17_voltage"
|
||||||
|
CONF_CELL_18_VOLTAGE = "cell_18_voltage"
|
||||||
ICON_CURRENT_DC = "mdi:current-dc"
|
ICON_CURRENT_DC = "mdi:current-dc"
|
||||||
ICON_BATTERY_OUTLINE = "mdi:battery-outline"
|
ICON_BATTERY_OUTLINE = "mdi:battery-outline"
|
||||||
ICON_THERMOMETER_CHEVRON_UP = "mdi:thermometer-chevron-up"
|
ICON_THERMOMETER_CHEVRON_UP = "mdi:thermometer-chevron-up"
|
||||||
@ -92,6 +94,8 @@ TYPES = [
|
|||||||
CONF_CELL_14_VOLTAGE,
|
CONF_CELL_14_VOLTAGE,
|
||||||
CONF_CELL_15_VOLTAGE,
|
CONF_CELL_15_VOLTAGE,
|
||||||
CONF_CELL_16_VOLTAGE,
|
CONF_CELL_16_VOLTAGE,
|
||||||
|
CONF_CELL_17_VOLTAGE,
|
||||||
|
CONF_CELL_18_VOLTAGE,
|
||||||
]
|
]
|
||||||
|
|
||||||
CELL_VOLTAGE_SCHEMA = sensor.sensor_schema(
|
CELL_VOLTAGE_SCHEMA = sensor.sensor_schema(
|
||||||
@ -212,6 +216,8 @@ CONFIG_SCHEMA = cv.All(
|
|||||||
cv.Optional(CONF_CELL_14_VOLTAGE): CELL_VOLTAGE_SCHEMA,
|
cv.Optional(CONF_CELL_14_VOLTAGE): CELL_VOLTAGE_SCHEMA,
|
||||||
cv.Optional(CONF_CELL_15_VOLTAGE): CELL_VOLTAGE_SCHEMA,
|
cv.Optional(CONF_CELL_15_VOLTAGE): CELL_VOLTAGE_SCHEMA,
|
||||||
cv.Optional(CONF_CELL_16_VOLTAGE): CELL_VOLTAGE_SCHEMA,
|
cv.Optional(CONF_CELL_16_VOLTAGE): CELL_VOLTAGE_SCHEMA,
|
||||||
|
cv.Optional(CONF_CELL_17_VOLTAGE): CELL_VOLTAGE_SCHEMA,
|
||||||
|
cv.Optional(CONF_CELL_18_VOLTAGE): CELL_VOLTAGE_SCHEMA,
|
||||||
}
|
}
|
||||||
).extend(cv.COMPONENT_SCHEMA)
|
).extend(cv.COMPONENT_SCHEMA)
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user