mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 17:59:27 +02:00
Make SOC missing warning with more info
This commit is contained in:
parent
5aec27eb5b
commit
db455caaf2
3 changed files with 7 additions and 3 deletions
|
@ -82,11 +82,11 @@ void update_values_battery() {
|
||||||
//SOC% not available. Raise warning event if we go too long without SOC
|
//SOC% not available. Raise warning event if we go too long without SOC
|
||||||
timespent_without_soc++;
|
timespent_without_soc++;
|
||||||
if (timespent_without_soc > FIVE_MINUTES) {
|
if (timespent_without_soc > FIVE_MINUTES) {
|
||||||
set_event(EVENT_SOC_PLAUSIBILITY_ERROR, 0);
|
set_event(EVENT_SOC_UNAVAILABLE, 0);
|
||||||
}
|
}
|
||||||
} else { //SOC is available, stop counting and clear error
|
} else { //SOC is available, stop counting and clear error
|
||||||
timespent_without_soc = 0;
|
timespent_without_soc = 0;
|
||||||
clear_event(EVENT_SOC_PLAUSIBILITY_ERROR);
|
clear_event(EVENT_SOC_UNAVAILABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
datalayer.battery.status.soh_pptt; // This BMS does not have a SOH% formula
|
datalayer.battery.status.soh_pptt; // This BMS does not have a SOH% formula
|
||||||
|
|
|
@ -145,6 +145,7 @@ void init_events(void) {
|
||||||
events.entries[EVENT_DISCHARGE_LIMIT_EXCEEDED].level = EVENT_LEVEL_INFO;
|
events.entries[EVENT_DISCHARGE_LIMIT_EXCEEDED].level = EVENT_LEVEL_INFO;
|
||||||
events.entries[EVENT_12V_LOW].level = EVENT_LEVEL_WARNING;
|
events.entries[EVENT_12V_LOW].level = EVENT_LEVEL_WARNING;
|
||||||
events.entries[EVENT_SOC_PLAUSIBILITY_ERROR].level = EVENT_LEVEL_ERROR;
|
events.entries[EVENT_SOC_PLAUSIBILITY_ERROR].level = EVENT_LEVEL_ERROR;
|
||||||
|
events.entries[EVENT_SOC_UNAVAILABLE].level = EVENT_LEVEL_WARNING;
|
||||||
events.entries[EVENT_KWH_PLAUSIBILITY_ERROR].level = EVENT_LEVEL_INFO;
|
events.entries[EVENT_KWH_PLAUSIBILITY_ERROR].level = EVENT_LEVEL_INFO;
|
||||||
events.entries[EVENT_BATTERY_EMPTY].level = EVENT_LEVEL_INFO;
|
events.entries[EVENT_BATTERY_EMPTY].level = EVENT_LEVEL_INFO;
|
||||||
events.entries[EVENT_BATTERY_FULL].level = EVENT_LEVEL_INFO;
|
events.entries[EVENT_BATTERY_FULL].level = EVENT_LEVEL_INFO;
|
||||||
|
@ -255,6 +256,8 @@ const char* get_event_message_string(EVENTS_ENUM_TYPE event) {
|
||||||
return "12V battery source below required voltage to safely close contactors. Inspect the supply/battery!";
|
return "12V battery source below required voltage to safely close contactors. Inspect the supply/battery!";
|
||||||
case EVENT_SOC_PLAUSIBILITY_ERROR:
|
case EVENT_SOC_PLAUSIBILITY_ERROR:
|
||||||
return "ERROR: SOC% reported by battery not plausible. Restart battery!";
|
return "ERROR: SOC% reported by battery not plausible. Restart battery!";
|
||||||
|
case EVENT_SOC_UNAVAILABLE:
|
||||||
|
return "Warning: SOC% not sent by BMS. Calibrate BMS via app.";
|
||||||
case EVENT_KWH_PLAUSIBILITY_ERROR:
|
case EVENT_KWH_PLAUSIBILITY_ERROR:
|
||||||
return "Info: kWh remaining reported by battery not plausible. Battery needs cycling.";
|
return "Info: kWh remaining reported by battery not plausible. Battery needs cycling.";
|
||||||
case EVENT_BATTERY_EMPTY:
|
case EVENT_BATTERY_EMPTY:
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
// #define INCLUDE_EVENTS_TEST // Enable to run an event test loop, see events_test_on_target.cpp
|
// #define INCLUDE_EVENTS_TEST // Enable to run an event test loop, see events_test_on_target.cpp
|
||||||
|
|
||||||
#define EE_MAGIC_HEADER_VALUE 0x0011 // 0x0000 to 0xFFFF
|
#define EE_MAGIC_HEADER_VALUE 0x0012 // 0x0000 to 0xFFFF
|
||||||
|
|
||||||
#define GENERATE_ENUM(ENUM) ENUM,
|
#define GENERATE_ENUM(ENUM) ENUM,
|
||||||
#define GENERATE_STRING(STRING) #STRING,
|
#define GENERATE_STRING(STRING) #STRING,
|
||||||
|
@ -38,6 +38,7 @@
|
||||||
XX(EVENT_WATER_INGRESS) \
|
XX(EVENT_WATER_INGRESS) \
|
||||||
XX(EVENT_12V_LOW) \
|
XX(EVENT_12V_LOW) \
|
||||||
XX(EVENT_SOC_PLAUSIBILITY_ERROR) \
|
XX(EVENT_SOC_PLAUSIBILITY_ERROR) \
|
||||||
|
XX(EVENT_SOC_UNAVAILABLE) \
|
||||||
XX(EVENT_KWH_PLAUSIBILITY_ERROR) \
|
XX(EVENT_KWH_PLAUSIBILITY_ERROR) \
|
||||||
XX(EVENT_BATTERY_EMPTY) \
|
XX(EVENT_BATTERY_EMPTY) \
|
||||||
XX(EVENT_BATTERY_FULL) \
|
XX(EVENT_BATTERY_FULL) \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue