diff --git a/libnymea-app/energy/energylogs.cpp b/libnymea-app/energy/energylogs.cpp index 6b2f1480..e56e40df 100644 --- a/libnymea-app/energy/energylogs.cpp +++ b/libnymea-app/energy/energylogs.cpp @@ -259,7 +259,7 @@ void EnergyLogs::fetchLogs() if (!m_endTime.isNull()) { params.insert("to", m_endTime.toSecsSinceEpoch()); } - qCDebug(dcEnergyLogs()) << "Fetching energy logs" << params; + qCDebug(dcEnergyLogs()) << this << "Fetching energy logs" << params; m_engine->jsonRpcClient()->sendCommand("Energy.Get" + logsName(), params, this, "getLogsResponse"); } diff --git a/nymea-app/translations/nymea-app-de.ts b/nymea-app/translations/nymea-app-de.ts index d99ba890..847ffe4f 100644 --- a/nymea-app/translations/nymea-app-de.ts +++ b/nymea-app/translations/nymea-app-de.ts @@ -5326,7 +5326,7 @@ Möchtest Du fortfahren? This will start a system update. Note that the update might take several minutes and your %1 might not be functioning properly or restart during this time. - Diese Aktion wird ein System-Update starten. Dies kann mehrere Minuten dauern und Dein %1 System könnte in dieser Zeit gegebenenfalls nicht ordungsgemäß funktionieren. + Diese Aktion wird ein System-Update starten. Dies kann mehrere Minuten dauern und Dein %1 System könnte in dieser Zeit gegebenenfalls nicht ordungsgemäß funktionieren. @@ -5512,15 +5512,31 @@ Möchtest Du fortfahren? Self production: %1 kW - Eigenproduktion: %1 kW + Eigenproduktion: %1 kW From battery: %1 kW - Batterie: %1 kW + Batterie: %1 kW From grid: %1 kW - Netzbezug: %1 kW + Netzbezug: %1 kW + + + Total consumption: %1 %2 + Gesamtverbrauch: %1 %2 + + + Self production: %1 %2 + Eigenproduktion: %1 %2 + + + From battery: %1 %2 + Von Batterie: %1 %2 + + + From grid: %1 %2 + Netzbezug: %1 %2 @@ -5543,15 +5559,31 @@ Möchtest Du fortfahren? To battery: %1 kW - Batterie: %1 kW + Batterie: %1 kW To grid: %1 kW - Netzeinspeisung: %1 kW + Netzeinspeisung: %1 kW Consumed: %1 kW - Verbraucht: %1 kW + Verbraucht: %1 kW + + + Total production: %1 %2 + Gesamtproduktion: %1 %2 + + + Consumed: %1 %2 + Verbraucht: %1 %2 + + + To battery: %1 %2 + Batterieladung: %1 %2 + + + To grid: %1 %2 + Netzeinspeisung: %1 %2 diff --git a/nymea-app/translations/nymea-app-en.ts b/nymea-app/translations/nymea-app-en.ts index 9f345e20..3c6340ce 100644 --- a/nymea-app/translations/nymea-app-en.ts +++ b/nymea-app/translations/nymea-app-en.ts @@ -5239,15 +5239,19 @@ Do you want to proceed? - Self production: %1 kW + Total consumption: %1 %2 - From battery: %1 kW + Self production: %1 %2 - From grid: %1 kW + From battery: %1 %2 + + + + From grid: %1 %2 @@ -5270,15 +5274,19 @@ Do you want to proceed? - To battery: %1 kW + Total production: %1 %2 - To grid: %1 kW + Consumed: %1 %2 - Consumed: %1 kW + To battery: %1 %2 + + + + To grid: %1 %2 diff --git a/nymea-app/translations/nymea-app-en_US.ts b/nymea-app/translations/nymea-app-en_US.ts index ec712795..82672440 100644 --- a/nymea-app/translations/nymea-app-en_US.ts +++ b/nymea-app/translations/nymea-app-en_US.ts @@ -5239,15 +5239,19 @@ Do you want to proceed? - Self production: %1 kW + Total consumption: %1 %2 - From battery: %1 kW + Self production: %1 %2 - From grid: %1 kW + From battery: %1 %2 + + + + From grid: %1 %2 @@ -5270,15 +5274,19 @@ Do you want to proceed? - To battery: %1 kW + Total production: %1 %2 - To grid: %1 kW + Consumed: %1 %2 - Consumed: %1 kW + To battery: %1 %2 + + + + To grid: %1 %2 diff --git a/nymea-app/translations/nymea-app-it.ts b/nymea-app/translations/nymea-app-it.ts index 163ed8ad..fad74d1d 100644 --- a/nymea-app/translations/nymea-app-it.ts +++ b/nymea-app/translations/nymea-app-it.ts @@ -5286,15 +5286,19 @@ Do you want to proceed? - Self production: %1 kW + Total consumption: %1 %2 - From battery: %1 kW + Self production: %1 %2 - From grid: %1 kW + From battery: %1 %2 + + + + From grid: %1 %2 @@ -5317,15 +5321,19 @@ Do you want to proceed? - To battery: %1 kW + Total production: %1 %2 - To grid: %1 kW + Consumed: %1 %2 - Consumed: %1 kW + To battery: %1 %2 + + + + To grid: %1 %2 diff --git a/nymea-app/translations/nymea-app-ko.ts b/nymea-app/translations/nymea-app-ko.ts index 9c798710..123e1380 100644 --- a/nymea-app/translations/nymea-app-ko.ts +++ b/nymea-app/translations/nymea-app-ko.ts @@ -5397,15 +5397,19 @@ Do you want to proceed? - Self production: %1 kW + Total consumption: %1 %2 - From battery: %1 kW + Self production: %1 %2 - From grid: %1 kW + From battery: %1 %2 + + + + From grid: %1 %2 @@ -5428,15 +5432,19 @@ Do you want to proceed? - To battery: %1 kW + Total production: %1 %2 - To grid: %1 kW + Consumed: %1 %2 - Consumed: %1 kW + To battery: %1 %2 + + + + To grid: %1 %2 diff --git a/nymea-app/translations/nymea-app-nl.ts b/nymea-app/translations/nymea-app-nl.ts index 2839e6db..7620c755 100644 --- a/nymea-app/translations/nymea-app-nl.ts +++ b/nymea-app/translations/nymea-app-nl.ts @@ -5297,15 +5297,19 @@ Do you want to proceed? - Self production: %1 kW + Total consumption: %1 %2 - From battery: %1 kW + Self production: %1 %2 - From grid: %1 kW + From battery: %1 %2 + + + + From grid: %1 %2 @@ -5328,15 +5332,19 @@ Do you want to proceed? - To battery: %1 kW + Total production: %1 %2 - To grid: %1 kW + Consumed: %1 %2 - Consumed: %1 kW + To battery: %1 %2 + + + + To grid: %1 %2 diff --git a/nymea-app/translations/nymea-app-tr.ts b/nymea-app/translations/nymea-app-tr.ts index 72dd956f..2fbde4ca 100644 --- a/nymea-app/translations/nymea-app-tr.ts +++ b/nymea-app/translations/nymea-app-tr.ts @@ -5435,15 +5435,19 @@ Do you want to proceed? - Self production: %1 kW + Total consumption: %1 %2 - From battery: %1 kW + Self production: %1 %2 - From grid: %1 kW + From battery: %1 %2 + + + + From grid: %1 %2 @@ -5466,15 +5470,19 @@ Do you want to proceed? - To battery: %1 kW + Total production: %1 %2 - To grid: %1 kW + Consumed: %1 %2 - Consumed: %1 kW + To battery: %1 %2 + + + + To grid: %1 %2 diff --git a/nymea-app/translations/nymea-app-vi.ts b/nymea-app/translations/nymea-app-vi.ts index c3973ad6..d0cf08d5 100644 --- a/nymea-app/translations/nymea-app-vi.ts +++ b/nymea-app/translations/nymea-app-vi.ts @@ -5222,15 +5222,19 @@ Do you want to proceed? - Self production: %1 kW + Total consumption: %1 %2 - From battery: %1 kW + Self production: %1 %2 - From grid: %1 kW + From battery: %1 %2 + + + + From grid: %1 %2 @@ -5253,15 +5257,19 @@ Do you want to proceed? - To battery: %1 kW + Total production: %1 %2 - To grid: %1 kW + Consumed: %1 %2 - Consumed: %1 kW + To battery: %1 %2 + + + + To grid: %1 %2 diff --git a/nymea-app/ui/mainviews/energy/ConsumerStats.qml b/nymea-app/ui/mainviews/energy/ConsumerStats.qml index 2982abfa..b7bc1c5f 100644 --- a/nymea-app/ui/mainviews/energy/ConsumerStats.qml +++ b/nymea-app/ui/mainviews/energy/ConsumerStats.qml @@ -28,7 +28,7 @@ StatsBase { } function update() { - if (engine.thingManager.fetchingData || engine.tagsManager.busy) { + if (engine.thingManager.fetchingData || engine.tagsManager.busy || selectionTabs.currentValue === undefined) { return } powerLogs.loadingInhibited = true diff --git a/nymea-app/ui/mainviews/energy/ConsumersHistory.qml b/nymea-app/ui/mainviews/energy/ConsumersHistory.qml index 0f225698..05b3cc03 100644 --- a/nymea-app/ui/mainviews/energy/ConsumersHistory.qml +++ b/nymea-app/ui/mainviews/energy/ConsumersHistory.qml @@ -28,6 +28,14 @@ Item { thingIds: [] loadingInhibited: thingIds.length === 0 + onModelReset: { + for (var i = 0; i < consumers.count; i++) { + var consumer = consumers.get(i); + var series = d.thingsSeriesMap[consumer.id]; + series.upperSeries.clear() + } + } + onEntriesAdded: { var thingValues = ({}) var timestamp = entries[0].timestamp @@ -128,7 +136,6 @@ Item { series.borderWidth = 0; series.borderColor = series.color - // print("Adding thingId series", thing.id, thing.name) var map = d.thingsSeriesMap map[thing.id] = series d.thingsSeriesMap = map diff --git a/nymea-app/ui/mainviews/energy/ConsumersPieChart.qml b/nymea-app/ui/mainviews/energy/ConsumersPieChart.qml index ea3c1aa9..8348419e 100644 --- a/nymea-app/ui/mainviews/energy/ConsumersPieChart.qml +++ b/nymea-app/ui/mainviews/energy/ConsumersPieChart.qml @@ -155,8 +155,7 @@ ChartView { font: Style.extraSmallFont } Label { - - color: d.thingsColorMap[consumer] + color: d.thingsColorMap.hasOwnProperty(consumer) ? d.thingsColorMap[consumer] : "transparent" text: "%1 %2" .arg((consumerDelegate.value / (consumerDelegate.value > 1000 ? 1000 : 1)).toFixed(1)) .arg(consumerDelegate.value > 1000 ? "kWh" : "W") diff --git a/nymea-app/ui/mainviews/energy/PowerConsumptionBalanceHistory.qml b/nymea-app/ui/mainviews/energy/PowerConsumptionBalanceHistory.qml index 18541e72..5952414c 100644 --- a/nymea-app/ui/mainviews/energy/PowerConsumptionBalanceHistory.qml +++ b/nymea-app/ui/mainviews/energy/PowerConsumptionBalanceHistory.qml @@ -296,6 +296,14 @@ Item { font: Style.smallFont } + Label { + property double value: acquisitionUpperSeries.at(toolTip.seriesIndex).y + property bool translate: value >= 1000 + property double translatedValue: value / (translate ? 1000 : 1) + text: qsTr("Total consumption: %1 %2").arg(translatedValue.toFixed(2)).arg(translate ? "kW" : "W") + font: Style.extraSmallFont + } + RowLayout { Rectangle { width: Style.extraSmallFont.pixelSize @@ -304,7 +312,14 @@ Item { } Label { - text: qsTr("Self production: %1 kW").arg(selfProductionUpperSeries.at(toolTip.seriesIndex).y.toFixed(2)) + // Workaround for Qt bug that lowerSeries is non-notifyable and throws warnings + Component.onCompleted: lowerSeries = selfProductionSeries.lowerSeries + property XYSeries lowerSeries: null + + property double value: selfProductionUpperSeries.at(toolTip.seriesIndex).y - lowerSeries.at(toolTip.seriesIndex).y + property bool translate: value >= 1000 + property double translatedValue: value / (translate ? 1000 : 1) + text: qsTr("Self production: %1 %2").arg(translatedValue.toFixed(2)).arg(translate ? "kW" : "W") font: Style.extraSmallFont } } @@ -316,7 +331,14 @@ Item { } Label { - text: qsTr("From battery: %1 kW").arg(storageUpperSeries.at(toolTip.seriesIndex).y.toFixed(2)) + // Workaround for Qt bug that lowerSeries is non-notifyable and throws warnings + Component.onCompleted: lowerSeries = storageSeries.lowerSeries + property XYSeries lowerSeries: null + + property double value: storageUpperSeries.at(toolTip.seriesIndex).y - lowerSeries.at(toolTip.seriesIndex).y + property bool translate: value >= 1000 + property double translatedValue: value / (translate ? 1000 : 1) + text: qsTr("From battery: %1 %2").arg(translatedValue.toFixed(2)).arg(translate ? "kW" : "W") font: Style.extraSmallFont } } @@ -328,7 +350,14 @@ Item { } Label { - text: qsTr("From grid: %1 kW").arg(acquisitionUpperSeries.at(toolTip.seriesIndex).y.toFixed(2)) + // Workaround for Qt bug that lowerSeries is non-notifyable and throws warnings + Component.onCompleted: lowerSeries = acquisitionSeries.lowerSeries + property XYSeries lowerSeries: null + + property double value: acquisitionUpperSeries.at(toolTip.seriesIndex).y - lowerSeries.at(toolTip.seriesIndex).y + property bool translate: value >= 1000 + property double translatedValue: value / (translate ? 1000 : 1) + text: qsTr("From grid: %1 %2").arg(translatedValue.toFixed(2)).arg(translate ? "kW" : "W") font: Style.extraSmallFont } } diff --git a/nymea-app/ui/mainviews/energy/PowerProductionBalanceHistory.qml b/nymea-app/ui/mainviews/energy/PowerProductionBalanceHistory.qml index 07d275fb..c6417368 100644 --- a/nymea-app/ui/mainviews/energy/PowerProductionBalanceHistory.qml +++ b/nymea-app/ui/mainviews/energy/PowerProductionBalanceHistory.qml @@ -286,15 +286,30 @@ Item { font: Style.smallFont } + Label { + property double value: acquisitionUpperSeries.at(toolTip.seriesIndex).y + property bool translate: value >= 1000 + property double translatedValue: value / (translate ? 1000 : 1) + text: qsTr("Total production: %1 %2").arg(translatedValue.toFixed(2)).arg(translate ? "kW" : "W") + font: Style.extraSmallFont + } + RowLayout { Rectangle { width: Style.extraSmallFont.pixelSize height: width - color: Style.green + color: Style.red } Label { - text: qsTr("Consumed: %1 kW").arg(selfConsumptionUpperSeries.at(toolTip.seriesIndex).y.toFixed(2)) + // Workaround for Qt bug that lowerSeries is non-notifyable and throws warnings + Component.onCompleted: lowerSeries = selfConsumptionSeries.lowerSeries + property XYSeries lowerSeries: null + + property double value: selfConsumptionUpperSeries.at(toolTip.seriesIndex).y - lowerSeries.at(toolTip.seriesIndex).y + property bool translate: value >= 1000 + property double translatedValue: value / (translate ? 1000 : 1) + text: qsTr("Consumed: %1 %2").arg(translatedValue.toFixed(2)).arg(translate ? "kW" : "W") font: Style.extraSmallFont } } @@ -306,7 +321,14 @@ Item { } Label { - text: qsTr("To battery: %1 kW").arg(storageUpperSeries.at(toolTip.seriesIndex).y.toFixed(2)) + // Workaround for Qt bug that lowerSeries is non-notifyable and throws warnings + Component.onCompleted: lowerSeries = storageSeries.lowerSeries + property XYSeries lowerSeries: null + + property double value: storageUpperSeries.at(toolTip.seriesIndex).y - lowerSeries.at(toolTip.seriesIndex).y + property bool translate: value >= 1000 + property double translatedValue: value / (translate ? 1000 : 1) + text: qsTr("To battery: %1 %2").arg(translatedValue.toFixed(2)).arg(translate ? "kW" : "W") font: Style.extraSmallFont } } @@ -314,11 +336,18 @@ Item { Rectangle { width: Style.extraSmallFont.pixelSize height: width - color: Style.red + color: Style.green } Label { - text: qsTr("To grid: %1 kW").arg(acquisitionUpperSeries.at(toolTip.seriesIndex).y.toFixed(2)) + // Workaround for Qt bug that lowerSeries is non-notifyable and throws warnings + Component.onCompleted: lowerSeries = acquisitionSeries.lowerSeries + property XYSeries lowerSeries: null + + property double value: acquisitionUpperSeries.at(toolTip.seriesIndex).y - lowerSeries.at(toolTip.seriesIndex).y + property bool translate: value >= 1000 + property double translatedValue: value / (translate ? 1000 : 1) + text: qsTr("To grid: %1 %2").arg(translatedValue.toFixed(2)).arg(translate ? "kW" : "W") font: Style.extraSmallFont } }