Skip to content

Commit

Permalink
adding data age to battery data
Browse files Browse the repository at this point in the history
  • Loading branch information
MalteSchm committed Apr 1, 2023
1 parent d1e43c1 commit e514ef7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/Battery.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

class BatteryClass {
public:
uint32_t lastUpdate;

float chargeVoltage;
float chargeCurrentLimitation;
float dischargeCurrentLimitation;
Expand Down
1 change: 1 addition & 0 deletions src/PylontechCanReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ void PylontechCanReceiverClass::parseCanPackets()
Battery.stateOfCharge = this->readUnsignedInt16(rx_message.data);
Battery.stateOfChargeLastUpdate = millis();
Battery.stateOfHealth = this->readUnsignedInt16(rx_message.data + 2);
Battery.lastUpdate = millis();

#ifdef PYLONTECH_DEBUG_ENABLED
MessageOutput.printf("[Pylontech] soc: %d soh: %d\n",
Expand Down

0 comments on commit e514ef7

Please sign in to comment.