diff --git a/csharp/App/Backend/DataTypes/Installation.cs b/csharp/App/Backend/DataTypes/Installation.cs index bdf63571d..0345e3292 100644 --- a/csharp/App/Backend/DataTypes/Installation.cs +++ b/csharp/App/Backend/DataTypes/Installation.cs @@ -27,6 +27,13 @@ public class Installation : TreeNode public String Location { get; set; } = ""; public String Region { get; set; } = ""; public String Country { get; set; } = ""; + public String Street { get; set; } = ""; + public String PostCode { get; set; } = ""; + public String City { get; set; } = ""; + public String Canton { get; set; } = ""; + public String DistributionPartner { get; set; } = ""; + public String InverterFirmwareVersion { get; set; } = ""; + public String BatteryFirmwareVersion { get; set; } = ""; public String VpnIp { get; set; } = ""; public String InstallationName { get; set; } = ""; diff --git a/csharp/App/Backend/Services/ReportAggregationService.cs b/csharp/App/Backend/Services/ReportAggregationService.cs index 4dbab2985..50614e28c 100644 --- a/csharp/App/Backend/Services/ReportAggregationService.cs +++ b/csharp/App/Backend/Services/ReportAggregationService.cs @@ -364,12 +364,15 @@ public static class ReportAggregationService var installationName = installation?.Name ?? $"Installation {installationId}"; var monthName = new DateTime(year, month, 1).ToString("MMMM yyyy"); + var weatherCity = !string.IsNullOrWhiteSpace(installation?.City) ? installation.City : installation?.Location; + var weatherRegion = !string.IsNullOrWhiteSpace(installation?.Canton) ? installation.Canton : installation?.Region; + var aiInsight = await GenerateMonthlyAiInsightAsync( installationName, monthName, days.Count, totalPv, totalConsump, totalGridIn, totalGridOut, totalBattChg, totalBattDis, energySaved, savingsCHF, selfSufficiency, batteryEff, language, - installation?.Location, installation?.Country, installation?.Region); + weatherCity, installation?.Country, weatherRegion); var monthlySummary = new MonthlyReportSummary { @@ -591,6 +594,8 @@ public static class ReportAggregationService var installationName = installation?.Name ?? $"Installation {report.InstallationId}"; var monthName = new DateTime(report.Year, report.Month, 1).ToString("MMMM yyyy"); + var weatherCity = !string.IsNullOrWhiteSpace(installation?.City) ? installation.City : installation?.Location; + var weatherRegion = !string.IsNullOrWhiteSpace(installation?.Canton) ? installation.Canton : installation?.Region; return GetOrGenerateInsightAsync("monthly", report.Id, language, () => GenerateMonthlyAiInsightAsync( installationName, monthName, report.WeekCount, @@ -599,7 +604,7 @@ public static class ReportAggregationService report.TotalBatteryCharged, report.TotalBatteryDischarged, report.TotalEnergySaved, report.TotalSavingsCHF, report.SelfSufficiencyPercent, report.BatteryEfficiencyPercent, language, - installation?.Location, installation?.Country, installation?.Region)); + weatherCity, installation?.Country, weatherRegion)); } /// Cached-or-generated AI insight for a stored YearlyReportSummary. diff --git a/csharp/App/Backend/Services/WeeklyReportService.cs b/csharp/App/Backend/Services/WeeklyReportService.cs index 2fe3e8047..67c1b07b3 100644 --- a/csharp/App/Backend/Services/WeeklyReportService.cs +++ b/csharp/App/Backend/Services/WeeklyReportService.cs @@ -179,9 +179,9 @@ public static class WeeklyReportService // 4. Get installation location for weather forecast var installation = Db.GetInstallationById(installationId); - var location = installation?.Location; + var location = !string.IsNullOrWhiteSpace(installation?.City) ? installation.City : installation?.Location; var country = installation?.Country; - var region = installation?.Region; + var region = !string.IsNullOrWhiteSpace(installation?.Canton) ? installation.Canton : installation?.Region; Console.WriteLine($"[WeeklyReportService] Installation {installationId}: Location='{location}', Region='{region}', Country='{country}', HourlyRecords={currentHourlyData.Count}"); return await GenerateReportFromDataAsync( diff --git a/typescript/frontend-marios2/src/content/dashboards/Information/InformationSodistoreHome.tsx b/typescript/frontend-marios2/src/content/dashboards/Information/InformationSodistoreHome.tsx index 3cb43e526..a94a91042 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Information/InformationSodistoreHome.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Information/InformationSodistoreHome.tsx @@ -60,7 +60,7 @@ function InformationSodistorehome(props: InformationSodistorehomeProps) { const theme = useTheme(); const intl = useIntl(); const [formValues, setFormValues] = useState(props.values); - const requiredFields = ['name', 'region', 'location', 'country']; + const requiredFields = ['name']; const [openModalDeleteInstallation, setOpenModalDeleteInstallation] = useState(false); const [pendingPreset, setPendingPreset] = useState(null); @@ -95,7 +95,7 @@ function InformationSodistorehome(props: InformationSodistorehomeProps) { const DeviceTypes = [ { id: 3, name: 'Growatt' }, - { id: 4, name: 'Sinexcel' } + { id: 4, name: 'inesco 12K - WR Hybrid' } ]; // Preset state — initializes from persisted installationModel, empty for legacy @@ -533,27 +533,45 @@ function InformationSodistorehome(props: InformationSodistorehomeProps) {
} - name="region" - value={formValues.region} + label={} + name="street" + value={formValues.street || ''} onChange={handleChange} variant="outlined" fullWidth - required={canEdit} - error={canEdit && formValues.region === ''} inputProps={{ readOnly: !canEdit }} />
} - name="location" - value={formValues.location} + label={} + name="postCode" + value={formValues.postCode || ''} + onChange={handleChange} + variant="outlined" + fullWidth + inputProps={{ readOnly: !canEdit }} + /> +
+
+ } + name="city" + value={formValues.city || ''} + onChange={handleChange} + variant="outlined" + fullWidth + inputProps={{ readOnly: !canEdit }} + /> +
+
+ } + name="canton" + value={formValues.canton || ''} onChange={handleChange} variant="outlined" fullWidth - required={canEdit} - error={canEdit && formValues.location === ''} inputProps={{ readOnly: !canEdit }} />
@@ -561,12 +579,21 @@ function InformationSodistorehome(props: InformationSodistorehomeProps) { } name="country" - value={formValues.country} + value={formValues.country || ''} + onChange={handleChange} + variant="outlined" + fullWidth + inputProps={{ readOnly: !canEdit }} + /> + +
+ } + name="distributionPartner" + value={formValues.distributionPartner || ''} onChange={handleChange} variant="outlined" fullWidth - required={canEdit} - error={canEdit && formValues.country === ''} inputProps={{ readOnly: !canEdit }} />
@@ -696,6 +723,18 @@ function InformationSodistorehome(props: InformationSodistorehomeProps) { +
+ } + name="serialNumber" + value={formValues.serialNumber || ''} + onChange={handleChange} + variant="outlined" + fullWidth + inputProps={{ readOnly: !canEdit }} + /> +
+
} - name="serialNumber" - value={formValues.serialNumber} + label={} + name="inverterFirmwareVersion" + value={formValues.inverterFirmwareVersion || ''} + onChange={handleChange} + variant="outlined" + fullWidth + inputProps={{ readOnly: !canEdit }} + /> +
+ +
+ } + name="batteryFirmwareVersion" + value={formValues.batteryFirmwareVersion || ''} onChange={handleChange} variant="outlined" fullWidth diff --git a/typescript/frontend-marios2/src/content/dashboards/Log/Log.tsx b/typescript/frontend-marios2/src/content/dashboards/Log/Log.tsx index 2e4e5853e..c883c9f6b 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Log/Log.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Log/Log.tsx @@ -288,7 +288,7 @@ function Log(props: LogProps) { onChange={e => { setDemoAlarm(e.target.value); setDemoResult(null); }} sx={{ minWidth: 260 }} > - Sinexcel + inesco 12K - WR Hybrid {DEMO_ALARMS.sinexcel.map(a => ( {a} ))} diff --git a/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/FlatInstallationView.tsx b/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/FlatInstallationView.tsx index 982e187b4..bd5a19d79 100644 --- a/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/FlatInstallationView.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/FlatInstallationView.tsx @@ -96,14 +96,14 @@ const FlatInstallationView = (props: FlatInstallationViewProps) => { - - - - + + + + @@ -146,19 +146,6 @@ const FlatInstallationView = (props: FlatInstallationViewProps) => { - - - {installation.location} - - - { noWrap sx={{ marginTop: '10px', fontSize: 'small' }} > - {installation.region} + {installation.device === 3 ? 'Growatt' : installation.device === 4 ? 'inesco 12K - WR Hybrid' : ''} + + + + + + {installation.canton || ''} diff --git a/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/SodistorehomeInstallationForm.tsx b/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/SodistorehomeInstallationForm.tsx index 764189e54..be7804ac0 100644 --- a/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/SodistorehomeInstallationForm.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/SodistorehomeInstallationForm.tsx @@ -30,18 +30,15 @@ function SodistorehomeInstallationForm(props: SodistorehomeInstallationFormPros) const [open, setOpen] = useState(true); const [formValues, setFormValues] = useState>({ name: '', - region: '', - location: '', - country: '', vpnIp: '', installationModel: '', externalEms: 'No', }); - const requiredFields = ['name', 'location', 'country', 'vpnIp', 'installationModel']; + const requiredFields = ['name', 'vpnIp', 'installationModel']; const DeviceTypes = [ { id: 3, name: 'Growatt' }, - { id: 4, name: 'Sinexcel' } + { id: 4, name: 'inesco 12K - WR Hybrid' } ]; const installationContext = useContext(InstallationsContext); const { createInstallation, loading, setLoading, error, setError } = @@ -127,42 +124,6 @@ function SodistorehomeInstallationForm(props: SodistorehomeInstallationFormPros) error={formValues.name === ''} />
-
- } - name="region" - value={formValues.region} - onChange={handleChange} - required - error={formValues.region === ''} - /> -
-
- - } - name="location" - value={formValues.location} - onChange={handleChange} - required - error={formValues.location === ''} - /> -
- -
- - } - name="country" - value={formValues.country} - onChange={handleChange} - required - error={formValues.country === ''} - /> -
-
} diff --git a/typescript/frontend-marios2/src/content/dashboards/Tickets/CreateTicketModal.tsx b/typescript/frontend-marios2/src/content/dashboards/Tickets/CreateTicketModal.tsx index f65602627..a6baa3296 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Tickets/CreateTicketModal.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Tickets/CreateTicketModal.tsx @@ -47,7 +47,7 @@ const deviceOptionsByProduct: Record ], 2: [ { value: 3, label: 'Growatt' }, - { value: 4, label: 'Sinexcel' } + { value: 4, label: 'inesco 12K - WR Hybrid' } ] }; diff --git a/typescript/frontend-marios2/src/interfaces/InstallationTypes.tsx b/typescript/frontend-marios2/src/interfaces/InstallationTypes.tsx index f5f1f40b5..01f8a3d4c 100644 --- a/typescript/frontend-marios2/src/interfaces/InstallationTypes.tsx +++ b/typescript/frontend-marios2/src/interfaces/InstallationTypes.tsx @@ -7,6 +7,13 @@ export interface I_Installation extends I_S3Credentials { location: string; region: string; country: string; + street?: string; + postCode?: string; + city?: string; + canton?: string; + distributionPartner?: string; + inverterFirmwareVersion?: string; + batteryFirmwareVersion?: string; installationName: string; vpnIp: string; orderNumbers: string[] | string; diff --git a/typescript/frontend-marios2/src/lang/de.json b/typescript/frontend-marios2/src/lang/de.json index bcaf03868..9bf46ca08 100644 --- a/typescript/frontend-marios2/src/lang/de.json +++ b/typescript/frontend-marios2/src/lang/de.json @@ -6,6 +6,13 @@ "alarms": "Alarme", "applyChanges": "Änderungen speichern", "country": "Land", + "street": "Strasse", + "postCode": "PLZ", + "city": "Ort", + "canton": "Kanton", + "distributionPartner": "Vertriebspartner", + "inverterFirmwareVersion": "Wechselrichter-Firmware-Version", + "batteryFirmwareVersion": "Batterie-Firmware-Version", "networkProvider": "Netzbetreiber", "createNewFolder": "Neuer Ordner", "createNewUser": "Neuer Benutzer", diff --git a/typescript/frontend-marios2/src/lang/en.json b/typescript/frontend-marios2/src/lang/en.json index bd17ce25e..b8e9aa4a1 100644 --- a/typescript/frontend-marios2/src/lang/en.json +++ b/typescript/frontend-marios2/src/lang/en.json @@ -2,6 +2,13 @@ "allInstallations": "All installations", "applyChanges": "Apply changes", "country": "Country", + "street": "Street", + "postCode": "Postcode", + "city": "City", + "canton": "Canton", + "distributionPartner": "Distribution Partner", + "inverterFirmwareVersion": "Inverter Firmware Version", + "batteryFirmwareVersion": "Battery Firmware Version", "networkProvider": "Network Provider", "customerName": "Customer name", "english": "English", diff --git a/typescript/frontend-marios2/src/lang/fr.json b/typescript/frontend-marios2/src/lang/fr.json index 1774b7bf8..8357a50d6 100644 --- a/typescript/frontend-marios2/src/lang/fr.json +++ b/typescript/frontend-marios2/src/lang/fr.json @@ -4,6 +4,13 @@ "alarms": "Alarmes", "applyChanges": "Appliquer", "country": "Pays", + "street": "Rue", + "postCode": "Code postal", + "city": "Ville", + "canton": "Canton", + "distributionPartner": "Partenaire de distribution", + "inverterFirmwareVersion": "Version firmware onduleur", + "batteryFirmwareVersion": "Version firmware batterie", "networkProvider": "Gestionnaire de réseau", "createNewFolder": "Nouveau dossier", "createNewUser": "Nouvel utilisateur", diff --git a/typescript/frontend-marios2/src/lang/it.json b/typescript/frontend-marios2/src/lang/it.json index cf7575fd6..9759bb9a0 100644 --- a/typescript/frontend-marios2/src/lang/it.json +++ b/typescript/frontend-marios2/src/lang/it.json @@ -2,6 +2,13 @@ "allInstallations": "Tutte le installazioni", "applyChanges": "Applica modifiche", "country": "Paese", + "street": "Via", + "postCode": "CAP", + "city": "Città", + "canton": "Cantone", + "distributionPartner": "Partner di distribuzione", + "inverterFirmwareVersion": "Versione firmware inverter", + "batteryFirmwareVersion": "Versione firmware batteria", "networkProvider": "Gestore di rete", "customerName": "Nome cliente", "english": "Inglese",