OpenDTU-old/include/Battery.h
MalteSchm 20bb7fc372
Show (Pylontech) battery infos in Live View
* adding data age to battery data

* Add battery enabled flag

* Webapi and websocket api for Battery

* Webinterface for battery

* fixed bug due to naming inconsistencies

* cleaned up rounding

* dist update

* change typename to uppercase

* reverting to original file
2023-04-02 20:58:28 +02:00

46 lines
978 B
C++

// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <stdint.h>
class BatteryClass {
public:
uint32_t lastUpdate;
float chargeVoltage;
float chargeCurrentLimitation;
float dischargeCurrentLimitation;
uint16_t stateOfCharge;
uint32_t stateOfChargeLastUpdate;
uint16_t stateOfHealth;
float voltage;
float current;
float temperature;
bool alarmOverCurrentDischarge;
bool alarmUnderTemperature;
bool alarmOverTemperature;
bool alarmUnderVoltage;
bool alarmOverVoltage;
bool alarmBmsInternal;
bool alarmOverCurrentCharge;
bool warningHighCurrentDischarge;
bool warningLowTemperature;
bool warningHighTemperature;
bool warningLowVoltage;
bool warningHighVoltage;
bool warningBmsInternal;
bool warningHighCurrentCharge;
char manufacturer[9];
bool chargeEnabled;
bool dischargeEnabled;
bool chargeImmediately;
private:
};
extern BatteryClass Battery;