14 LOG_SENSOR(
" ",
"Voltage", this->voltage_sensor_);
15 LOG_SENSOR(
" ",
"Current", this->current_sensor_);
16 LOG_SENSOR(
" ",
"Temperature", this->temperature_sensor_);
17 LOG_SENSOR(
" ",
"Temperature low", this->temperature_low_sensor_);
18 LOG_SENSOR(
" ",
"Temperature high", this->temperature_high_sensor_);
19 LOG_SENSOR(
" ",
"Voltage low", this->voltage_low_sensor_);
20 LOG_SENSOR(
" ",
"Voltage high", this->voltage_high_sensor_);
21 LOG_SENSOR(
" ",
"Coulomb", this->coulomb_sensor_);
22 LOG_SENSOR(
" ",
"MOS Temperature", this->mos_temperature_sensor_);
23#ifdef PYLONTECH_SENSOR_CELL_COUNT
25 ESP_LOGCONFIG(TAG,
" Cell %u", c.cell);
26 LOG_SENSOR(
" ",
"Voltage", c.voltage);
27 LOG_SENSOR(
" ",
"Temperature", c.temperature);
33 PUBLISH_STATE(this->voltage_sensor_, ((
float) line->
volt) / 1000.0f);
34 PUBLISH_STATE(this->current_sensor_, ((
float) line->
curr) / 1000.0f);
35 PUBLISH_STATE(this->temperature_sensor_, ((
float) line->
tempr) / 1000.0f);
36 PUBLISH_STATE(this->temperature_low_sensor_, ((
float) line->
tlow) / 1000.0f);
37 PUBLISH_STATE(this->temperature_high_sensor_, ((
float) line->
thigh) / 1000.0f);
38 PUBLISH_STATE(this->voltage_low_sensor_, ((
float) line->
vlow) / 1000.0f);
39 PUBLISH_STATE(this->voltage_high_sensor_, ((
float) line->
vhigh) / 1000.0f);
40 PUBLISH_STATE(this->coulomb_sensor_, line->
coulomb);
41 PUBLISH_STATE(this->mos_temperature_sensor_, ((
float) line->
mostempr) / 1000.0f);
44#ifdef PYLONTECH_SENSOR_CELL_COUNT
47 if ((read & (1u << c.cell)) == 0) {
50 PUBLISH_STATE(c.voltage, ((
float) cells[c.cell].volt) / 1000.0f);
51 PUBLISH_STATE(c.temperature, ((
float) cells[c.cell].tempr) / 100.0f);
virtual void on_line_read(LineContents *line)=0
Called only with records for this listener's battery.
std::array< CellContents, MAX_CELLS > CellArray
void dump_config() override
void on_cells_read(const CellArray &cells, cell_mask_t read) override
StaticVector< CellSensors, PYLONTECH_SENSOR_CELL_COUNT > cells_
ESPHOME_LOG_TAG(TAG, "pylontech")