From ca3d1da74071ad42931de29cc840b73e1c4d2306 Mon Sep 17 00:00:00 2001 From: Bernhard Kirchen Date: Wed, 8 May 2024 14:24:48 +0200 Subject: [PATCH 01/22] power meter web UI: add example for array access + translations this re-adds an example JSON path accessing an array in the JSON. also use translatable texts in the example section. --- webapp/src/locales/de.json | 5 ++++- webapp/src/locales/en.json | 5 ++++- webapp/src/views/PowerMeterAdminView.vue | 10 ++++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/webapp/src/locales/de.json b/webapp/src/locales/de.json index 2be16cef..42cf3580 100644 --- a/webapp/src/locales/de.json +++ b/webapp/src/locales/de.json @@ -569,7 +569,10 @@ "sdmaddress": "Modbus Adresse", "HTTP": "HTTP(S) + JSON - Allgemeine Konfiguration", "httpIndividualRequests": "Individuelle HTTP requests pro Phase", - "httpUrlDescription": "Die URL muss mit http:// oder https:// beginnen. Manche Zeichen wie Leerzeichen und = müssen mit URL-Kodierung kodiert werden (%xx). Achtung: Ein Überprüfung von SSL Server Zertifikaten ist nicht implementiert (MITM-Attacken sind möglich)! Beispiele gibt es unten.", + "urlExamplesHeading": "Beispiele für URLs", + "jsonPathExamplesHeading": "Beispiele für JSON Pfade", + "jsonPathExamplesExplanation": "Die folgenden Pfade finden jeweils den Wert '123.4' im jeweiligen Beispiel-JSON.", + "httpUrlDescription": "Die URL muss mit http:// oder https:// beginnen. Manche Zeichen wie Leerzeichen und = müssen mit URL-Kodierung kodiert werden (%xx). Achtung: Ein Überprüfung von SSL Server Zertifikaten ist nicht implementiert (MITM-Attacken sind möglich)!.", "httpPhase": "HTTP(S) + JSON Konfiguration - Phase {phaseNumber}", "httpEnabled": "Phase aktiviert", "httpUrl": "URL", diff --git a/webapp/src/locales/en.json b/webapp/src/locales/en.json index ebfc0a37..cf7ca77f 100644 --- a/webapp/src/locales/en.json +++ b/webapp/src/locales/en.json @@ -571,10 +571,13 @@ "sdmaddress": "Modbus Address", "HTTP": "HTTP(S) + Json - General configuration", "httpIndividualRequests": "Individual HTTP requests per phase", + "urlExamplesHeading": "URL Examples", + "jsonPathExamplesHeading": "JSON Path Examples", + "jsonPathExamplesExplanation": "The following paths each find the value '123.4' in the respective example JSON.", "httpPhase": "HTTP(S) + Json configuration - Phase {phaseNumber}", "httpEnabled": "Phase enabled", "httpUrl": "URL", - "httpUrlDescription": "URL must start with http:// or https://. Some characters like spaces and = have to be encoded with URL encoding (%xx). Warning: SSL server certificate check is not implemented (MITM attacks are possible)! See below for some examples.", + "httpUrlDescription": "URL must start with http:// or https://. Some characters like spaces and = have to be encoded with URL encoding (%xx). Warning: SSL server certificate check is not implemented (MITM attacks are possible)!", "httpAuthorization": "Authorization Type", "httpUsername": "Username", "httpPassword": "Password", diff --git a/webapp/src/views/PowerMeterAdminView.vue b/webapp/src/views/PowerMeterAdminView.vue index 6744e08f..ffe0868c 100644 --- a/webapp/src/views/PowerMeterAdminView.vue +++ b/webapp/src/views/PowerMeterAdminView.vue @@ -106,7 +106,7 @@ From edf493bc6d41880e55c17f79b6e40d59f1c798f5 Mon Sep 17 00:00:00 2001 From: Bernhard Kirchen Date: Thu, 9 May 2024 13:57:08 +0200 Subject: [PATCH 02/22] DPL web UI: add hint to setting "inverter behind power meter" --- webapp/src/locales/de.json | 3 ++- webapp/src/locales/en.json | 1 + webapp/src/locales/fr.json | 1 + webapp/src/views/PowerLimiterAdminView.vue | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/webapp/src/locales/de.json b/webapp/src/locales/de.json index 42cf3580..591259e8 100644 --- a/webapp/src/locales/de.json +++ b/webapp/src/locales/de.json @@ -631,7 +631,8 @@ "VoltageSolarPassthroughStopThreshold": "Full-Solar-Passthrough Stop-Schwellwert", "VoltageLoadCorrectionFactor": "Lastkorrekturfaktor", "BatterySocInfo": "Hinweis: Die Akku SoC (State of Charge) Werte werden nur benutzt, wenn die Batterie-Kommunikationsschnittstelle innerhalb der letzten Minute gültige Werte geschickt hat. Andernfalls werden als Fallback-Option die Spannungseinstellungen verwendet.", - "InverterIsBehindPowerMeter": "Stromzählermessung beinhaltet Wechselrichterleistung", + "InverterIsBehindPowerMeter": "Stromzählermessung beinhaltet Wechselrichter", + "InverterIsBehindPowerMeterHint": "Aktivieren falls sich der Stromzähler-Messwert um die Ausgangsleistung des Wechselrichters verringert, wenn dieser Strom produziert. Normalerweise ist das zutreffend.", "InverterIsSolarPowered": "Wechselrichter wird von Solarmodulen gespeist", "VoltageThresholds": "Batterie Spannungs-Schwellwerte ", "VoltageLoadCorrectionInfo": "Hinweis: Wenn Leistung von der Batterie abgegeben wird, bricht ihre Spannung etwas ein. Der Spannungseinbruch skaliert mit dem Entladestrom. Damit nicht vorzeitig der Wechselrichter ausgeschaltet wird sobald der Stop-Schwellenwert unterschritten wurde, wird der hier angegebene Korrekturfaktor mit einberechnet um die Spannung zu errechnen die der Akku in Ruhe hätte. Korrigierte Spannung = DC Spannung + (Aktuelle Leistung (W) * Korrekturfaktor).", diff --git a/webapp/src/locales/en.json b/webapp/src/locales/en.json index cf7ca77f..b81c6a6b 100644 --- a/webapp/src/locales/en.json +++ b/webapp/src/locales/en.json @@ -638,6 +638,7 @@ "VoltageLoadCorrectionFactor": "Load correction factor", "BatterySocInfo": "Hint: The battery SoC (State of Charge) values are only used if the battery communication interface reported SoC updates in the last minute. Otherwise the voltage thresholds will be used as fallback.", "InverterIsBehindPowerMeter": "PowerMeter reading includes inverter output", + "InverterIsBehindPowerMeterHint": "Enable this option if the power meter reading is reduced by the inverter's output when it produces power. This is typically true.", "InverterIsSolarPowered": "Inverter is powered by solar modules", "VoltageThresholds": "Battery Voltage Thresholds", "VoltageLoadCorrectionInfo": "Hint: When the battery is discharged, its voltage drops. The voltage drop scales with the discharge current. In order to not stop the inverter too early (stop threshold), this load correction factor can be specified to calculate the battery voltage if it was idle. Corrected voltage = DC Voltage + (Current power * correction factor).", diff --git a/webapp/src/locales/fr.json b/webapp/src/locales/fr.json index 972f1193..6b702e4b 100644 --- a/webapp/src/locales/fr.json +++ b/webapp/src/locales/fr.json @@ -714,6 +714,7 @@ "VoltageLoadCorrectionFactor": "Load correction factor", "BatterySocInfo": "Hint: The battery SoC (State of Charge) values are only used if the battery communication interface reported SoC updates in the last minute. Otherwise the voltage thresholds will be used as fallback.", "InverterIsBehindPowerMeter": "PowerMeter reading includes inverter output", + "InverterIsBehindPowerMeterHint": "Enable this option if the power meter reading is reduced by the inverter's output when it produces power. This is typically true.", "InverterIsSolarPowered": "Inverter is powered by solar modules", "VoltageThresholds": "Battery Voltage Thresholds", "VoltageLoadCorrectionInfo": "Hint: When the battery is discharged, its voltage drops. The voltage drop scales with the discharge current. In order to not stop the inverter too early (stop threshold), this load correction factor can be specified to calculate the battery voltage if it was idle. Corrected voltage = DC Voltage + (Current power * correction factor)." diff --git a/webapp/src/views/PowerLimiterAdminView.vue b/webapp/src/views/PowerLimiterAdminView.vue index 500614c6..e6cc0f22 100644 --- a/webapp/src/views/PowerLimiterAdminView.vue +++ b/webapp/src/views/PowerLimiterAdminView.vue @@ -102,6 +102,7 @@
From bdc9c09db24fdebcfa12cff2b1b6ee132b90b3c6 Mon Sep 17 00:00:00 2001 From: Bernhard Kirchen Date: Mon, 27 May 2024 21:44:11 +0200 Subject: [PATCH 03/22] Feature: show ESP32 flash memory size in system info --- src/WebApi_sysstatus.cpp | 1 + webapp/src/components/HardwareInfo.vue | 7 +++++++ webapp/src/locales/de.json | 5 ++++- webapp/src/locales/en.json | 5 ++++- webapp/src/locales/fr.json | 5 ++++- webapp/src/types/SystemStatus.ts | 1 + 6 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/WebApi_sysstatus.cpp b/src/WebApi_sysstatus.cpp index 5e06d0be..6d07f2fb 100644 --- a/src/WebApi_sysstatus.cpp +++ b/src/WebApi_sysstatus.cpp @@ -48,6 +48,7 @@ void WebApiSysstatusClass::onSystemStatus(AsyncWebServerRequest* request) root["chiprevision"] = ESP.getChipRevision(); root["chipmodel"] = ESP.getChipModel(); root["chipcores"] = ESP.getChipCores(); + root["flashsize"] = ESP.getFlashChipSize(); String reason; reason = ResetReason::get_reset_reason_verbose(0); diff --git a/webapp/src/components/HardwareInfo.vue b/webapp/src/components/HardwareInfo.vue index 34672132..c7f342fb 100644 --- a/webapp/src/components/HardwareInfo.vue +++ b/webapp/src/components/HardwareInfo.vue @@ -19,6 +19,13 @@ {{ $t('hardwareinfo.CpuFrequency') }} {{ systemStatus.cpufreq }} {{ $t('hardwareinfo.Mhz') }} + + {{ $t('hardwareinfo.FlashSize') }} + + {{ systemStatus.flashsize }} {{ $t('hardwareinfo.Bytes') }} + ({{ systemStatus.flashsize / 1024 / 1024 }} {{ $t('hardwareinfo.MegaBytes') }}) + +
diff --git a/webapp/src/locales/de.json b/webapp/src/locales/de.json index 591259e8..615bbc84 100644 --- a/webapp/src/locales/de.json +++ b/webapp/src/locales/de.json @@ -250,7 +250,10 @@ "ChipRevision": "Chip-Revision", "ChipCores": "Chip-Kerne", "CpuFrequency": "CPU-Frequenz", - "Mhz": "MHz" + "Mhz": "MHz", + "FlashSize": "Flash-Speichergröße", + "Bytes": "Bytes", + "MegaBytes": "MB" }, "memoryinfo": { "MemoryInformation": "Speicherinformationen", diff --git a/webapp/src/locales/en.json b/webapp/src/locales/en.json index b81c6a6b..bde25c12 100644 --- a/webapp/src/locales/en.json +++ b/webapp/src/locales/en.json @@ -251,7 +251,10 @@ "ChipRevision": "Chip Revision", "ChipCores": "Chip Cores", "CpuFrequency": "CPU Frequency", - "Mhz": "MHz" + "Mhz": "MHz", + "FlashSize": "Flash Memory Size", + "Bytes": "Bytes", + "MegaBytes": "MB" }, "memoryinfo": { "MemoryInformation": "Memory Information", diff --git a/webapp/src/locales/fr.json b/webapp/src/locales/fr.json index 6b702e4b..5e4bbca1 100644 --- a/webapp/src/locales/fr.json +++ b/webapp/src/locales/fr.json @@ -285,7 +285,10 @@ "ChipRevision": "Révision de la puce", "ChipCores": "Nombre de cœurs", "CpuFrequency": "Fréquence du CPU", - "Mhz": "MHz" + "Mhz": "MHz", + "FlashSize": "Taille de la mémoire flash", + "Bytes": "octets", + "MegaBytes": "Mo" }, "memoryinfo": { "MemoryInformation": "Informations sur la mémoire", diff --git a/webapp/src/types/SystemStatus.ts b/webapp/src/types/SystemStatus.ts index b1c59433..f9a5b70e 100644 --- a/webapp/src/types/SystemStatus.ts +++ b/webapp/src/types/SystemStatus.ts @@ -4,6 +4,7 @@ export interface SystemStatus { chiprevision: number; chipcores: number; cpufreq: number; + flashsize: number; // FirmwareInfo hostname: string; sdkversion: string; From 6ab1b41f7860f35bd8b095d6dc25ac15480b73f2 Mon Sep 17 00:00:00 2001 From: Bernhard Kirchen Date: Thu, 30 May 2024 13:52:54 +0200 Subject: [PATCH 04/22] fix: project's name is 'OpenDTU-OnBattery' (capital 'O') there were 47 matches in the repo for "OnBattery", but only 17 for "onBattery". Also, the repo's name on github uses a capital 'O'. --- README.md | 22 +++++++++++----------- README_onBattery.md | 6 +++--- docs/DeviceProfiles.md | 2 +- webapp/index.html | 2 +- webapp/src/components/NavBar.vue | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 45677b55..fc89e62c 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,23 @@ -- [OpenDTU-onBattery](#opendtu-onbattery) - - [What is OpenDTU-onBattery](#what-is-opendtu-onbattery) +- [OpenDTU-OnBattery](#opendtu-onbattery) + - [What is OpenDTU-OnBattery](#what-is-opendtu-onbattery) - [History of the project](#history-of-the-project) - - [Highlights of OpenDTU-onBattery](#highlights-of-opendtu-onbattery) + - [Highlights of OpenDTU-OnBattery](#highlights-of-opendtu-onbattery) - [Documentation](#documentation) - [Acknowledgment](#acknowledgment) -# OpenDTU-onBattery +# OpenDTU-OnBattery This is a fork from the Hoymiles project [OpenDTU](https://github.com/tbnobody/OpenDTU). ![GitHub tag (latest SemVer)](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/helgeerbe/68b47cc8c8994d04ab3a4fa9d8aee5e6/raw/openDTUcoreRelease.json) -[![OpenDTU-onBattery Build](https://github.com/helgeerbe/OpenDTU-OnBattery/actions/workflows/build.yml/badge.svg)](https://github.com/helgeerbe/OpenDTU-OnBattery/actions/workflows/build.yml) +[![OpenDTU-OnBattery Build](https://github.com/helgeerbe/OpenDTU-OnBattery/actions/workflows/build.yml/badge.svg)](https://github.com/helgeerbe/OpenDTU-OnBattery/actions/workflows/build.yml) [![cpplint](https://github.com/helgeerbe/OpenDTU-OnBattery/actions/workflows/cpplint.yml/badge.svg)](https://github.com/helgeerbe/OpenDTU-OnBattery/actions/workflows/cpplint.yml) [![Yarn Linting](https://github.com/helgeerbe/OpenDTU-OnBattery/actions/workflows/yarnlint.yml/badge.svg)](https://github.com/helgeerbe/OpenDTU-OnBattery/actions/workflows/yarnlint.yml) -## What is OpenDTU-onBattery +## What is OpenDTU-OnBattery -OpenDTU-onBattery is an extension of the original OpenDTU to support battery chargers, battery management systems (BMS) and power meters on a single esp32. With the help of a dynamic power limiter, the power production can be adjusted to the actual consumption. In this way, it is possible to come as close as possible to the goal of zero feed-in. +OpenDTU-OnBattery is an extension of the original OpenDTU to support battery chargers, battery management systems (BMS) and power meters on a single esp32. With the help of a dynamic power limiter, the power production can be adjusted to the actual consumption. In this way, it is possible to come as close as possible to the goal of zero feed-in. ## History of the project @@ -25,7 +25,7 @@ The original OpenDTU project was started from [this](https://www.mikrocontroller Summer 2022 I bought my Victron MPPT battery charger, and didn't like the idea to set up a separate esp32 to recieve the charger data. I decided to fork OpenDTU and extend it with battery charger support and a dynamic power limitter to my own needs. Hoping someone can make use of it. -## Highlights of OpenDTU-onBattery +## Highlights of OpenDTU-OnBattery This project is still under development and adds following features: @@ -40,11 +40,11 @@ This project is still under development and adds following features: ## Documentation -[Full documentation of OpenDTU-onBattery extensions can be found at the project's wiki](https://github.com/helgeerbe/OpenDTU-OnBattery/wiki). +[Full documentation of OpenDTU-OnBattery extensions can be found at the project's wiki](https://github.com/helgeerbe/OpenDTU-OnBattery/wiki). For documentation of openDTU core functionality I refer to the original [repo](https://github.com/tbnobody/OpenDTU) and its [documentation](https://tbnobody.github.io/OpenDTU-docs/). -Please note that openDTU-onBattery may change significantly during its development. +Please note that openDTU-OnBattery may change significantly during its development. Bug reports, comments, feature requests and fixes are most welcome! To find out what's new or improved have a look at the [changelog](https://github.com/helgeerbe/OpenDTU-OnBattery/releases). @@ -53,4 +53,4 @@ To find out what's new or improved have a look at the [changelog](https://github A special Thank to Thomas Basler (tbnobody) the author of the original [OpenDTU](https://github.com/tbnobody/OpenDTU) project. You are doing a great job! -Last but not least, I would like to thank all the contributors. With your ideas and enhancements, you have made OpenDTU-onBattery much more than I originally had in mind. +Last but not least, I would like to thank all the contributors. With your ideas and enhancements, you have made OpenDTU-OnBattery much more than I originally had in mind. diff --git a/README_onBattery.md b/README_onBattery.md index 3f484c5c..e1489af6 100644 --- a/README_onBattery.md +++ b/README_onBattery.md @@ -6,7 +6,7 @@ This is a fork from the Hoymiles project [OpenDTU](https://github.com/tbnobody/O > **Warning** > -> In contrast to the original openDTU, with release 2023.05.23.post1 openDTU-onBattery supports only 5 inverters. Otherwise, there is not enough memory for the liveData view. +> In contrast to the original openDTU, with release 2023.05.23.post1 openDTU-OnBattery supports only 5 inverters. Otherwise, there is not enough memory for the liveData view. ## Features @@ -106,7 +106,7 @@ Some points for consideration are: #### Operation modes -openDTU-onBattery supports three operation modes for the Huawei PSU: +openDTU-OnBattery supports three operation modes for the Huawei PSU: 1. Fully manual - In this mode the PSU needs to be turned on/off externally using MQTT and voltage and current limits need to be provided. See [MQTT Documentation](docs/MQTT_Topics.md) for details on these commands 2. Manual with auto power on / off - In this mode the PSU is turned on when a current limit > 1A is set. If the current limit is < 1A for some time the PSU is turned off. Current and voltage limits need to be provided externally using MQTT. See [MQTT Documentation](docs/MQTT_Topics.md) for details on these commands. 3. Automatic - In this mode the PSU power is controlled by the Power Meter and information provided in the web-interface. If excess power is present the PSU is turned on. The voltage limit is set as per web-interface and the current limit is set so that the maximum PSU output power equals the Power Meter value. Minium and maximum PSU power levels as configured in the web-interface are respected in this process. The PSU is turned off if the output current is limited and the output power drops below the minium power level. This will disable automatic mode until the battery is discharged below the start voltage level (set in the web-interface). This mode can be enabled using the web-interface and MQTT. See [MQTT Documentation](docs/MQTT_Topics.md) @@ -135,7 +135,7 @@ It was the goal to replace the original Hoymiles DTU (Telemetry Gateway) with th ### Status -[![OpenDTU-onBattery Build](https://github.com/helgeerbe/OpenDTU-OnBattery/actions/workflows/build.yml/badge.svg)](https://github.com/helgeerbe/OpenDTU-OnBattery/actions/workflows/build.yml) +[![OpenDTU-OnBattery Build](https://github.com/helgeerbe/OpenDTU-OnBattery/actions/workflows/build.yml/badge.svg)](https://github.com/helgeerbe/OpenDTU-OnBattery/actions/workflows/build.yml) [![cpplint](https://github.com/helgeerbe/OpenDTU-OnBattery/actions/workflows/cpplint.yml/badge.svg)](https://github.com/helgeerbe/OpenDTU-OnBattery/actions/workflows/cpplint.yml) [![Yarn Linting](https://github.com/helgeerbe/OpenDTU-OnBattery/actions/workflows/yarnlint.yml/badge.svg)](https://github.com/helgeerbe/OpenDTU-OnBattery/actions/workflows/yarnlint.yml) diff --git a/docs/DeviceProfiles.md b/docs/DeviceProfiles.md index 3444acc6..b149239e 100644 --- a/docs/DeviceProfiles.md +++ b/docs/DeviceProfiles.md @@ -2,7 +2,7 @@ This documentation will has been moved and can be found here: -## Structure of the json file for openDTU-onBattery (outdated example) +## Structure of the json file for openDTU-OnBattery (outdated example) ```json [ diff --git a/webapp/index.html b/webapp/index.html index 47122be1..bbb68b54 100644 --- a/webapp/index.html +++ b/webapp/index.html @@ -7,7 +7,7 @@ - OpenDTU-onBattery + OpenDTU-OnBattery