diff --git a/lib/AmsConfiguration/src/AmsConfiguration.cpp b/lib/AmsConfiguration/src/AmsConfiguration.cpp index ab09b497..b102da5a 100644 --- a/lib/AmsConfiguration/src/AmsConfiguration.cpp +++ b/lib/AmsConfiguration/src/AmsConfiguration.cpp @@ -582,7 +582,6 @@ void AmsConfiguration::clear() { strcpy(sys.country, ""); EEPROM.put(CONFIG_SYSTEM_START, sys); - MeterConfig meter; clearMeter(meter); EEPROM.put(CONFIG_METER_START, meter); @@ -615,6 +614,10 @@ void AmsConfiguration::clear() { clearEnergyAccountingConfig(eac); EEPROM.put(CONFIG_ENERGYACCOUNTING_START, eac); + DebugConfig debug; + clearDebug(debug); + EEPROM.put(CONFIG_DEBUG_START, debug); + EEPROM.put(EEPROM_CONFIG_ADDRESS, EEPROM_CLEARED_INDICATOR); EEPROM.commit(); EEPROM.end(); diff --git a/lib/HwTools/src/HwTools.cpp b/lib/HwTools/src/HwTools.cpp index fc185fab..4c5e3328 100644 --- a/lib/HwTools/src/HwTools.cpp +++ b/lib/HwTools/src/HwTools.cpp @@ -371,9 +371,9 @@ bool HwTools::ledOff(uint8_t color) { bool HwTools::ledBlink(uint8_t color, uint8_t blink) { for(int i = 0; i < blink; i++) { if(!ledOn(color)) return false; - delay(50); + delay(75); ledOff(color); - delay(200); + delay(75); } return true; } diff --git a/lib/SvelteUi/app/index.html b/lib/SvelteUi/app/index.html index 4a138bae..a11cc552 100644 --- a/lib/SvelteUi/app/index.html +++ b/lib/SvelteUi/app/index.html @@ -3,6 +3,7 @@ + AMS reader diff --git a/lib/SvelteUi/app/src/lib/AccountingData.svelte b/lib/SvelteUi/app/src/lib/AccountingData.svelte index 6b85bf86..ac4b911e 100644 --- a/lib/SvelteUi/app/src/lib/AccountingData.svelte +++ b/lib/SvelteUi/app/src/lib/AccountingData.svelte @@ -1,33 +1,52 @@
Real time calculation -
+
Hour
-
{data && data.h && data.h.u ? data.h.u.toFixed(2) : '-'} kWh
-
Day
-
{data && data.d && data.d.u ? data.d.u.toFixed(1) : '-'} kWh
-
Month
-
{data && data.m && data.m.u ? data.m.u.toFixed(0) : '-'} kWh
+
{data && data.h && data.h.u ? data.h.u.toFixed(2) : '-'} kWh {#if currency && (hasExport)}/ {data && data.h && data.h.c ? data.h.c.toFixed(2) : '-'} {currency}{/if}
- {#if currency} -
+
+
Day
+
{data && data.d && data.d.u ? data.d.u.toFixed(1) : '-'} kWh {#if currency && (hasExport)}/ {data && data.d && data.d.c ? data.d.c.toFixed(2) : '-'} {currency}{/if}
+
+
+
Month
+
{data && data.m && data.m.u ? data.m.u.toFixed(0) : '-'} kWh {#if currency && (hasExport)}/ {data && data.m && data.m.c ? data.m.c.toFixed(2) : '-'} {currency}{/if}
+
+
+ {#if hasExport} +
Hour
-
{data && data.h && data.h.c ? data.h.c.toFixed(2) : '-'} {currency}
+
{data && data.h && data.h.p ? data.h.p.toFixed(2) : '-'} kWh {#if currency}/ {data && data.h && data.h.pc ? data.h.pc.toFixed(2) : '-'} {currency}{/if}
+
+
Day
-
{data && data.d && data.d.c ? data.d.c.toFixed(1) : '-'} {currency}
+
{data && data.d && data.d.p ? data.d.p.toFixed(1) : '-'} kWh {#if currency}/ {data && data.d && data.d.pc ? data.d.pc.toFixed(2) : '-'} {currency}{/if}
+
+
Month
-
{data && data.m && data.m.c ? data.m.c.toFixed(0) : '-'} {currency}
+
{data && data.m && data.m.p ? data.m.p.toFixed(0) : '-'} kWh {#if currency}/ {data && data.m && data.m.pc ? data.m.pc.toFixed(2) : '-'} {currency}{/if}
- {/if} -
-
Max
-
- {data && data.x ? data.x.toFixed(1) : '-'} / {data && data.t ? data.t.toFixed(1) : '-'} kWh + {:else} +
+
Hour
+
{data && data.h && data.h.c ? data.h.c.toFixed(2) : '-'} {currency}
+
+
Day
+
{data && data.d && data.d.c ? data.d.c.toFixed(2) : '-'} {currency}
+
+
+
Month
+
{data && data.m && data.m.c ? data.m.c.toFixed(2) : '-'} {currency}
+
+ {/if}
\ No newline at end of file diff --git a/lib/SvelteUi/app/src/lib/BarChart.svelte b/lib/SvelteUi/app/src/lib/BarChart.svelte index 1d279983..6be10fae 100644 --- a/lib/SvelteUi/app/src/lib/BarChart.svelte +++ b/lib/SvelteUi/app/src/lib/BarChart.svelte @@ -19,10 +19,9 @@ return (i*barWidth)+config.padding.left; }; yScale = function(i) { - if(!i) return heightAvailable-config.padding.bottom; if(i > config.y.max) return heightAvailable; let ret = heightAvailable-config.padding.bottom-((i-config.y.min)*yPerUnit); - return ret > heightAvailable || ret < 0 ? 0 : ret; + return ret > heightAvailable || ret < 0.0 ? 0.0 : ret; }; }; @@ -35,9 +34,9 @@ {#each config.y.ticks as tick} - + - {tick.label} + {tick.label} {/each} @@ -53,13 +52,15 @@ {#each config.points as point, i} + {#if point.value !== undefined} + {point.label} + {/if} + {#if point.value2 > 0.0001} + + + {point.label2} + {/if} {/each} @@ -106,6 +127,22 @@ stroke-dasharray: 0; } + .tick.tick-green line { + stroke: #32d900 !important; + } + + .tick.tick-green text { + fill: #32d900 !important; + } + + .tick.tick-orange line { + stroke: #d95600 !important; + } + + .tick.tick-orange text { + fill: #d95600 !important; + } + .x-axis .tick text { text-anchor: middle; } diff --git a/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte b/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte index 744d16c9..c69f928e 100644 --- a/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte +++ b/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte @@ -1,11 +1,10 @@ +Provided by ENTSO-E diff --git a/lib/SvelteUi/app/src/lib/SetupPanel.svelte b/lib/SvelteUi/app/src/lib/SetupPanel.svelte index bbc0739a..6f7713e7 100644 --- a/lib/SvelteUi/app/src/lib/SetupPanel.svelte +++ b/lib/SvelteUi/app/src/lib/SetupPanel.svelte @@ -109,8 +109,8 @@
{/if}
-
- Read more +
+ Read more
diff --git a/lib/SvelteUi/app/src/lib/StatusPage.svelte b/lib/SvelteUi/app/src/lib/StatusPage.svelte index 2d7f6d94..cf842279 100644 --- a/lib/SvelteUi/app/src/lib/StatusPage.svelte +++ b/lib/SvelteUi/app/src/lib/StatusPage.svelte @@ -28,6 +28,24 @@ } } + async function reboot() { + const response = await fetch('/reboot', { + method: 'POST' + }); + let res = (await response.json()) + } + + const askReboot = function() { + if(confirm('Are you sure you want to reboot the device?')) { + sysinfoStore.update(s => { + s.booting = true; + return s; + }); + reboot(); + } + } + + let fileinput; getSysinfo(); @@ -42,7 +60,13 @@
Device: {boardtype(sysinfo.chip, sysinfo.board)}
-
+
+ MAC: {sysinfo.mac} +
+
+ +
+
{#if sysinfo.meter}
Meter @@ -79,6 +103,7 @@
Installed version: {sysinfo.version}
+ {#if nextVersion}
Latest version: {nextVersion.tag_name} @@ -90,9 +115,10 @@
{#if sysinfo.fwconsent === 2}
-
You have not consented to OTA firmware upgrade, link to self-upgrade is disabled
+
You have disabled one-click firmware upgrade, link to self-upgrade is disabled
{/if} + {/if} {#if sysinfo.board == 2 || sysinfo.board == 4 || sysinfo.board == 7 }
{boardtype(sysinfo.chip, sysinfo.board)} must be connected to an external power supply during firmware upgrade. Failure to do so may cause power-down during upload resulting in non-functioning unit. @@ -102,7 +128,7 @@
{#if fileinput && fileinput.files.length == 0} - + {:else if fileinput} {fileinput.files[0].name} diff --git a/lib/SvelteUi/app/src/lib/TariffPeakChart.svelte b/lib/SvelteUi/app/src/lib/TariffPeakChart.svelte new file mode 100644 index 00000000..da039149 --- /dev/null +++ b/lib/SvelteUi/app/src/lib/TariffPeakChart.svelte @@ -0,0 +1,86 @@ + + + diff --git a/lib/SvelteUi/app/src/lib/VendorPanel.svelte b/lib/SvelteUi/app/src/lib/VendorPanel.svelte index bf3e719f..d3801879 100644 --- a/lib/SvelteUi/app/src/lib/VendorPanel.svelte +++ b/lib/SvelteUi/app/src/lib/VendorPanel.svelte @@ -35,7 +35,7 @@
- Vendor configuration + Initial configuration
Board type