We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP_LOGV(TAG, "Number of cells: %d", cells); // 9 0x0C 0xD7 Cell voltage 1 3287 * 0.001f = 3.287 V // 11 0x0C 0xE9 Cell voltage 2 3305 * 0.001f = 3.305 V // ... ... ... // 39 0x0C 0xD8 Cell voltage 16 V float min_cell_voltage = 100.0f; float max_cell_voltage = -100.0f; float average_cell_voltage = 0.0f; uint8_t min_voltage_cell = 0; uint8_t max_voltage_cell = 0; for (uint8_t i = 0; i < std::min((uint8_t) 16, cells); i++) { float cell_voltage = (float) seplos_get_16bit(9 + (i * 2)) * 0.001f; average_cell_voltage = average_cell_voltage + cell_voltage; if (cell_voltage < min_cell_voltage) { min_cell_voltage = cell_voltage; min_voltage_cell = i + 1; } if (cell_voltage > max_cell_voltage) { max_cell_voltage = cell_voltage; max_voltage_cell = i + 1; } this->publish_state_(this->cells_[i].cell_voltage_sensor_, cell_voltage); } average_cell_voltage = average_cell_voltage / cells; this->publish_state_(this->min_cell_voltage_sensor_, min_cell_voltage); this->publish_state_(this->max_cell_voltage_sensor_, max_cell_voltage); this->publish_state_(this->max_voltage_cell_sensor_, (float) max_voltage_cell); this->publish_state_(this->min_voltage_cell_sensor_, (float) min_voltage_cell); this->publish_state_(this->delta_cell_voltage_sensor_, max_cell_voltage - min_cell_voltage); this->publish_state_(this->average_cell_voltage_sensor_
The text was updated successfully, but these errors were encountered:
Add calculated sensors (Closes: #2)
6d741ff
67e5103
No branches or pull requests
The text was updated successfully, but these errors were encountered: