diff --git a/csharp/App/Backend/Controller.cs b/csharp/App/Backend/Controller.cs index e8f508340..a014cd253 100644 --- a/csharp/App/Backend/Controller.cs +++ b/csharp/App/Backend/Controller.cs @@ -763,13 +763,10 @@ public class Controller : ControllerBase installation.Product != (int)ProductType.SodiStoreMax) return BadRequest("AI diagnostics not available for this product."); - if (!DiagnosticService.IsEnabled) - return StatusCode(503, "AI diagnostics not configured."); - var result = await DiagnosticService.DiagnoseAsync(installationId, errorDescription); if (result is null) - return StatusCode(500, "Diagnosis failed – please try again later."); + return NoContent(); // no diagnosis available (not in knowledge base, no API key) return result; } @@ -784,16 +781,17 @@ public class Controller : ControllerBase { var testCases = new[] { - // Sinexcel alarms - "Fan fault", - "Abnormal grid voltage", - "Battery 1not connected", - "Inverter power tube fault", - "Island protection", - // Growatt alarms - "Warning 300", - "Warning 500", - "Error 408", + // Sinexcel alarms (keys match SinexcelRecord.Api.cs property names) + "FanFault", + "AbnormalGridVoltage", + "Battery1NotConnected", + "InverterPowerTubeFault", + "IslandProtection", + // Growatt alarms (keys match GrowattWarningCode/GrowattErrorCode enum names) + "NoUtilityGrid", + "BatteryCommunicationFailure", + "BmsFault", + "OverTemperature", "AFCI Fault", // Unknown alarm (should return null - would call Mistral) "Some unknown alarm XYZ123" diff --git a/csharp/App/Backend/Services/AlarmKnowledgeBase.cs b/csharp/App/Backend/Services/AlarmKnowledgeBase.cs index 15848c769..945ef5146 100644 --- a/csharp/App/Backend/Services/AlarmKnowledgeBase.cs +++ b/csharp/App/Backend/Services/AlarmKnowledgeBase.cs @@ -44,31 +44,31 @@ public static class AlarmKnowledgeBase private static readonly IReadOnlyDictionary SinexcelAlarms = new Dictionary { // Grid-related alarms - ["Abnormal grid voltage"] = new() + ["AbnormalGridVoltage"] = new() { Explanation = "The inverter has detected that the grid voltage is outside the acceptable operating range. This is an ERROR level condition requiring manual intervention.", Causes = new[] { "Utility grid voltage fluctuation", "Poor grid connection", "Local transformer issues", "High load demand on grid" }, NextSteps = new[] { "Check the grid voltage with a multimeter", "Verify grid connection wiring", "Fix the underlying cause", "Restart the inverter after the issue is resolved" } }, - ["Abnormal grid frequency"] = new() + ["AbnormalGridFrequency"] = new() { Explanation = "The inverter has detected that the grid frequency is outside the acceptable range (typically 50Hz or 60Hz +/- tolerance). This is an ERROR level condition.", Causes = new[] { "Grid instability", "Generator frequency drift", "Local grid issues" }, NextSteps = new[] { "Check grid frequency stability", "If using a generator, verify its frequency setting", "Fix the cause, then restart the inverter" } }, - ["Inverted sequenceof grid voltage"] = new() + ["InvertedSequenceOfGridVoltage"] = new() { Explanation = "The phase sequence of the three-phase grid voltage is reversed. This is a WARNING level condition.", Causes = new[] { "Incorrect wiring of grid phases (L1, L2, L3)", "Installation error" }, NextSteps = new[] { "Power off the system safely", "Swap any two phase wires to correct the sequence", "Restart the inverter" } }, - ["Grid voltage phase loss"] = new() + ["GridVoltagePhaseLoss"] = new() { Explanation = "One or more phases of the three-phase grid connection are missing. This is an ERROR level condition.", Causes = new[] { "Blown fuse on one phase", "Loose connection on a phase wire", "Grid-side breaker tripped", "Cable damage" }, NextSteps = new[] { "Check all three phase connections", "Verify fuses and breakers", "Fix the missing phase connection", "Restart after repair" } }, - ["Abnormal grid current"] = new() + ["AbnormalGridCurrent"] = new() { Explanation = "The grid current is abnormal, which may indicate overcurrent or current imbalance. This is an ERROR level condition.", Causes = new[] { "Grid-side short circuit", "Overloaded system", "Faulty current sensor", "Ground fault" }, @@ -76,25 +76,25 @@ public static class AlarmKnowledgeBase }, // Output-related alarms - ["Abnormal output voltage"] = new() + ["AbnormalOutputVoltage"] = new() { Explanation = "The inverter's output voltage is outside acceptable limits. This is an ERROR level condition.", Causes = new[] { "Internal inverter fault", "Overload condition", "Grid voltage influence" }, NextSteps = new[] { "Check connected load", "Verify inverter settings", "Fix the cause, then restart the inverter" } }, - ["Abnormal output frequency"] = new() + ["AbnormalOutputFrequency"] = new() { Explanation = "The inverter's output frequency is abnormal. This is an ERROR level condition.", Causes = new[] { "Internal control system fault", "Heavy load transients" }, NextSteps = new[] { "Reduce load if possible", "Fix the cause, then restart the inverter" } }, - ["Abnormalnullline"] = new() + ["AbnormalNullLine"] = new() { Explanation = "The neutral line connection is abnormal. This is an ERROR level condition.", Causes = new[] { "Loose or missing neutral wire", "Neutral wire damage", "Incorrect wiring" }, NextSteps = new[] { "Power off safely", "Check neutral wire connection", "Fix wiring issues", "Restart after repair" } }, - ["Abnormaloff-grid output voltage"] = new() + ["AbnormalOffGridOutputVoltage"] = new() { Explanation = "The off-grid (backup) output voltage is abnormal. This is an ERROR level condition.", Causes = new[] { "Overload on backup output", "Internal inverter issue", "Battery voltage too low" }, @@ -102,43 +102,43 @@ public static class AlarmKnowledgeBase }, // Temperature alarms - ["Excessivelyhigh ambient temperature"] = new() + ["ExcessivelyHighAmbientTemperature"] = new() { Explanation = "The ambient temperature around the inverter is too high. This is a WARNING - the inverter may reduce output to protect itself.", Causes = new[] { "Poor ventilation", "High environmental temperature", "Direct sunlight exposure", "Enclosure overheating" }, NextSteps = new[] { "Improve ventilation around the inverter", "Provide shade if outdoors", "Consider adding cooling", "Restart after temperature drops" } }, - ["Excessive radiator temperature"] = new() + ["ExcessiveRadiatorTemperature"] = new() { Explanation = "The inverter's heat sink/radiator temperature is too high. This is a WARNING level condition.", Causes = new[] { "Blocked air vents", "Fan failure", "High ambient temperature", "Excessive load" }, NextSteps = new[] { "Clean air vents and filters", "Check fan operation", "Reduce load temporarily", "Fix the cause, then restart" } }, - ["PCBover temperature"] = new() + ["PcbOvertemperature"] = new() { Explanation = "The printed circuit board temperature is too high. This is a WARNING level condition.", Causes = new[] { "Poor cooling", "High ambient temperature", "Excessive power output" }, NextSteps = new[] { "Improve ventilation", "Check fan operation", "Allow cooling before restart" } }, - ["DC converter over temperature"] = new() + ["DcConverterOvertemperature"] = new() { Explanation = "The DC converter section is overheating. This is a WARNING level condition.", Causes = new[] { "High charging/discharging current", "Poor cooling", "Ambient temperature too high" }, NextSteps = new[] { "Reduce power flow", "Improve ventilation", "Fix the cause, then restart" } }, - ["Inverter over temperaturealarm"] = new() + ["InverterOvertemperatureAlarm"] = new() { Explanation = "The inverter temperature is approaching dangerous levels. This is a WARNING.", Causes = new[] { "Overload", "Poor ventilation", "Fan failure", "High ambient temperature" }, NextSteps = new[] { "Reduce load", "Check cooling system", "Fix the cause, then restart" } }, - ["Inverter over temperature"] = new() + ["InverterOvertemperature"] = new() { Explanation = "The inverter has overheated. This is a WARNING level condition.", Causes = new[] { "Sustained overload", "Cooling system failure", "Environmental conditions" }, NextSteps = new[] { "Allow inverter to cool down", "Check fans and ventilation", "Fix the cause, then restart" } }, - ["DC converter over temperaturealarm"] = new() + ["DcConverterOvertemperatureAlarm"] = new() { Explanation = "The DC converter temperature alarm is active. This is a WARNING.", Causes = new[] { "High power throughput", "Inadequate cooling" }, @@ -146,25 +146,25 @@ public static class AlarmKnowledgeBase }, // Insulation and safety alarms - ["Insulation fault"] = new() + ["InsulationFault"] = new() { Explanation = "An insulation fault has been detected, indicating possible current leakage to ground. This is an ERROR level safety condition.", Causes = new[] { "Damaged cable insulation", "Moisture ingress", "Component insulation breakdown", "Ground fault in PV array" }, NextSteps = new[] { "Do not touch the system", "Power off safely", "Check all cable insulation", "Test insulation resistance", "Repair before restart" } }, - ["Leakage protection fault"] = new() + ["LeakageProtectionFault"] = new() { Explanation = "The ground fault/leakage current protection has tripped. This is an ERROR level safety condition.", Causes = new[] { "Ground fault in the system", "Damaged insulation", "Moisture in connections", "Faulty RCD/GFCI" }, NextSteps = new[] { "Power off the system", "Check for ground faults", "Inspect cable insulation", "Fix the cause before restart" } }, - ["Abnormal leakage self-check"] = new() + ["AbnormalLeakageSelfCheck"] = new() { Explanation = "The leakage current self-check has failed. This is an ERROR level condition.", Causes = new[] { "Self-check circuit fault", "Ground fault present", "Sensor malfunction" }, NextSteps = new[] { "Power off safely", "Check system grounding", "Fix the cause, then restart" } }, - ["Poorgrounding"] = new() + ["PoorGrounding"] = new() { Explanation = "Poor grounding connection detected. This is a WARNING level safety condition.", Causes = new[] { "Loose ground connection", "Corroded ground terminal", "High ground resistance", "Missing ground wire" }, @@ -172,7 +172,7 @@ public static class AlarmKnowledgeBase }, // Fan and cooling alarms - ["Fan fault"] = new() + ["FanFault"] = new() { Explanation = "The cooling fan has failed or is not operating correctly. This is an ERROR level condition that can lead to overheating.", Causes = new[] { "Fan motor failure", "Fan blade obstruction", "Loose fan connector", "Control circuit fault" }, @@ -180,7 +180,7 @@ public static class AlarmKnowledgeBase }, // Power supply alarms - ["Auxiliary power fault"] = new() + ["AuxiliaryPowerFault"] = new() { Explanation = "The auxiliary power supply inside the inverter has failed. This is an ERROR level condition.", Causes = new[] { "Internal power supply failure", "Input voltage issue", "Component failure" }, @@ -188,7 +188,7 @@ public static class AlarmKnowledgeBase }, // Model and configuration alarms - ["Model capacity fault"] = new() + ["ModelCapacityFault"] = new() { Explanation = "The inverter has detected a model/capacity configuration mismatch. This is an ERROR level condition.", Causes = new[] { "Incorrect model configuration", "Firmware mismatch", "Hardware mismatch" }, @@ -196,7 +196,7 @@ public static class AlarmKnowledgeBase }, // Lightning and surge protection - ["Abnormal lightning arrester"] = new() + ["AbnormalLightningArrester"] = new() { Explanation = "The surge protection device (lightning arrester) has failed or triggered. This is an ERROR level condition.", Causes = new[] { "Lightning strike damage", "Surge event", "SPD component failure" }, @@ -204,7 +204,7 @@ public static class AlarmKnowledgeBase }, // Island protection - ["Island protection"] = new() + ["IslandProtection"] = new() { Explanation = "Island protection is active - the inverter has disconnected from the grid to prevent back-feeding during a grid outage. This is an INFO level condition that typically auto-recovers.", Causes = new[] { "Grid power outage", "Grid voltage/frequency outside limits", "Intentional grid disconnection" }, @@ -212,73 +212,61 @@ public static class AlarmKnowledgeBase }, // Battery 1 alarms - ["Battery 1not connected"] = new() + ["Battery1NotConnected"] = new() { Explanation = "Battery 1 is not detected or not connected. This is an ERROR level condition.", Causes = new[] { "Battery disconnect switch open", "Loose battery cable", "Battery BMS shutdown", "Battery fuse blown" }, NextSteps = new[] { "Check battery disconnect switch", "Verify battery cable connections", "Check battery BMS status", "Fix connection, then restart" } }, - ["Battery 1over voltage"] = new() + ["Battery1Overvoltage"] = new() { Explanation = "Battery 1 voltage is too high. This is a WARNING level condition - charging will be limited.", Causes = new[] { "Overcharging", "BMS malfunction", "Incorrect battery voltage setting", "Cell imbalance" }, NextSteps = new[] { "Check battery SOC", "Verify charging settings", "Check BMS operation", "Fix the cause, then restart" } }, - ["Battery 1under voltage"] = new() + ["Battery1Undervoltage"] = new() { Explanation = "Battery 1 voltage is too low. This is a WARNING level condition - discharging will be limited.", Causes = new[] { "Battery deeply discharged", "Cell failure", "BMS cutoff", "High load drain" }, NextSteps = new[] { "Allow battery to charge", "Check for excessive loads", "Verify battery health", "Fix the cause, then restart" } }, - ["Battery 1discharge end"] = new() + ["Battery1DischargeEnd"] = new() { Explanation = "Battery 1 has reached its discharge end point (minimum SOC). This is an INFO level condition that auto-recovers when charged.", Causes = new[] { "Battery fully discharged to SOC limit", "High power consumption" }, NextSteps = new[] { "Wait for battery to recharge from PV or grid", "Monitor until it clears" } }, - ["Battery 1inverted"] = new() + ["Battery1Inverted"] = new() { Explanation = "Battery 1 polarity is reversed. This is a WARNING level condition - do not operate!", Causes = new[] { "Battery cables connected in reverse", "Installation error" }, NextSteps = new[] { "IMMEDIATELY power off the system", "Correct battery cable polarity", "Check for damage before restart" } }, - ["Battery 1over current"] = new() - { - Explanation = "Battery 1 current exceeds safe limits. This is a WARNING level condition.", - Causes = new[] { "Excessive load", "Short circuit", "Inverter control issue" }, - NextSteps = new[] { "Reduce load", "Check for short circuits", "Fix the cause, then restart" } - }, - ["Battery 1overload timeout"] = new() + ["Battery1OverloadTimeout"] = new() { Explanation = "Battery 1 has been overloaded for too long. This is an ERROR level condition.", Causes = new[] { "Sustained high load", "Undersized battery", "Battery degradation" }, NextSteps = new[] { "Reduce system load", "Check battery capacity", "Fix the cause, then restart" } }, - ["Battery 1soft start failure"] = new() + ["Battery1SoftStartFailure"] = new() { Explanation = "Battery 1 failed to soft-start properly. This is a WARNING level condition.", Causes = new[] { "Pre-charge circuit fault", "Battery voltage mismatch", "Contactor issue" }, NextSteps = new[] { "Check battery voltage", "Verify pre-charge circuit", "Fix the cause, then restart" } }, - ["Battery 1power tube fault"] = new() + ["Battery1PowerTubeFault"] = new() { Explanation = "Battery 1 power electronics (IGBT/MOSFET) have failed. This is a PROTECTION level condition requiring service.", Causes = new[] { "Power semiconductor failure", "Overcurrent damage", "Manufacturing defect" }, NextSteps = new[] { "Do not restart the system", "Contact service technician", "Hardware repair required" } }, - ["Battery 1charging sealingwave"] = new() - { - Explanation = "Battery 1 charging seal pulse detected. This is a WARNING indicating charging is being limited.", - Causes = new[] { "Battery requesting charge termination", "BMS protection active" }, - NextSteps = new[] { "Check battery BMS status", "Fix the cause, then restart" } - }, - ["Battery 1insufficient power"] = new() + ["Battery1InsufficientPower"] = new() { Explanation = "Battery 1 cannot provide sufficient power for the load. This is an INFO level condition.", Causes = new[] { "Low state of charge", "High load demand", "Battery capacity limitation" }, NextSteps = new[] { "Wait for battery to recharge", "Reduce load if possible", "Monitor until it clears" } }, - ["Battery 1backup prohibited"] = new() + ["Battery1BackupProhibited"] = new() { Explanation = "Battery 1 is prohibited from providing backup power. This is a WARNING level condition.", Causes = new[] { "BMS protection active", "Battery in maintenance mode", "SOC too low for backup" }, @@ -286,73 +274,61 @@ public static class AlarmKnowledgeBase }, // Battery 2 alarms (similar to Battery 1) - ["Battery 2not connected"] = new() + ["Battery2NotConnected"] = new() { Explanation = "Battery 2 is not detected or not connected. This is an ERROR level condition.", Causes = new[] { "Battery disconnect switch open", "Loose battery cable", "Battery BMS shutdown", "Battery fuse blown" }, NextSteps = new[] { "Check battery disconnect switch", "Verify battery cable connections", "Check battery BMS status", "Fix connection, then restart" } }, - ["Battery 2over voltage"] = new() + ["Battery2Overvoltage"] = new() { Explanation = "Battery 2 voltage is too high. This is a WARNING level condition.", Causes = new[] { "Overcharging", "BMS malfunction", "Incorrect voltage setting" }, NextSteps = new[] { "Check battery SOC", "Verify charging settings", "Fix the cause, then restart" } }, - ["Battery 2under voltage"] = new() + ["Battery2Undervoltage"] = new() { Explanation = "Battery 2 voltage is too low. This is a WARNING level condition.", Causes = new[] { "Battery deeply discharged", "Cell failure", "BMS cutoff" }, NextSteps = new[] { "Allow battery to charge", "Check battery health", "Fix the cause, then restart" } }, - ["Battery 2discharge end"] = new() + ["Battery2DischargeEnd"] = new() { Explanation = "Battery 2 has reached its discharge end point. This is an INFO level condition.", Causes = new[] { "Battery fully discharged to SOC limit" }, NextSteps = new[] { "Wait for battery to recharge", "Monitor until it clears" } }, - ["Battery 2inverted"] = new() + ["Battery2Inverted"] = new() { Explanation = "Battery 2 polarity is reversed. This is a WARNING - do not operate!", Causes = new[] { "Battery cables connected in reverse" }, NextSteps = new[] { "IMMEDIATELY power off", "Correct battery polarity", "Check for damage" } }, - ["Battery 2over current"] = new() - { - Explanation = "Battery 2 current exceeds safe limits. This is a WARNING level condition.", - Causes = new[] { "Excessive load", "Short circuit" }, - NextSteps = new[] { "Reduce load", "Check for short circuits", "Fix the cause, then restart" } - }, - ["Battery 2overload timeout"] = new() + ["Battery2OverloadTimeout"] = new() { Explanation = "Battery 2 has been overloaded for too long. This is an ERROR level condition.", Causes = new[] { "Sustained high load", "Battery degradation" }, NextSteps = new[] { "Reduce system load", "Fix the cause, then restart" } }, - ["Battery 2soft start failure"] = new() + ["Battery2SoftStartFailure"] = new() { Explanation = "Battery 2 failed to soft-start properly. This is a WARNING level condition.", Causes = new[] { "Pre-charge circuit fault", "Voltage mismatch" }, NextSteps = new[] { "Check battery voltage", "Fix the cause, then restart" } }, - ["Battery 2power tube fault"] = new() + ["Battery2PowerTubeFault"] = new() { Explanation = "Battery 2 power electronics have failed. This is a PROTECTION level condition.", Causes = new[] { "Power semiconductor failure" }, NextSteps = new[] { "Do not restart", "Contact service technician" } }, - ["Battery 2insufficiency power"] = new() + ["Battery2InsufficientPower"] = new() { Explanation = "Battery 2 cannot provide sufficient power. This is a WARNING level condition.", Causes = new[] { "Low SOC", "High load demand" }, NextSteps = new[] { "Wait for recharge", "Reduce load", "Fix the cause, then restart" } }, - ["Battery 2charging sealingwave"] = new() - { - Explanation = "Battery 2 charging seal pulse detected. This is a WARNING.", - Causes = new[] { "Battery requesting charge termination" }, - NextSteps = new[] { "Check BMS status", "Fix the cause, then restart" } - }, - ["Battery 2backup prohibited"] = new() + ["Battery2BackupProhibited"] = new() { Explanation = "Battery 2 is prohibited from providing backup power. This is a WARNING.", Causes = new[] { "BMS protection active", "SOC too low" }, @@ -360,61 +336,61 @@ public static class AlarmKnowledgeBase }, // Lithium battery specific alarms - ["Lithium battery 1 chargeforbidden"] = new() + ["LithiumBattery1ChargeForbidden"] = new() { Explanation = "Lithium battery 1 BMS has forbidden charging. This is a WARNING level condition.", Causes = new[] { "Battery fully charged", "Temperature out of range", "BMS protection active", "Cell imbalance" }, NextSteps = new[] { "Check battery temperature", "Verify BMS status", "Fix the cause, then restart" } }, - ["Lithium battery 1 dischargeforbidden"] = new() + ["LithiumBattery1DischargeForbidden"] = new() { Explanation = "Lithium battery 1 BMS has forbidden discharging. This is a WARNING level condition.", Causes = new[] { "Battery empty", "Temperature out of range", "BMS protection", "Low voltage protection" }, NextSteps = new[] { "Allow battery to charge", "Check temperature", "Fix the cause, then restart" } }, - ["Lithium battery 2 chargeforbidden"] = new() + ["LithiumBattery2ChargeForbidden"] = new() { Explanation = "Lithium battery 2 BMS has forbidden charging. This is a WARNING level condition.", Causes = new[] { "Battery fully charged", "Temperature out of range", "BMS protection" }, NextSteps = new[] { "Check battery status", "Fix the cause, then restart" } }, - ["Lithium battery 2 dischargeforbidden"] = new() + ["LithiumBattery2DischargeForbidden"] = new() { Explanation = "Lithium battery 2 BMS has forbidden discharging. This is a WARNING level condition.", Causes = new[] { "Battery empty", "Temperature out of range", "BMS protection" }, NextSteps = new[] { "Allow battery to charge", "Fix the cause, then restart" } }, - ["Lithium battery 1full"] = new() + ["LithiumBattery1Full"] = new() { Explanation = "Lithium battery 1 is fully charged. This is a WARNING indicating charging will stop.", Causes = new[] { "Battery at 100% SOC", "Cell voltage at maximum" }, NextSteps = new[] { "Normal condition if intentional", "Monitor battery health" } }, - ["Lithium battery 1 dischargeend"] = new() + ["LithiumBattery1DischargeEnd"] = new() { Explanation = "Lithium battery 1 has reached discharge end. This is a WARNING.", Causes = new[] { "Battery at minimum SOC" }, NextSteps = new[] { "Allow battery to recharge", "Fix the cause, then restart" } }, - ["Lithium battery 2full"] = new() + ["LithiumBattery2Full"] = new() { Explanation = "Lithium battery 2 is fully charged. This is a WARNING.", Causes = new[] { "Battery at 100% SOC" }, NextSteps = new[] { "Normal condition if intentional" } }, - ["Lithium battery 2 dischargeend"] = new() + ["LithiumBattery2DischargeEnd"] = new() { Explanation = "Lithium battery 2 has reached discharge end. This is a WARNING.", Causes = new[] { "Battery at minimum SOC" }, NextSteps = new[] { "Allow battery to recharge" } }, - ["Lead battery temperature abnormality"] = new() + ["LeadBatteryTemperatureAbnormality"] = new() { Explanation = "Lead-acid battery temperature is abnormal. This is an ERROR level condition.", Causes = new[] { "Overheating", "Temperature sensor fault", "Environmental temperature extreme" }, NextSteps = new[] { "Check battery temperature", "Verify sensor", "Fix the cause, then restart" } }, - ["Batteryaccessmethod error"] = new() + ["BatteryAccessMethodError"] = new() { Explanation = "Battery access method configuration error. This is a WARNING.", Causes = new[] { "Incorrect configuration", "Communication setup error" }, @@ -422,49 +398,49 @@ public static class AlarmKnowledgeBase }, // PV 1 alarms - ["PV 1notaccessed"] = new() + ["Pv1NotAccessed"] = new() { Explanation = "PV string 1 is not detected or accessible. This is a WARNING level condition.", Causes = new[] { "PV disconnector open", "Cable damage", "PV module fault", "No sunlight" }, NextSteps = new[] { "Check PV disconnector", "Verify PV cable connections", "Check for shading", "Fix the cause, then restart" } }, - ["PV 1over voltage"] = new() + ["Pv1Overvoltage"] = new() { Explanation = "PV string 1 voltage exceeds maximum input voltage. This is a WARNING - PV input will be limited.", Causes = new[] { "Too many PV modules in series", "Low temperature increasing voltage", "Design error" }, NextSteps = new[] { "Check PV string configuration", "Verify Voc at low temperature", "Reduce modules if needed" } }, - ["AbnormalPV 1current sharing"] = new() + ["AbnormalPv1CurrentSharing"] = new() { Explanation = "PV string 1 current sharing is abnormal. This is an ERROR level condition.", Causes = new[] { "Mismatched PV modules", "Partial shading", "Module fault" }, NextSteps = new[] { "Check for shading", "Verify module matching", "Fix the cause, then restart" } }, - ["PV 1power tube fault"] = new() + ["Pv1PowerTubeFault"] = new() { Explanation = "PV 1 DC converter power electronics have failed. This is a PROTECTION level condition.", Causes = new[] { "IGBT/MOSFET failure", "Overcurrent damage" }, NextSteps = new[] { "Do not restart", "Contact service technician" } }, - ["PV 1soft startfailure"] = new() + ["Pv1SoftStartFailure"] = new() { Explanation = "PV 1 failed to soft-start properly. This is a WARNING level condition.", Causes = new[] { "Pre-charge circuit fault", "Voltage mismatch" }, NextSteps = new[] { "Check PV voltage", "Fix the cause, then restart" } }, - ["PV 1overload timeout"] = new() + ["Pv1OverloadTimeout"] = new() { Explanation = "PV 1 has been overloaded for too long. This is an ERROR level condition.", Causes = new[] { "Excessive PV power", "DC converter limitation" }, NextSteps = new[] { "Check PV sizing", "Fix the cause, then restart" } }, - ["PV 1insufficient power"] = new() + ["Pv1InsufficientPower"] = new() { Explanation = "PV string 1 is not providing enough power. This is an INFO level condition.", Causes = new[] { "Low irradiance", "Shading", "Cloud cover", "Evening/morning" }, NextSteps = new[] { "Wait for better sunlight conditions", "Check for shading", "Monitor until it clears" } }, - ["Photovoltaic 1 over current"] = new() + ["Photovoltaic1Overcurrent"] = new() { Explanation = "PV string 1 current exceeds limits. This is a WARNING level condition.", Causes = new[] { "PV array oversized", "Ground fault", "Short circuit" }, @@ -472,155 +448,137 @@ public static class AlarmKnowledgeBase }, // PV 2 alarms - ["PV 2notaccessed"] = new() + ["Pv2NotAccessed"] = new() { Explanation = "PV string 2 is not detected or accessible. This is a WARNING level condition.", Causes = new[] { "PV disconnector open", "Cable damage", "No sunlight" }, NextSteps = new[] { "Check PV disconnector", "Verify connections", "Fix the cause, then restart" } }, - ["PV 2over voltage"] = new() + ["Pv2Overvoltage"] = new() { Explanation = "PV string 2 voltage exceeds maximum. This is a WARNING level condition.", Causes = new[] { "Too many PV modules in series", "Low temperature" }, NextSteps = new[] { "Check PV configuration", "Reduce modules if needed" } }, - ["AbnormalPV 2current sharing"] = new() + ["AbnormalPv2CurrentSharing"] = new() { Explanation = "PV string 2 current sharing is abnormal. This is an ERROR level condition.", Causes = new[] { "Mismatched modules", "Partial shading" }, NextSteps = new[] { "Check for shading", "Fix the cause, then restart" } }, - ["PV 2power tube fault"] = new() + ["Pv2PowerTubeFault"] = new() { Explanation = "PV 2 power electronics have failed. This is a PROTECTION level condition.", Causes = new[] { "Power semiconductor failure" }, NextSteps = new[] { "Do not restart", "Contact service technician" } }, - ["PV 2soft startfailure"] = new() + ["Pv2SoftStartFailure"] = new() { Explanation = "PV 2 failed to soft-start. This is a WARNING level condition.", Causes = new[] { "Pre-charge fault", "Voltage mismatch" }, NextSteps = new[] { "Check PV voltage", "Fix the cause, then restart" } }, - ["PV 2overload timeout"] = new() + ["Pv2OverloadTimeout"] = new() { Explanation = "PV 2 has been overloaded for too long. This is an ERROR level condition.", Causes = new[] { "Excessive PV power" }, NextSteps = new[] { "Check PV sizing", "Fix the cause, then restart" } }, - ["PV 2insufficient power"] = new() + ["Pv2InsufficientPower"] = new() { Explanation = "PV string 2 is not providing enough power. This is an INFO level condition.", Causes = new[] { "Low irradiance", "Shading" }, NextSteps = new[] { "Wait for better conditions", "Monitor until it clears" } }, - ["Photovoltaic 2 over current"] = new() - { - Explanation = "PV string 2 current exceeds limits. This is a WARNING level condition.", - Causes = new[] { "PV oversized", "Ground fault" }, - NextSteps = new[] { "Check PV configuration", "Fix the cause, then restart" } - }, // PV 3 alarms - ["PV 3not connected"] = new() + ["Pv3NotConnected"] = new() { Explanation = "PV string 3 is not connected. This is an ERROR level condition.", Causes = new[] { "PV disconnector open", "Cable issue" }, NextSteps = new[] { "Check connections", "Fix the cause, then restart" } }, - ["PV 3over voltage"] = new() + ["Pv3Overvoltage"] = new() { Explanation = "PV string 3 voltage exceeds maximum. This is a WARNING.", Causes = new[] { "Too many modules in series" }, NextSteps = new[] { "Check PV configuration" } }, - ["PV 3average current anomaly"] = new() + ["Pv3AverageCurrentAnomaly"] = new() { Explanation = "PV string 3 current is abnormal. This is a WARNING.", Causes = new[] { "Module mismatch", "Shading" }, NextSteps = new[] { "Check modules", "Fix the cause, then restart" } }, - ["PV 3power tube failure"] = new() + ["Pv3PowerTubeFailure"] = new() { Explanation = "PV 3 power electronics failed. This is a PROTECTION level condition.", Causes = new[] { "Hardware failure" }, NextSteps = new[] { "Do not restart", "Contact service" } }, - ["PV 3soft startfailure"] = new() + ["Pv3SoftStartFailure"] = new() { Explanation = "PV 3 soft start failed. This is a WARNING.", Causes = new[] { "Pre-charge fault" }, NextSteps = new[] { "Fix the cause, then restart" } }, - ["PV 3overload timeout"] = new() + ["Pv3OverloadTimeout"] = new() { Explanation = "PV 3 overloaded too long. This is an ERROR.", Causes = new[] { "Excessive power" }, NextSteps = new[] { "Fix the cause, then restart" } }, - ["PV 3reverse connection"] = new() + ["Pv3ReverseConnection"] = new() { Explanation = "PV string 3 is connected with reversed polarity. This is a PROTECTION level condition.", Causes = new[] { "Installation error", "Wrong cable connection" }, NextSteps = new[] { "Do not restart", "Contact service to correct wiring" } }, - ["Photovoltaic 3 over current"] = new() - { - Explanation = "PV string 3 current exceeds limits. This is a WARNING.", - Causes = new[] { "PV oversized", "Fault condition" }, - NextSteps = new[] { "Check configuration", "Fix the cause, then restart" } - }, // PV 4 alarms - ["PV 4not connected"] = new() + ["Pv4NotConnected"] = new() { Explanation = "PV string 4 is not connected. This is an ERROR.", Causes = new[] { "Disconnector open", "Cable issue" }, NextSteps = new[] { "Check connections", "Fix the cause, then restart" } }, - ["PV 4over voltage"] = new() + ["Pv4Overvoltage"] = new() { Explanation = "PV string 4 voltage exceeds maximum. This is a WARNING.", Causes = new[] { "Too many modules" }, NextSteps = new[] { "Check configuration" } }, - ["PV 4average current anomaly"] = new() + ["Pv4AverageCurrentAnomaly"] = new() { Explanation = "PV string 4 current abnormal. This is a WARNING.", Causes = new[] { "Module mismatch" }, NextSteps = new[] { "Check modules" } }, - ["PV 4power tube Failure"] = new() + ["Pv4PowerTubeFailure"] = new() { Explanation = "PV 4 power electronics failed. This is a PROTECTION level condition.", Causes = new[] { "Hardware failure" }, NextSteps = new[] { "Do not restart", "Contact service" } }, - ["PV 4soft startfailure"] = new() + ["Pv4SoftStartFailure"] = new() { Explanation = "PV 4 soft start failed. This is a WARNING.", Causes = new[] { "Pre-charge fault" }, NextSteps = new[] { "Fix the cause, then restart" } }, - ["PV 4overload timeout"] = new() + ["Pv4OverloadTimeout"] = new() { Explanation = "PV 4 overloaded too long. This is an ERROR.", Causes = new[] { "Excessive power" }, NextSteps = new[] { "Fix the cause, then restart" } }, - ["PV 4reverse connection"] = new() + ["Pv4ReverseConnection"] = new() { Explanation = "PV string 4 polarity reversed. This is a PROTECTION condition.", Causes = new[] { "Wrong wiring" }, NextSteps = new[] { "Do not restart", "Contact service" } }, - ["Photovoltaic 4 over current"] = new() - { - Explanation = "PV string 4 current exceeds limits. This is a WARNING.", - Causes = new[] { "PV oversized" }, - NextSteps = new[] { "Check configuration" } - }, - ["Insufficient photovoltaic power"] = new() + ["InsufficientPhotovoltaicPower"] = new() { Explanation = "Not enough PV power available. This is a WARNING.", Causes = new[] { "Low irradiance", "Evening/cloudy" }, @@ -628,37 +586,37 @@ public static class AlarmKnowledgeBase }, // DC Bus alarms - ["DC busover voltage"] = new() + ["DcBusOvervoltage"] = new() { Explanation = "The DC bus voltage is too high. This is a WARNING level condition.", Causes = new[] { "Excessive charging power", "Regenerative load", "Control fault" }, NextSteps = new[] { "Check power balance", "Fix the cause, then restart" } }, - ["DC busunder voltage"] = new() + ["DcBusUndervoltage"] = new() { Explanation = "The DC bus voltage is too low. This is a WARNING level condition.", Causes = new[] { "Excessive load", "Power supply issue", "Battery depletion" }, NextSteps = new[] { "Reduce load", "Check power sources", "Fix the cause, then restart" } }, - ["DC bus voltage unbalance"] = new() + ["DcBusVoltageUnbalance"] = new() { Explanation = "The DC bus voltage is unbalanced. This is an ERROR level condition.", Causes = new[] { "Capacitor failure", "Control issue", "Asymmetric loading" }, NextSteps = new[] { "Check capacitor bank", "Fix the cause, then restart" } }, - ["Busslow over voltage"] = new() + ["BusSlowOvervoltage"] = new() { Explanation = "DC bus slow over-voltage detected. This is a WARNING.", Causes = new[] { "Gradual voltage rise", "Charging imbalance" }, NextSteps = new[] { "Check charging control", "Fix the cause, then restart" } }, - ["Hardware bus over voltage"] = new() + ["HardwareBusOvervoltage"] = new() { Explanation = "Hardware-level bus over-voltage protection tripped. This is a PROTECTION level condition.", Causes = new[] { "Severe overvoltage event", "Component failure" }, NextSteps = new[] { "Do not restart", "Contact service technician" } }, - ["Bus soft startfailure"] = new() + ["BusSoftStartFailure"] = new() { Explanation = "DC bus failed to soft-start. This is a WARNING.", Causes = new[] { "Pre-charge fault", "Capacitor issue" }, @@ -666,43 +624,43 @@ public static class AlarmKnowledgeBase }, // Inverter power tube and hardware faults - ["Inverter power tube fault"] = new() + ["InverterPowerTubeFault"] = new() { Explanation = "The main inverter power electronics (IGBT/MOSFET) have failed. This is a PROTECTION level condition requiring professional service.", Causes = new[] { "Power semiconductor failure", "Overcurrent damage", "Short circuit damage", "Thermal damage" }, NextSteps = new[] { "Do not attempt to restart", "Contact service technician", "Hardware repair/replacement required" } }, - ["Hardware over current"] = new() + ["HardwareOvercurrent"] = new() { Explanation = "Hardware overcurrent protection has tripped. This is a PROTECTION level condition.", Causes = new[] { "Short circuit", "Severe overload", "Component failure" }, NextSteps = new[] { "Do not restart", "Contact service technician" } }, - ["DC converter over voltage"] = new() + ["DcConverterOvervoltage"] = new() { Explanation = "DC converter voltage too high. This is a WARNING.", Causes = new[] { "Input overvoltage", "Control issue" }, NextSteps = new[] { "Check input voltage", "Fix the cause, then restart" } }, - ["DC converter hardware over voltage"] = new() + ["DcConverterHardwareOvervoltage"] = new() { Explanation = "DC converter hardware overvoltage protection. This is a PROTECTION condition.", Causes = new[] { "Severe overvoltage" }, NextSteps = new[] { "Do not restart", "Contact service" } }, - ["DC converter over current"] = new() + ["DcConverterOvercurrent"] = new() { Explanation = "DC converter current too high. This is a WARNING.", Causes = new[] { "Overload", "Short circuit" }, NextSteps = new[] { "Reduce load", "Fix the cause, then restart" } }, - ["DC converter hardware over current"] = new() + ["DcConverterHardwareOvercurrent"] = new() { Explanation = "DC converter hardware overcurrent protection. This is a PROTECTION condition.", Causes = new[] { "Severe overcurrent" }, NextSteps = new[] { "Do not restart", "Contact service" } }, - ["DC converter resonator over current"] = new() + ["DcConverterResonatorOvercurrent"] = new() { Explanation = "DC converter resonator overcurrent. This is a WARNING.", Causes = new[] { "Resonance condition", "Control issue" }, @@ -710,31 +668,31 @@ public static class AlarmKnowledgeBase }, // Overload alarms - ["System output overload"] = new() + ["SystemOutputOverload"] = new() { Explanation = "The total system output is overloaded. This is an ERROR level condition.", Causes = new[] { "Too many loads connected", "Load exceeds inverter capacity", "Short circuit in load" }, NextSteps = new[] { "Disconnect some loads", "Check for short circuits", "Fix the cause, then restart" } }, - ["Inverter overload"] = new() + ["InverterOverload"] = new() { Explanation = "The inverter is overloaded. This is an ERROR level condition.", Causes = new[] { "Load exceeds rated power", "Inrush current from motors", "Short circuit" }, NextSteps = new[] { "Reduce connected load", "Check load power rating", "Fix the cause, then restart" } }, - ["Inverter overload timeout"] = new() + ["InverterOverloadTimeout"] = new() { Explanation = "The inverter has been overloaded for too long. This is an ERROR level condition.", Causes = new[] { "Sustained overload condition", "Undersized inverter for load" }, NextSteps = new[] { "Permanently reduce load", "Consider larger inverter", "Fix the cause, then restart" } }, - ["Load power overload"] = new() + ["LoadPowerOverload"] = new() { Explanation = "Load power exceeds system capacity. This is an ERROR.", Causes = new[] { "Excessive load" }, NextSteps = new[] { "Reduce load", "Fix the cause, then restart" } }, - ["Balancedcircuit overload timeout"] = new() + ["BalancedCircuitOverloadTimeout"] = new() { Explanation = "Balanced circuit overloaded too long. This is an ERROR.", Causes = new[] { "Unbalanced loading", "Phase overload" }, @@ -742,7 +700,7 @@ public static class AlarmKnowledgeBase }, // Soft start failures - ["Inverter soft start failure"] = new() + ["InverterSoftStartFailure"] = new() { Explanation = "The inverter failed during soft-start sequence. This is a WARNING level condition.", Causes = new[] { "Pre-charge resistor fault", "Contactor failure", "DC bus capacitor issue", "Control board fault" }, @@ -750,37 +708,37 @@ public static class AlarmKnowledgeBase }, // DSP and firmware alarms - ["DSP 1para meter setting fault"] = new() + ["Dsp1ParameterSettingFault"] = new() { Explanation = "DSP 1 parameter configuration error. This is an ERROR level condition.", Causes = new[] { "Incorrect parameter setting", "Firmware corruption", "Configuration mismatch" }, NextSteps = new[] { "Check parameter settings", "Reset to defaults if needed", "Fix the cause, then restart" } }, - ["DSP 2para meter setting fault"] = new() + ["Dsp2ParameterSettingFault"] = new() { Explanation = "DSP 2 parameter configuration error. This is an ERROR level condition.", Causes = new[] { "Incorrect parameter setting", "Firmware corruption" }, NextSteps = new[] { "Check parameter settings", "Fix the cause, then restart" } }, - ["DSPversion compatibility fault"] = new() + ["DspVersionCompatibilityFault"] = new() { Explanation = "DSP firmware version is incompatible. This is an ERROR level condition.", Causes = new[] { "Firmware mismatch between components", "Incomplete firmware update" }, NextSteps = new[] { "Update firmware to compatible version", "Contact support if needed" } }, - ["CPLDversion compatibility fault"] = new() + ["CpldVersionCompatibilityFault"] = new() { Explanation = "CPLD version is incompatible. This is an ERROR level condition.", Causes = new[] { "Firmware mismatch", "Incomplete update" }, NextSteps = new[] { "Update firmware", "Fix the cause, then restart" } }, - ["CPLD communication fault"] = new() + ["CpldCommunicationFault"] = new() { Explanation = "Communication with CPLD failed. This is an ERROR level condition.", Causes = new[] { "Internal communication bus fault", "CPLD failure" }, NextSteps = new[] { "Power cycle the system", "If persistent, contact service" } }, - ["DSP communication fault"] = new() + ["DspCommunicationFault"] = new() { Explanation = "Communication with DSP failed. This is an ERROR level condition.", Causes = new[] { "Internal communication bus fault", "DSP failure" }, @@ -788,13 +746,13 @@ public static class AlarmKnowledgeBase }, // Output DC component alarms - ["Output voltageDC overlimit"] = new() + ["OutputVoltageDcOverlimit"] = new() { Explanation = "DC component in output voltage exceeds limit. This is a WARNING.", Causes = new[] { "Control drift", "Sensor offset", "Hardware issue" }, NextSteps = new[] { "Restart the inverter", "If persistent, contact service" } }, - ["Output currentDC overlimit"] = new() + ["OutputCurrentDcOverlimit"] = new() { Explanation = "DC component in output current exceeds limit. This is a WARNING.", Causes = new[] { "Control issue", "Sensor fault" }, @@ -802,43 +760,43 @@ public static class AlarmKnowledgeBase }, // Relay alarms - ["Relayself-checkfails"] = new() + ["RelaySelfCheckFails"] = new() { Explanation = "Relay self-check has failed. This is an ERROR level condition.", Causes = new[] { "Relay contact fault", "Relay driver fault", "Welded contacts" }, NextSteps = new[] { "Check relay operation", "Fix the cause, then restart" } }, - ["Inverter relayopen"] = new() + ["InverterRelayOpen"] = new() { Explanation = "Inverter relay is unexpectedly open. This is an ERROR.", Causes = new[] { "Relay driver fault", "Protection trip" }, NextSteps = new[] { "Check protection status", "Fix the cause, then restart" } }, - ["Inverter relayshort circuit"] = new() + ["InverterRelayShortCircuit"] = new() { Explanation = "Inverter relay has a short circuit (welded contacts). This is a PROTECTION condition.", Causes = new[] { "Welded relay contacts", "Relay failure" }, NextSteps = new[] { "Do not restart", "Contact service to replace relay" } }, - ["Opencircuitof power grid relay"] = new() + ["OpenCircuitOfPowerGridRelay"] = new() { Explanation = "Grid relay is unexpectedly open. This is an ERROR.", Causes = new[] { "Relay fault", "Protection active" }, NextSteps = new[] { "Check relay", "Fix the cause, then restart" } }, - ["Shortcircuitof power grid relay"] = new() + ["ShortCircuitOfPowerGridRelay"] = new() { Explanation = "Grid relay has welded contacts. This is an ERROR.", Causes = new[] { "Relay failure" }, NextSteps = new[] { "Contact service", "Fix the cause, then restart" } }, - ["generator Relayopencircuit"] = new() + ["GeneratorRelayOpenCircuit"] = new() { Explanation = "Generator relay is open. This is an ERROR.", Causes = new[] { "Relay fault" }, NextSteps = new[] { "Check relay", "Fix the cause, then restart" } }, - ["generator Relayshortcircuit"] = new() + ["GeneratorRelayShortCircuit"] = new() { Explanation = "Generator relay has welded. This is an ERROR.", Causes = new[] { "Relay failure" }, @@ -846,7 +804,7 @@ public static class AlarmKnowledgeBase }, // Abnormal inverter - ["Abnormal inverter"] = new() + ["AbnormalInverter"] = new() { Explanation = "General inverter abnormality detected. This is an ERROR level condition.", Causes = new[] { "Various internal faults", "Control system issue" }, @@ -854,25 +812,25 @@ public static class AlarmKnowledgeBase }, // Parallel operation alarms - ["Parallel communicationalarm"] = new() + ["ParallelCommunicationAlarm"] = new() { Explanation = "Communication between parallel inverters has failed. This is an ERROR level condition.", Causes = new[] { "Communication cable fault", "Parallel interface failure", "Settings mismatch" }, NextSteps = new[] { "Check parallel communication cables", "Verify settings match", "Fix the cause, then restart" } }, - ["Parallelmodule missing"] = new() + ["ParallelModuleMissing"] = new() { Explanation = "A parallel module is missing from the system. This is a WARNING.", Causes = new[] { "Module offline", "Communication loss", "Power failure on module" }, NextSteps = new[] { "Check all parallel modules", "Fix the cause, then restart" } }, - ["Duplicatemachine numbersforparallel modules"] = new() + ["DuplicateMachineNumbersForParallelModules"] = new() { Explanation = "Two parallel modules have the same ID number. This is a WARNING.", Causes = new[] { "Configuration error", "Duplicate addressing" }, NextSteps = new[] { "Assign unique IDs to each module", "Fix the cause, then restart" } }, - ["Para meterconflictin parallelmodule"] = new() + ["ParameterConflictInParallelModule"] = new() { Explanation = "Parameter conflict between parallel modules. This is a WARNING.", Causes = new[] { "Mismatched settings between units" }, @@ -880,7 +838,7 @@ public static class AlarmKnowledgeBase }, // System derating - ["Systemderating"] = new() + ["SystemDerating"] = new() { Explanation = "The system is operating at reduced power (derating). This is a WARNING.", Causes = new[] { "High temperature", "Voltage out of range", "Component limitation" }, @@ -888,7 +846,7 @@ public static class AlarmKnowledgeBase }, // PV access method - ["PVaccessmethod erroralarm"] = new() + ["PvAccessMethodErrorAlarm"] = new() { Explanation = "PV access configuration error. This is a WARNING.", Causes = new[] { "Incorrect PV configuration", "Wiring mismatch" }, @@ -896,13 +854,13 @@ public static class AlarmKnowledgeBase }, // Reserved alarms - ["Reservedalarms 4"] = new() + ["ReservedAlarms4"] = new() { Explanation = "Reserved alarm 4 is active. This is a WARNING level condition.", Causes = new[] { "Undocumented condition" }, NextSteps = new[] { "Monitor the system", "Contact support if issue persists" } }, - ["Reservedalarms 5"] = new() + ["ReservedAlarms5"] = new() { Explanation = "Reserved alarm 5 is active. This is a WARNING level condition.", Causes = new[] { "Undocumented condition" }, @@ -910,7 +868,7 @@ public static class AlarmKnowledgeBase }, // Meter alarms - ["Reverse meter connection"] = new() + ["ReverseMeterConnection"] = new() { Explanation = "The energy meter is connected in reverse. This is a PROTECTION level condition.", Causes = new[] { "Meter CT installed backwards", "Meter wiring reversed" }, @@ -926,31 +884,31 @@ public static class AlarmKnowledgeBase }, // Diesel generator alarms - ["Abnormal diesel generator voltage"] = new() + ["AbnormalDieselGeneratorVoltage"] = new() { Explanation = "Diesel generator voltage is abnormal. This is an ERROR.", Causes = new[] { "Generator voltage out of range", "AVR fault" }, NextSteps = new[] { "Check generator voltage setting", "Fix the cause, then restart" } }, - ["Abnormal diesel generator frequency"] = new() + ["AbnormalDieselGeneratorFrequency"] = new() { Explanation = "Diesel generator frequency is abnormal. This is an ERROR.", Causes = new[] { "Generator speed issue", "Governor fault" }, NextSteps = new[] { "Check generator frequency", "Fix the cause, then restart" } }, - ["Diesel generator voltage reverse sequence"] = new() + ["DieselGeneratorVoltageReverseSequence"] = new() { Explanation = "Generator phase sequence is reversed. This is a PROTECTION condition.", Causes = new[] { "Wrong phase wiring" }, NextSteps = new[] { "Do not restart", "Contact service to correct wiring" } }, - ["Diesel generator voltageoutof phase"] = new() + ["DieselGeneratorVoltageOutOfPhase"] = new() { Explanation = "Generator voltage is out of phase with grid. This is an ERROR.", Causes = new[] { "Sync issue", "Phase angle mismatch" }, NextSteps = new[] { "Check synchronization", "Fix the cause, then restart" } }, - ["Generator overload"] = new() + ["GeneratorOverload"] = new() { Explanation = "The generator is overloaded. This is an ERROR.", Causes = new[] { "Load exceeds generator capacity" }, @@ -959,54 +917,78 @@ public static class AlarmKnowledgeBase }; // ── Growatt Alarms ─────────────────────────────────────────────────────── - // Format: "Warning XXX" or "Error XXX" or descriptive text + // Keys match GrowattWarningCode and GrowattErrorCode enum member names private static readonly IReadOnlyDictionary GrowattAlarms = new Dictionary { // Warnings (200-series: PV/String) - ["Warning 200"] = new() + ["StringFault"] = new() { Explanation = "String fault detected. One or more PV strings may have issues affecting power generation.", Causes = new[] { "PV panel fault", "String wiring issue", "Connector problem", "Module degradation" }, NextSteps = new[] { "Check if PV panels are normal after shutdown", "Inspect string connections", "Look for damaged cables" } }, - ["Warning 201"] = new() + ["PvStringPidQuickConnectAbnormal"] = new() { Explanation = "PV string/PID quick-connect terminals are abnormal.", Causes = new[] { "Loose terminal connections", "Damaged quick-connect", "Corrosion on terminals" }, NextSteps = new[] { "Check wiring of string terminals after shutdown", "Clean and secure connections" } }, - ["Warning 203"] = new() + ["DcSpdFunctionAbnormal"] = new() + { + Explanation = "DC SPD function abnormal.", + Causes = new[] { "SPD failure" }, + NextSteps = new[] { "Check DC SPD after shutdown" } + }, + ["PvShortCircuited"] = new() { Explanation = "PV1 or PV2 string is short-circuited.", Causes = new[] { "Cable damage causing short", "Connector failure", "Module junction box fault" }, NextSteps = new[] { "Check if PV1 or PV2 is short-circuited", "Inspect cables for damage", "Test string isolation" } }, - ["Warning 208"] = new() + ["PvBoostDriverAbnormal"] = new() + { + Explanation = "PV boost driver abnormal.", + Causes = new[] { "Driver circuit fault" }, + NextSteps = new[] { "Restart the inverter" } + }, + ["AcSpdFunctionAbnormal"] = new() + { + Explanation = "AC SPD function abnormal.", + Causes = new[] { "SPD failure" }, + NextSteps = new[] { "Check AC SPD after shutdown" } + }, + ["DcFuseBlown"] = new() { Explanation = "DC fuse has blown, interrupting PV input.", Causes = new[] { "Overcurrent in DC circuit", "Short circuit", "Fuse fatigue" }, NextSteps = new[] { "Power off the system", "Check the fuse", "Identify and fix overcurrent cause before replacing fuse" } }, - ["Warning 209"] = new() + ["DcInputVoltageTooHigh"] = new() { Explanation = "DC input voltage exceeds the upper threshold - potential damage risk.", Causes = new[] { "Too many PV modules in series", "Cold temperature increasing Voc", "System design error" }, NextSteps = new[] { "Turn off DC switch immediately", "Check DC voltage", "Reconfigure string if needed" } }, - ["Warning 219"] = new() + ["PvReversed"] = new() + { + Explanation = "PV string polarity is reversed.", + Causes = new[] { "Wrong cable connection" }, + NextSteps = new[] { "Check PV polarity after shutdown" } + }, + ["PidFunctionAbnormal"] = new() { Explanation = "PID (Potential Induced Degradation) function is abnormal.", Causes = new[] { "PID module fault", "Configuration issue" }, NextSteps = new[] { "Restart the inverter", "Check PID settings" } }, - ["Warning 220"] = new() + ["PvStringDisconnected"] = new() { Explanation = "A PV string is disconnected.", Causes = new[] { "DC disconnector open", "Cable disconnection", "Connector failure" }, NextSteps = new[] { "Check if PV string is properly connected", "Verify DC switches" } }, - ["Warning 221"] = new() + ["PvStringCurrentUnbalanced"] = new() { Explanation = "PV string currents are unbalanced, indicating potential issues.", Causes = new[] { "Shading on some modules", "Module mismatch", "Partial string failure", "Soiling" }, @@ -1014,49 +996,49 @@ public static class AlarmKnowledgeBase }, // Warnings (300-series: Grid/AC) - ["Warning 300"] = new() + ["NoUtilityGrid"] = new() { Explanation = "No utility grid connection detected or grid power failure.", Causes = new[] { "Grid outage", "AC breaker tripped", "Grid cable disconnected", "Utility maintenance" }, NextSteps = new[] { "Check if grid is down", "Verify AC breaker status", "Check grid cable connections" } }, - ["Warning 301"] = new() + ["GridVoltageOutOfRange"] = new() { Explanation = "Grid voltage is outside the permissible operating range.", Causes = new[] { "Grid voltage too high or too low", "Local grid issues", "Transformer tap setting" }, NextSteps = new[] { "Check if grid voltage is within specified range", "Contact utility if persistent" } }, - ["Warning 302"] = new() + ["GridFrequencyOutOfRange"] = new() { Explanation = "Grid frequency is outside the permissible operating range.", Causes = new[] { "Grid frequency unstable", "Generator frequency drift", "Grid disturbance" }, NextSteps = new[] { "Check if grid frequency is within specified range", "Wait for grid to stabilize" } }, - ["Warning 303"] = new() + ["Overload"] = new() { Explanation = "The system is experiencing an overload condition.", Causes = new[] { "Connected load exceeds capacity", "Inrush current from appliances", "Short circuit in load" }, NextSteps = new[] { "Reduce load connected to EPS output terminal", "Check for faulty appliances" } }, - ["Warning 308"] = new() + ["MeterDisconnected"] = new() { Explanation = "Energy meter communication is lost.", Causes = new[] { "Meter offline", "Communication cable fault", "Meter power loss" }, NextSteps = new[] { "Check if meter is properly connected", "Verify communication cable", "Check meter power" } }, - ["Warning 309"] = new() + ["MeterReverselyConnected"] = new() { Explanation = "Energy meter L and N lines are reversed.", Causes = new[] { "Meter wiring error", "Installation mistake" }, NextSteps = new[] { "Check if L line and N line of meter are reversely connected", "Correct wiring" } }, - ["Warning 310"] = new() + ["LinePeVoltageAbnormal"] = new() { Explanation = "Abnormal voltage detected between neutral (N) and protective earth (PE).", Causes = new[] { "Poor PE connection", "N-PE short somewhere in installation", "Ground fault" }, NextSteps = new[] { "Check if PE cable is reliably connected after shutdown", "Verify grounding system" } }, - ["Warning 311"] = new() + ["PhaseSequenceError"] = new() { Explanation = "Phase sequence error detected. The system will auto-adjust.", Causes = new[] { "Three-phase wiring in wrong order" }, @@ -1064,43 +1046,49 @@ public static class AlarmKnowledgeBase }, // Warnings (400-series: System/Internal) - ["Warning 400"] = new() + ["FanFailure"] = new() { Explanation = "Cooling fan failure detected - risk of overheating.", Causes = new[] { "Fan motor failure", "Fan blocked", "Fan connector loose", "Fan control fault" }, NextSteps = new[] { "Check if fan is properly connected after shutdown", "Remove obstructions", "Replace fan if faulty" } }, - ["Warning 401"] = new() + ["MeterAbnormal"] = new() { Explanation = "Energy meter is reporting abnormal readings.", Causes = new[] { "Meter malfunction", "Configuration error", "Communication issue" }, NextSteps = new[] { "Check if meter is turned on", "Verify meter configuration" } }, - ["Warning 402"] = new() + ["OptimizerCommunicationAbnormal"] = new() { Explanation = "Communication with PV optimizer is abnormal.", Causes = new[] { "Optimizer offline", "Communication interference", "Optimizer fault" }, NextSteps = new[] { "Check if optimizer is turned on", "Verify communication wiring" } }, - ["Warning 407"] = new() + ["OverTemperature"] = new() { Explanation = "System temperature is too high - power may be limited.", Causes = new[] { "Poor ventilation", "High ambient temperature", "Fan failure", "Excessive load" }, NextSteps = new[] { "Restart the inverter", "If fault persists, improve cooling", "Contact manufacturer if unresolved" } }, - ["Warning 408"] = new() + ["OverTemperatureAlarm"] = new() { Explanation = "NTC temperature sensor is broken or disconnected.", Causes = new[] { "Sensor failure", "Sensor cable damaged", "Connector issue" }, NextSteps = new[] { "Restart the inverter", "If persistent, sensor may need replacement" } }, - ["Warning 411"] = new() + ["NtcTemperatureSensorBroken"] = new() + { + Explanation = "NTC temperature sensor is broken.", + Causes = new[] { "Sensor failure" }, + NextSteps = new[] { "Replace sensor" } + }, + ["SyncSignalAbnormal"] = new() { Explanation = "Synchronization signal is abnormal (for parallel systems).", Causes = new[] { "Sync cable fault", "Sync interface failure", "Configuration mismatch" }, NextSteps = new[] { "Check if sync cable is abnormal", "Verify connections" } }, - ["Warning 412"] = new() + ["GridStartupConditionsNotMet"] = new() { Explanation = "Grid-connection startup requirements are not met.", Causes = new[] { "Grid voltage/frequency out of range", "Incorrect startup voltage configuration" }, @@ -1108,67 +1096,67 @@ public static class AlarmKnowledgeBase }, // Warnings (500-series: Battery) - ["Warning 500"] = new() + ["BatteryCommunicationFailure"] = new() { Explanation = "Inverter cannot communicate with the battery BMS.", Causes = new[] { "BMS offline", "Communication cable fault", "Protocol mismatch", "Battery in sleep mode" }, NextSteps = new[] { "Check if battery is turned on", "Verify RS485 communication cable", "Wake up battery if in sleep mode" } }, - ["Warning 501"] = new() + ["BatteryDisconnected"] = new() { Explanation = "Battery is disconnected from the system.", Causes = new[] { "Battery breaker off", "Cable disconnected", "BMS shutdown", "Battery fault" }, NextSteps = new[] { "Check if battery is properly connected", "Verify battery breaker", "Check BMS status" } }, - ["Warning 502"] = new() + ["BatteryVoltageTooHigh"] = new() { Explanation = "Battery voltage is too high.", Causes = new[] { "Overcharging", "BMS fault", "Cell imbalance", "Voltage setting error" }, NextSteps = new[] { "Check if battery voltage is within permissible range", "Verify charging settings" } }, - ["Warning 503"] = new() + ["BatteryVoltageTooLow"] = new() { Explanation = "Battery voltage is too low.", Causes = new[] { "Battery deeply discharged", "Cell failure", "High load drain", "BMS cutoff" }, NextSteps = new[] { "Check if battery voltage is within permissible range", "Allow battery to charge" } }, - ["Warning 504"] = new() + ["BatteryReverseConnected"] = new() { Explanation = "Battery positive and negative terminals are reversed.", Causes = new[] { "Installation error", "Wrong cable connection" }, NextSteps = new[] { "Check if positive and negative terminals of battery are reversely connected", "CORRECT IMMEDIATELY - risk of damage" } }, - ["Warning 505"] = new() + ["LeadAcidTempSensorDisconnected"] = new() { Explanation = "Lead-acid battery temperature sensor is disconnected.", Causes = new[] { "Sensor not installed", "Sensor cable fault", "Sensor failure" }, NextSteps = new[] { "Check if temperature sensor of lead-acid battery is installed", "Verify connections" } }, - ["Warning 506"] = new() + ["BatteryTemperatureOutOfRange"] = new() { Explanation = "Battery temperature is outside the safe operating range.", Causes = new[] { "High ambient temperature", "Poor battery ventilation", "Battery overheating", "Cold environment" }, NextSteps = new[] { "Check if ambient temperature of battery is within specified range", "Improve battery cooling/heating" } }, - ["Warning 507"] = new() + ["BmsFault"] = new() { Explanation = "Battery BMS has reported a fault preventing charging and discharging.", Causes = new[] { "BMS internal fault", "Cell protection triggered", "Communication error" }, NextSteps = new[] { "Figure out the cause according to BMS error code", "Check battery status display" } }, - ["Warning 508"] = new() + ["LithiumBatteryOverload"] = new() { Explanation = "Lithium battery overload protection has activated.", Causes = new[] { "Load power exceeds battery discharge rating", "High inrush current" }, NextSteps = new[] { "Check if power of load exceeds BAT rated discharge power", "Reduce load" } }, - ["Warning 509"] = new() + ["BmsCommunicationAbnormal"] = new() { Explanation = "BMS communication is abnormal.", Causes = new[] { "Communication timeout", "Protocol error", "Cable fault" }, NextSteps = new[] { "Restart the inverter", "Check BMS communication cable" } }, - ["Warning 510"] = new() + ["BatterySpdAbnormal"] = new() { Explanation = "Battery surge protection device (SPD) function is abnormal.", Causes = new[] { "SPD triggered", "SPD failure", "Lightning damage" }, @@ -1176,49 +1164,49 @@ public static class AlarmKnowledgeBase }, // Warnings (600-series: Off-grid/EPS) - ["Warning 600"] = new() + ["OutputDcComponentBiasAbnormal"] = new() { Explanation = "Output DC component bias is abnormal.", Causes = new[] { "Sensor drift", "Control issue", "Hardware fault" }, NextSteps = new[] { "Restart the inverter", "If fault persists, contact manufacturer" } }, - ["Warning 601"] = new() + ["DcComponentOverHighOutputVoltage"] = new() { Explanation = "DC component in output voltage is too high.", Causes = new[] { "Control drift", "Sensor fault", "Transformer issue" }, NextSteps = new[] { "Restart the inverter", "Check output for DC offset" } }, - ["Warning 602"] = new() + ["OffGridOutputVoltageTooLow"] = new() { Explanation = "Off-grid/EPS output voltage is too low.", Causes = new[] { "Overload", "Battery voltage low", "Inverter limitation" }, NextSteps = new[] { "Restart the inverter", "Reduce load", "If fault persists, contact manufacturer" } }, - ["Warning 603"] = new() + ["OffGridOutputVoltageTooHigh"] = new() { Explanation = "Off-grid/EPS output voltage is too high.", Causes = new[] { "Control fault", "Voltage regulation issue" }, NextSteps = new[] { "Restart the inverter", "If fault persists, contact manufacturer" } }, - ["Warning 604"] = new() + ["OffGridOutputOverCurrent"] = new() { Explanation = "Off-grid output current overcurrent detected.", Causes = new[] { "Load exceeds specification", "Short circuit in load", "Inrush current" }, NextSteps = new[] { "Check if load is within specification", "Look for short circuits" } }, - ["Warning 605"] = new() + ["OffGridBusVoltageTooLow"] = new() { Explanation = "Off-grid DC bus voltage is too low.", Causes = new[] { "Battery depleted", "High load demand", "Power electronics issue" }, NextSteps = new[] { "Check if load power exceeds upper limit", "Allow battery to charge" } }, - ["Warning 606"] = new() + ["OffGridOutputOverload"] = new() { Explanation = "Off-grid output is overloaded.", Causes = new[] { "Load exceeds EPS capacity", "Too many appliances on backup" }, NextSteps = new[] { "Check if load is within specification", "Reduce backup load" } }, - ["Warning 609"] = new() + ["BalancedCircuitAbnormal"] = new() { Explanation = "Phase balancing circuit is abnormal.", Causes = new[] { "Balance circuit fault", "Control issue" }, @@ -1226,157 +1214,145 @@ public static class AlarmKnowledgeBase }, // Errors (Protection-level faults) - ["Error 309"] = new() - { - Explanation = "Grid Rate of Change of Frequency (ROCOF) is abnormal - anti-islanding protection.", - Causes = new[] { "Grid instability", "Generator operation nearby", "Grid fault" }, - NextSteps = new[] { "Check grid frequency", "Restart the inverter", "Wait for grid to stabilize" } - }, - ["Error 311"] = new() + ["ExportLimitationFailSafe"] = new() { Explanation = "Export limitation fail-safe has triggered.", Causes = new[] { "CT disconnected", "Meter communication lost", "Feedback loop failure" }, NextSteps = new[] { "After shutdown, check connection of CT and meter", "Verify export limit settings" } }, - ["Error 400"] = new() + ["DcBiasAbnormal"] = new() { Explanation = "DCI (DC Injection) bias is abnormal - safety protection.", Causes = new[] { "DC injection into grid", "Sensor fault", "Transformer issue" }, NextSteps = new[] { "Restart the inverter", "If persistent, requires service" } }, - ["Error 402"] = new() + ["HighDcComponentOutputCurrent"] = new() { Explanation = "High DC component detected in output current.", Causes = new[] { "Output filter issue", "Control fault", "Transformer saturation" }, NextSteps = new[] { "Restart the inverter", "Check output connections" } }, - ["Error 404"] = new() + ["BusVoltageSamplingAbnormal"] = new() { Explanation = "DC bus voltage sampling is abnormal.", Causes = new[] { "Voltage sensor fault", "ADC error", "Hardware issue" }, NextSteps = new[] { "Restart the inverter", "If persistent, requires service" } }, - ["Error 405"] = new() + ["RelayFault"] = new() { Explanation = "Internal relay fault detected.", Causes = new[] { "Relay failure", "Contact welding", "Driver circuit fault" }, NextSteps = new[] { "Restart the inverter", "If persistent, relay replacement needed" } }, - ["Error 408"] = new() - { - Explanation = "System over-temperature - shutdown for protection.", - Causes = new[] { "Cooling failure", "High ambient temperature", "Blocked ventilation", "Overload" }, - NextSteps = new[] { "After shutdown, check temperature", "Restart after temperature is within acceptable range" } - }, - ["Error 409"] = new() + ["BusVoltageAbnormal"] = new() { Explanation = "DC bus voltage is abnormal.", Causes = new[] { "Power electronics fault", "Capacitor issue", "Control failure" }, NextSteps = new[] { "Restart the inverter", "If persistent, requires service" } }, - ["Error 411"] = new() + ["InternalCommunicationFailure"] = new() { Explanation = "Internal communication failure between control boards.", Causes = new[] { "Communication board fault", "Cable loose", "EMI interference" }, NextSteps = new[] { "Check wiring of communication board after shutdown", "Restart inverter" } }, - ["Error 412"] = new() + ["TemperatureSensorDisconnected"] = new() { Explanation = "Temperature sensor is disconnected.", Causes = new[] { "Sensor failure", "Cable fault", "Connector issue" }, NextSteps = new[] { "Check wiring of communication board after shutdown", "Replace sensor if faulty" } }, - ["Error 413"] = new() + ["IgbtDriveFault"] = new() { Explanation = "IGBT gate drive fault detected.", Causes = new[] { "Driver circuit failure", "IGBT fault", "Power supply issue" }, NextSteps = new[] { "Restart the inverter", "If persistent, requires professional service" } }, - ["Error 414"] = new() + ["EepromError"] = new() { Explanation = "EEPROM read/write error.", Causes = new[] { "Memory chip fault", "Data corruption", "Hardware failure" }, NextSteps = new[] { "Restart the inverter", "Factory reset may be required" } }, - ["Error 415"] = new() + ["AuxiliaryPowerAbnormal"] = new() { Explanation = "Auxiliary power supply is abnormal.", Causes = new[] { "Internal power supply failure", "Component fault" }, NextSteps = new[] { "Restart the inverter", "If persistent, requires service" } }, - ["Error 416"] = new() + ["DcAcOvercurrentProtection"] = new() { Explanation = "DC/AC overcurrent protection has triggered.", Causes = new[] { "Short circuit", "Severe overload", "Power electronics fault" }, NextSteps = new[] { "Restart the inverter", "Check for short circuits", "Reduce load" } }, - ["Error 417"] = new() + ["CommunicationProtocolMismatch"] = new() { Explanation = "Communication protocol mismatch between components.", Causes = new[] { "Firmware version mismatch", "Configuration error" }, NextSteps = new[] { "Restart the inverter", "Update firmware if needed" } }, - ["Error 418"] = new() + ["DspComFirmwareMismatch"] = new() { Explanation = "DSP and COM board firmware versions are mismatched.", Causes = new[] { "Incomplete firmware update", "Wrong firmware loaded" }, NextSteps = new[] { "Restart the inverter", "Perform complete firmware update" } }, - ["Error 419"] = new() + ["DspSoftwareHardwareMismatch"] = new() { Explanation = "DSP software and hardware versions are mismatched.", Causes = new[] { "Hardware replacement with incompatible firmware" }, NextSteps = new[] { "Restart the inverter", "Contact support for firmware update" } }, - ["Error 421"] = new() + ["CpldAbnormal"] = new() { Explanation = "CPLD (programmable logic) is abnormal.", Causes = new[] { "CPLD failure", "Firmware corruption" }, NextSteps = new[] { "Restart the inverter", "If persistent, requires service" } }, - ["Error 422"] = new() + ["RedundancySamplingInconsistent"] = new() { Explanation = "Redundancy sampling values are inconsistent.", Causes = new[] { "Sensor mismatch", "Calibration error", "Hardware fault" }, NextSteps = new[] { "Restart the inverter", "May require recalibration" } }, - ["Error 423"] = new() + ["PwmPassThroughSignalFailure"] = new() { Explanation = "PWM pass-through signal failure.", Causes = new[] { "Control board fault", "Signal path issue" }, NextSteps = new[] { "Restart the inverter", "If persistent, requires service" } }, - ["Error 425"] = new() + ["AfciSelfTestFailure"] = new() { Explanation = "AFCI (Arc Fault Circuit Interrupter) self-test failed.", Causes = new[] { "AFCI module fault", "Self-test circuit issue" }, NextSteps = new[] { "Restart the inverter", "AFCI may need replacement" } }, - ["Error 426"] = new() + ["PvCurrentSamplingAbnormal"] = new() { Explanation = "PV current sampling is abnormal.", Causes = new[] { "Current sensor fault", "ADC error" }, NextSteps = new[] { "Restart the inverter", "If persistent, requires service" } }, - ["Error 427"] = new() + ["AcCurrentSamplingAbnormal"] = new() { Explanation = "AC current sampling is abnormal.", Causes = new[] { "CT fault", "Sensor failure", "ADC error" }, NextSteps = new[] { "Restart the inverter", "Check CT connections" } }, - ["Error 429"] = new() + ["BusSoftbootFailure"] = new() { Explanation = "DC bus soft-boot (pre-charge) failed.", Causes = new[] { "Pre-charge circuit fault", "Capacitor issue", "Relay fault" }, NextSteps = new[] { "Restart the inverter", "If persistent, requires service" } }, - ["Error 430"] = new() + ["EpoFault"] = new() { Explanation = "EPO (Emergency Power Off) fault triggered.", Causes = new[] { "EPO button pressed", "EPO circuit activated", "Safety system trigger" }, NextSteps = new[] { "Restart the inverter", "Check EPO circuit if unintentional" } }, - ["Error 431"] = new() + ["MonitoringChipBootVerificationFailed"] = new() { Explanation = "Monitoring chip BOOT verification failed.", Causes = new[] { "Firmware corruption", "Chip failure" }, @@ -1384,61 +1360,73 @@ public static class AlarmKnowledgeBase }, // Battery Errors - ["Error 500"] = new() + ["BmsCommunicationFailure"] = new() { Explanation = "BMS failed to communicate with the inverter.", Causes = new[] { "RS485 cable fault", "BMS offline", "Protocol mismatch" }, NextSteps = new[] { "Check connection of RS485 cable between inverter and battery" } }, - ["Error 501"] = new() + ["BmsChargeDischargeFailure"] = new() { Explanation = "BMS reports that battery cannot charge or discharge.", Causes = new[] { "BMS internal fault", "Protection triggered", "Cell issue" }, NextSteps = new[] { "Figure out the fault based on BMS error code", "Check battery status" } }, - ["Error 503"] = new() + ["BatteryVoltageLow"] = new() + { + Explanation = "Battery voltage is below minimum.", + Causes = new[] { "Deep discharge, cell failure" }, + NextSteps = new[] { "Check battery voltage" } + }, + ["BatteryVoltageHigh"] = new() { Explanation = "Battery voltage exceeds upper threshold.", Causes = new[] { "Overcharging", "BMS fault", "Cell failure" }, NextSteps = new[] { "Check battery voltage", "If within permissible range, restart inverter" } }, - ["Error 504"] = new() + ["BatteryTemperatureAbnormal"] = new() { Explanation = "Battery temperature is outside safe charging/discharging range.", Causes = new[] { "Battery too hot", "Battery too cold", "Sensor fault" }, NextSteps = new[] { "Check temperature of the battery", "Improve battery environment" } }, - ["Error 506"] = new() + ["BatteryReversed"] = new() + { + Explanation = "Battery polarity reversed.", + Causes = new[] { "Wrong connection" }, + NextSteps = new[] { "Correct polarity immediately" } + }, + ["BatteryOpenCircuit"] = new() { Explanation = "Battery is open-circuited (not connected).", Causes = new[] { "Battery cable disconnected", "Fuse blown", "BMS cutoff" }, NextSteps = new[] { "Check wiring of battery terminals", "Verify fuses" } }, - ["Error 507"] = new() + ["BatteryOverloadProtection"] = new() { Explanation = "Battery overload protection has triggered.", Causes = new[] { "Load exceeds battery discharge rating" }, NextSteps = new[] { "Check if power of load exceeds battery rated discharge power", "Reduce load" } }, - ["Error 508"] = new() + ["Bus2VoltageAbnormal"] = new() { Explanation = "Secondary DC bus voltage is abnormal.", Causes = new[] { "Power electronics fault", "Control issue" }, NextSteps = new[] { "Restart the inverter" } }, - ["Error 509"] = new() + ["BatteryChargeOcp"] = new() { Explanation = "Battery charge overcurrent protection (OCP) triggered.", Causes = new[] { "PV oversized for battery", "Charge current setting too high" }, NextSteps = new[] { "Check if PV voltage is oversized", "Reduce charge current setting" } }, - ["Error 510"] = new() + ["BatteryDischargeOcp"] = new() { Explanation = "Battery discharge overcurrent protection (OCP) triggered.", Causes = new[] { "Load too high", "Discharge current setting wrong" }, NextSteps = new[] { "Check if battery discharge current configuration is proper", "Reduce load" } }, - ["Error 511"] = new() + ["BatterySoftStartFailed"] = new() { Explanation = "Battery soft-start failed.", Causes = new[] { "Pre-charge circuit fault", "Battery voltage mismatch" }, @@ -1446,43 +1434,55 @@ public static class AlarmKnowledgeBase }, // Off-grid Errors - ["Error 601"] = new() + ["EpsOutputShortCircuited"] = new() + { + Explanation = "EPS output is short-circuited.", + Causes = new[] { "Short circuit in load" }, + NextSteps = new[] { "Check load wiring" } + }, + ["OffGridBusVoltageLow"] = new() { Explanation = "Off-grid DC bus voltage is too low.", Causes = new[] { "Battery depleted", "High load", "Power electronics issue" }, NextSteps = new[] { "Check if battery is working properly or has capacity loss" } }, - ["Error 602"] = new() + ["OffGridTerminalVoltageAbnormal"] = new() { Explanation = "Abnormal voltage detected at off-grid terminal.", Causes = new[] { "External voltage present", "Wiring fault", "Backfeed" }, NextSteps = new[] { "Check if a voltage is present at AC port", "Verify wiring" } }, - ["Error 603"] = new() + ["SoftStartFailed"] = new() { Explanation = "Off-grid soft-start failed.", Causes = new[] { "Pre-charge failure", "Load too heavy at startup" }, NextSteps = new[] { "Restart the inverter", "Reduce initial load" } }, - ["Error 604"] = new() + ["OffGridOutputVoltageAbnormal"] = new() { Explanation = "Off-grid output voltage is abnormal.", Causes = new[] { "Control fault", "Hardware issue" }, NextSteps = new[] { "Restart the inverter" } }, - ["Error 605"] = new() + ["BalancedCircuitSelfTestFailed"] = new() { Explanation = "Balanced circuit self-test failed.", Causes = new[] { "Balance circuit fault" }, NextSteps = new[] { "Restart the inverter" } }, - ["Error 606"] = new() + ["HighDcComponentOutputVoltage"] = new() { Explanation = "High DC component in output voltage.", Causes = new[] { "Control drift", "Transformer issue" }, NextSteps = new[] { "Restart the inverter" } }, - ["Error 608"] = new() + ["OffGridOutputOverload"] = new() + { + Explanation = "Off-grid output overloaded.", + Causes = new[] { "Excessive load" }, + NextSteps = new[] { "Reduce load" } + }, + ["OffGridParallelSignalAbnormal"] = new() { Explanation = "Off-grid parallel communication signal is abnormal.", Causes = new[] { "Parallel cable fault", "Configuration mismatch" }, @@ -1490,19 +1490,19 @@ public static class AlarmKnowledgeBase }, // Special fault codes - ["AFCI Fault"] = new() + ["AFCIFault"] = new() { Explanation = "An arc fault has been detected in the PV system - fire risk protection activated.", Causes = new[] { "Loose connection causing arcing", "Damaged cable insulation", "Connector fault", "Module junction box issue" }, NextSteps = new[] { "After shutdown, check connection of PV string", "Inspect all connectors", "Look for damaged insulation" } }, - ["GFCI High"] = new() + ["GFCIHigh"] = new() { Explanation = "Excessively high ground fault/leakage current detected.", Causes = new[] { "Ground fault in PV array", "Insulation breakdown", "Moisture ingress", "Cable damage" }, NextSteps = new[] { "Restart the inverter", "If persistent, check PV array insulation" } }, - ["PV Voltage High"] = new() + ["PVVoltageHigh"] = new() { Explanation = "DC input voltage exceeds the maximum safe limit.", Causes = new[] { "Too many PV modules in series", "Cold temperature increasing Voc" }, diff --git a/csharp/App/Backend/Services/DiagnosticService.cs b/csharp/App/Backend/Services/DiagnosticService.cs index ed0b2e30f..005734475 100644 --- a/csharp/App/Backend/Services/DiagnosticService.cs +++ b/csharp/App/Backend/Services/DiagnosticService.cs @@ -68,7 +68,9 @@ public static class DiagnosticService var recentDescriptions = Db.Errors .Where(e => e.InstallationId == installationId) - .OrderByDescending(e => e.Date + " " + e.Time) // Date/Time stored as strings in DB + .OrderByDescending(e => e.Date) + .ThenByDescending(e => e.Time) + .ToList() // materialize before LINQ-to-objects ops .Select(e => e.Description) .Distinct() // deduplicate — same error repeated adds no signal .Take(5) diff --git a/typescript/frontend-marios2/src/content/dashboards/Log/Log.tsx b/typescript/frontend-marios2/src/content/dashboards/Log/Log.tsx index a6ac90f1a..fa2b9b539 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Log/Log.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Log/Log.tsx @@ -47,10 +47,9 @@ function Log(props: LogProps) { const tokencontext = useContext(TokenContext); const { removeToken } = tokencontext; - const [diagnosis, setDiagnosis] = useState(null); + const [diagnoses, setDiagnoses] = useState<{ description: string; response: DiagnosticResponse }[]>([]); const [diagnosisLoading, setDiagnosisLoading] = useState(false); - const [diagnosisExpanded, setDiagnosisExpanded] = useState(false); - const [diagnosedError, setDiagnosedError] = useState(''); + const [expandedDiagnoses, setExpandedDiagnoses] = useState>(new Set()); useEffect(() => { axiosConfig @@ -78,32 +77,50 @@ function Log(props: LogProps) { }); }, [updateCount]); - // fetch AI diagnosis for the first unseen error (or warning if no unseen errors) + // fetch AI diagnosis for the latest 3 unique errors/warnings useEffect(() => { - const target = errors.find(e => !e.seen) || warnings.find(w => !w.seen); + // combine errors and warnings, filter non-errors, sort by date+time descending, deduplicate + const ignore = new Set(['NoAlarm', '0', '']); + const all = [...errors, ...warnings] + .filter(item => !ignore.has(item.description.trim())) + .sort((a, b) => (b.date + ' ' + b.time).localeCompare(a.date + ' ' + a.time)); - if (!target) { - setDiagnosis(null); - setDiagnosedError(''); + const seen = new Set(); + const targets: ErrorMessage[] = []; + for (const item of all) { + if (!seen.has(item.description)) { + seen.add(item.description); + targets.push(item); + if (targets.length >= 3) break; + } + } + + if (targets.length === 0) { + setDiagnoses([]); return; } - // already have a diagnosis for this exact description — skip - if (target.description === diagnosedError && diagnosis) return; + // check if the targets changed compared to what we already have + const currentDescs = diagnoses.map(d => d.description).join('|'); + const newDescs = targets.map(t => t.description).join('|'); + if (currentDescs === newDescs) return; setDiagnosisLoading(true); - axiosConfig - .get(`/DiagnoseError?installationId=${props.id}&errorDescription=${encodeURIComponent(target.description)}`) - .then((res: AxiosResponse) => { - setDiagnosis(res.data); - setDiagnosedError(target.description); - }) - .catch(() => { - setDiagnosis(null); - }) - .finally(() => { - setDiagnosisLoading(false); - }); + Promise.all( + targets.map(target => + axiosConfig + .get(`/DiagnoseError?installationId=${props.id}&errorDescription=${encodeURIComponent(target.description)}`) + .then((res: AxiosResponse) => { + if (res.status === 204 || !res.data || !res.data.explanation) return null; + return { description: target.description, response: res.data }; + }) + .catch(() => null) + ) + ).then(results => { + setDiagnoses(results.filter(r => r !== null) as { description: string; response: DiagnosticResponse }[]); + }).finally(() => { + setDiagnosisLoading(false); + }); }, [errors, warnings]); const handleErrorButtonPressed = () => { @@ -437,77 +454,81 @@ function Log(props: LogProps) { - {/* AI Diagnosis banner — shown when loading or a diagnosis is available */} - {(diagnosisLoading || diagnosis) && ( + {/* AI Diagnosis banner — shown when loading or diagnoses are available */} + {diagnosisLoading && ( - - - {/* loading state */} - {diagnosisLoading && ( - - - - - - - )} - - {/* diagnosis result */} - {diagnosis && !diagnosisLoading && ( - <> - - - - - - {diagnosedError} - - - - - {diagnosis.explanation} - - - - - {diagnosisExpanded && ( - - - - -
    - {diagnosis.causes.map((cause, i) => ( -
  • {cause}
  • - ))} -
- - - - -
    - {diagnosis.nextSteps.map((step, i) => ( -
  1. {step}
  2. - ))} -
-
- )} - - )} + + + + +
)} + {!diagnosisLoading && diagnoses.map((diag, idx) => { + const isExpanded = expandedDiagnoses.has(idx); + return ( + + + + + + + + + {diag.description} + + + + + {diag.response.explanation} + + + + + {isExpanded && ( + + + + +
    + {diag.response.causes.map((cause, i) => ( +
  • {cause}
  • + ))} +
+ + + + +
    + {diag.response.nextSteps.map((step, i) => ( +
  1. {step}
  2. + ))} +
+
+ )} +
+
+
+ ); + })} +