diff --git a/frames/lng.raw b/frames/lng.raw index 9dc84a6e..00b2b497 100644 --- a/frames/lng.raw +++ b/frames/lng.raw @@ -43,3 +43,37 @@ FF // Last byte of OBIS in previous block 0600000000 // Accumulated export 8BA4 7E + + + + +7E A1 23 CE FF 03 13 21 55 E6 E7 00 + +0F 00 00 08 E2 +0C 07 E5 07 13 01 0C 1A 0A FF 80 00 00 + +02 0B // 11 + 01 0B // 11 + 02 04 12 00 28 09 06 00 08 19 09 00 FF 0F 02 12 00 00 + 02 04 12 00 28 09 06 00 08 19 09 00 FF 0F 01 12 00 00 + 02 04 12 00 01 09 06 00 00 60 01 00 FF 0F 02 12 00 00 + 02 04 12 00 03 09 06 01 00 01 07 00 FF 0F 02 12 00 00 + 02 04 12 00 03 09 06 01 00 02 07 00 FF 0F 02 12 00 00 + 02 04 12 00 03 09 06 01 01 01 08 00 FF 0F 02 12 00 00 + 02 04 12 00 03 09 06 01 01 02 08 00 FF 0F 02 12 00 00 + 02 04 12 00 03 09 06 01 01 05 08 00 FF 0F 02 12 00 00 + 02 04 12 00 03 09 06 01 01 06 08 00 FF 0F 02 12 00 00 + 02 04 12 00 03 09 06 01 01 07 08 00 FF 0F 02 12 00 00 + 02 04 12 00 03 09 06 01 01 08 08 00 FF 0F 02 12 00 00 + 09 06 00 08 19 09 00 FF + 09 08 34 33 30 39 34 33 35 31 + 06 00 00 00 0B + 06 00 00 00 00 + 06 00 00 00 10 + 06 00 00 00 04 + 06 00 00 00 00 + 06 00 00 00 08 + 06 00 00 00 00 + 06 00 00 00 01 +7C 8B +7E \ No newline at end of file diff --git a/lib/AmsConfiguration/src/AmsConfiguration.cpp b/lib/AmsConfiguration/src/AmsConfiguration.cpp index 0d03f68c..450c7c06 100644 --- a/lib/AmsConfiguration/src/AmsConfiguration.cpp +++ b/lib/AmsConfiguration/src/AmsConfiguration.cpp @@ -517,6 +517,7 @@ bool AmsConfiguration::getEnergyAccountingConfig(EnergyAccountingConfig& config) } bool AmsConfiguration::setEnergyAccountingConfig(EnergyAccountingConfig& config) { + if(config.hours > 5) config.hours = 5; EnergyAccountingConfig existing; if(getEnergyAccountingConfig(existing)) { for(int i = 0; i < 9; i++) { @@ -525,6 +526,7 @@ bool AmsConfiguration::setEnergyAccountingConfig(EnergyAccountingConfig& config) } } config.thresholds[9] = 255; + energyAccountingChanged |= config.hours != existing.hours; } else { energyAccountingChanged = true; } @@ -741,7 +743,7 @@ bool AmsConfiguration::relocateConfig86() { } bool AmsConfiguration::relocateConfig87() { - MeterConfig87 meter87; + MeterConfig87 meter87 = {0,0,0,0,0,0,0}; MeterConfig meter; EEPROM.begin(EEPROM_SIZE); EEPROM.get(CONFIG_METER_START_87, meter87); diff --git a/lib/AmsData/include/AmsData.h b/lib/AmsData/include/AmsData.h index 3ffcd296..9445472a 100644 --- a/lib/AmsData/include/AmsData.h +++ b/lib/AmsData/include/AmsData.h @@ -12,6 +12,7 @@ enum AmsType { AmsTypeIskra = 0x08, AmsTypeLandis = 0x09, AmsTypeSagemcom = 0x0A, + AmsTypeLng = 0x0B, AmsTypeCustom = 0x88, AmsTypeUnknown = 0xFF }; @@ -53,6 +54,14 @@ public: float getL2PowerFactor(); float getL3PowerFactor(); + float getL1ActiveImportPower(); + float getL2ActiveImportPower(); + float getL3ActiveImportPower(); + + float getL1ActiveExportPower(); + float getL2ActiveExportPower(); + float getL3ActiveExportPower(); + double getActiveImportCounter(); double getReactiveImportCounter(); double getActiveExportCounter(); @@ -70,6 +79,8 @@ protected: time_t meterTimestamp = 0; uint16_t activeImportPower = 0, reactiveImportPower = 0, activeExportPower = 0, reactiveExportPower = 0; float l1voltage = 0, l2voltage = 0, l3voltage = 0, l1current = 0, l2current = 0, l3current = 0; + float l1activeImportPower = 0, l2activeImportPower = 0, l3activeImportPower = 0; + float l1activeExportPower = 0, l2activeExportPower = 0, l3activeExportPower = 0; float powerFactor = 0, l1PowerFactor = 0, l2PowerFactor = 0, l3PowerFactor = 0; double activeImportCounter = 0, reactiveImportCounter = 0, activeExportCounter = 0, reactiveExportCounter = 0; bool threePhase = false, twoPhase = false, counterEstimated = false; diff --git a/lib/AmsData/src/AmsData.cpp b/lib/AmsData/src/AmsData.cpp index f3db56e8..e6d536bf 100644 --- a/lib/AmsData/src/AmsData.cpp +++ b/lib/AmsData/src/AmsData.cpp @@ -45,6 +45,12 @@ void AmsData::apply(AmsData& other) { this->l1PowerFactor = other.getL1PowerFactor(); this->l2PowerFactor = other.getL2PowerFactor(); this->l3PowerFactor = other.getL3PowerFactor(); + this->l1activeImportPower = other.getL1ActiveImportPower(); + this->l2activeImportPower = other.getL2ActiveImportPower(); + this->l3activeImportPower = other.getL3ActiveImportPower(); + this->l1activeExportPower = other.getL1ActiveExportPower(); + this->l2activeExportPower = other.getL2ActiveExportPower(); + this->l3activeExportPower = other.getL3ActiveExportPower(); case 3: this->meterTimestamp = other.getMeterTimestamp(); this->activeImportCounter = other.getActiveImportCounter(); @@ -161,6 +167,30 @@ float AmsData::getL3PowerFactor() { return this->l3PowerFactor; } +float AmsData::getL1ActiveImportPower() { + return this->l1activeImportPower; +} + +float AmsData::getL2ActiveImportPower() { + return this->l2activeImportPower; +} + +float AmsData::getL3ActiveImportPower() { + return this->l3activeImportPower; +} + +float AmsData::getL1ActiveExportPower() { + return this->l1activeExportPower; +} + +float AmsData::getL2ActiveExportPower() { + return this->l2activeExportPower; +} + +float AmsData::getL3ActiveExportPower() { + return this->l3activeExportPower; +} + double AmsData::getActiveImportCounter() { return this->activeImportCounter; } diff --git a/lib/AmsMqttHandler/include/AmsMqttHandler.h b/lib/AmsMqttHandler/include/AmsMqttHandler.h index 3472e3f6..7aab475e 100644 --- a/lib/AmsMqttHandler/include/AmsMqttHandler.h +++ b/lib/AmsMqttHandler/include/AmsMqttHandler.h @@ -15,11 +15,12 @@ public: this->mqtt = mqtt; this->json = buf; }; + virtual ~AmsMqttHandler() {}; virtual bool publish(AmsData* data, AmsData* previousState, EnergyAccounting* ea); virtual bool publishTemperatures(AmsConfiguration*, HwTools*); virtual bool publishPrices(EntsoeApi* eapi); - virtual bool publishSystem(HwTools*); + virtual bool publishSystem(HwTools*, EntsoeApi*, EnergyAccounting*); protected: MQTTClient* mqtt; diff --git a/lib/ClassicUi/html/application.js b/lib/ClassicUi/html/application.js index 04d603d6..152bc726 100644 --- a/lib/ClassicUi/html/application.js +++ b/lib/ClassicUi/html/application.js @@ -316,6 +316,7 @@ $(function() { url: swv.data('url'), dataType: 'json' }).done(function(releases) { + var isnew = false; if(/^v\d{1,2}\.\d{1,2}\.\d{1,2}$/.test(swv.text()) && fwl.length == 0) { releases.reverse(); var next_patch; @@ -352,10 +353,13 @@ $(function() { }); if(next_minor) { nextVersion = next_minor; + isnew = true; } else if(next_major) { nextVersion = next_major; + isnew = true; } else if(next_patch) { nextVersion = next_patch; + isnew = true; } } else { nextVersion = releases[0]; @@ -375,9 +379,11 @@ $(function() { } }); }; - $('#newVersionTag').text(nextVersion.tag_name); - $('#newVersionUrl').prop('href', nextVersion.html_url); - $('#newVersion').removeClass('d-none'); + if(isnew) { + $('#newVersionTag').text(nextVersion.tag_name); + $('#newVersionUrl').prop('href', nextVersion.html_url); + $('#newVersion').removeClass('d-none'); + } } }); } @@ -884,7 +890,7 @@ var fetch = function() { var upgrade = function() { if(nextVersion) { - if(confirm("WARNING: Please keep USB power connected while upgrading. Are you sure you want to perform upgrade to " + nextVersion.tag_name + "?")) { + if(confirm("WARNING: If you have a M-BUS powered device (Pow-U), please keep USB power connected while upgrading.\n\nAre you sure you want to perform upgrade to " + nextVersion.tag_name + "?")) { $('#loading-indicator').show(); window.location.href="/upgrade?version=" + nextVersion.tag_name; } diff --git a/lib/ClassicUi/html/data.json b/lib/ClassicUi/html/data.json index 0581d6ac..a713055a 100644 --- a/lib/ClassicUi/html/data.json +++ b/lib/ClassicUi/html/data.json @@ -23,8 +23,8 @@ "v" : %.3f, "r" : %d, "t" : %.2f, - "u" : %lu, - "m" : %lu, + "u" : %u, + "m" : %u, "em" : %d, "hm" : %d, "wm" : %d, @@ -53,5 +53,5 @@ "p" : %.2f } }, - "c" : %lu + "c" : %u } \ No newline at end of file diff --git a/lib/ClassicUi/html/entsoe.html b/lib/ClassicUi/html/entsoe.html index 43b254c9..44b4847e 100644 --- a/lib/ClassicUi/html/entsoe.html +++ b/lib/ClassicUi/html/entsoe.html @@ -34,6 +34,19 @@ + + + + + + + + + + + + + diff --git a/lib/ClassicUi/html/firmware.html b/lib/ClassicUi/html/firmware.html index 0ed23db2..0bdbf086 100644 --- a/lib/ClassicUi/html/firmware.html +++ b/lib/ClassicUi/html/firmware.html @@ -1,18 +1,21 @@