8static const char *
const TAG =
"pylontech.sensor";
17 LOG_SENSOR(
" ",
"Voltage", this->voltage_sensor_);
18 LOG_SENSOR(
" ",
"Current", this->current_sensor_);
19 LOG_SENSOR(
" ",
"Temperature", this->temperature_sensor_);
20 LOG_SENSOR(
" ",
"Temperature low", this->temperature_low_sensor_);
21 LOG_SENSOR(
" ",
"Temperature high", this->temperature_high_sensor_);
22 LOG_SENSOR(
" ",
"Voltage low", this->voltage_low_sensor_);
23 LOG_SENSOR(
" ",
"Voltage high", this->voltage_high_sensor_);
24 LOG_SENSOR(
" ",
"Coulomb", this->coulomb_sensor_);
25 LOG_SENSOR(
" ",
"MOS Temperature", this->mos_temperature_sensor_);
32 if (this->voltage_sensor_ !=
nullptr) {
33 this->voltage_sensor_->publish_state(((
float) line->
volt) / 1000.0f);
35 if (this->current_sensor_ !=
nullptr) {
36 this->current_sensor_->publish_state(((
float) line->
curr) / 1000.0f);
38 if (this->temperature_sensor_ !=
nullptr) {
39 this->temperature_sensor_->publish_state(((
float) line->
tempr) / 1000.0f);
41 if (this->temperature_low_sensor_ !=
nullptr) {
42 this->temperature_low_sensor_->publish_state(((
float) line->
tlow) / 1000.0f);
44 if (this->temperature_high_sensor_ !=
nullptr) {
45 this->temperature_high_sensor_->publish_state(((
float) line->
thigh) / 1000.0f);
47 if (this->voltage_low_sensor_ !=
nullptr) {
48 this->voltage_low_sensor_->publish_state(((
float) line->
vlow) / 1000.0f);
50 if (this->voltage_high_sensor_ !=
nullptr) {
51 this->voltage_high_sensor_->publish_state(((
float) line->
vhigh) / 1000.0f);
53 if (this->coulomb_sensor_ !=
nullptr) {
54 this->coulomb_sensor_->publish_state(line->
coulomb);
56 if (this->mos_temperature_sensor_ !=
nullptr) {
57 this->mos_temperature_sensor_->publish_state(((
float) line->
mostempr) / 1000.0f);
virtual void on_line_read(LineContents *line)
void dump_config() override
PylontechSensor(int8_t bat_num)
Providing packet encoding functions for exchanging data with a remote host.