From bbae504e614935be9d41bc4e7ad432f22b46f60b Mon Sep 17 00:00:00 2001 From: Andreas Schiffler Date: Sun, 4 Sep 2022 15:04:48 +0200 Subject: [PATCH 1/9] add yield total/day to overview for 1ch --- tools/esp8266/hmDefines.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/esp8266/hmDefines.h b/tools/esp8266/hmDefines.h index 6330db98c..28615ed71 100644 --- a/tools/esp8266/hmDefines.h +++ b/tools/esp8266/hmDefines.h @@ -126,6 +126,8 @@ const byteAssign_t hm1chAssignment[] = { { FLD_F, UNIT_HZ, CH0, 16, 2, 100 }, { FLD_T, UNIT_C, CH0, 26, 2, 10 }, { FLD_ALARM_MES_ID, UNIT_NONE, CH0, 28, 2, 1 }, + { FLD_YD, UNIT_WH, CH0, CALC_YD_CH0, 0, CMD_CALC }, + { FLD_YT, UNIT_KWH, CH0, CALC_YT_CH0, 0, CMD_CALC }, { FLD_PDC, UNIT_W, CH0, CALC_PDC_CH0, 0, CMD_CALC }, { FLD_EFF, UNIT_PCT, CH0, CALC_EFF_CH0, 0, CMD_CALC } }; From b1311e797c0431fa72c89295b8acb5f17f627d43 Mon Sep 17 00:00:00 2001 From: Andreas Schiffler Date: Sun, 4 Sep 2022 15:07:18 +0200 Subject: [PATCH 2/9] fix in dev compile action --- .github/workflows/compile_development.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compile_development.yml b/.github/workflows/compile_development.yml index 838293b4a..64c05bfdf 100644 --- a/.github/workflows/compile_development.yml +++ b/.github/workflows/compile_development.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@v3 with: - ref: development02 + ref: development03 - uses: benjlevesque/short-sha@v1.2 id: short-sha with: From f89c6e06a36bf3724eccd79c53b6d7ddfcc88373 Mon Sep 17 00:00:00 2001 From: "Sandner, Denny" Date: Sun, 4 Sep 2022 18:37:18 +0200 Subject: [PATCH 3/9] add General overview for several inverters --- tools/esp8266/html/style.css | 22 +++++++++++++--- tools/esp8266/web.cpp | 49 ++++++++++++++++++++++++++++++++++-- 2 files changed, 65 insertions(+), 6 deletions(-) diff --git a/tools/esp8266/html/style.css b/tools/esp8266/html/style.css index 8ce9c570c..f15f1cf1b 100644 --- a/tools/esp8266/html/style.css +++ b/tools/esp8266/html/style.css @@ -182,7 +182,16 @@ div.ch { padding-bottom: 20px; } -div.ch .value, div.ch .info, div.ch .head, div.ch-iv .value, div.ch-iv .info, div.ch-iv .head { +div.ch-all { + width: 100%; + background-color: #b06e04; + display: inline-block; + margin-bottom: 15px; + padding-bottom: 20px; + overflow: auto; +} + +div.ch .value, div.ch .info, div.ch .head, div.ch-iv .value, div.ch-iv .info, div.ch-iv .head, div.ch-all .value, div.ch-all .info, div.ch-all .head { color: #fff; display: block; width: 100%; @@ -194,17 +203,17 @@ div.ch .value, div.ch .info, div.ch .head, div.ch-iv .value, div.ch-iv .info, di width: 220px; } -div.ch .unit, div.ch-iv .unit { +div.ch .unit, div.ch-iv .unit, div.ch-all .unit { font-size: 19px; margin-left: 10px; } -div.ch .value, div.ch-iv .value { +div.ch .value, div.ch-iv .value, div.ch-all .value { margin-top: 20px; font-size: 24px; } -div.ch .info, div.ch-iv .info { +div.ch .info, div.ch-iv .info, div.ch-all .info { margin-top: 3px; font-size: 10px; } @@ -214,6 +223,11 @@ div.ch .head { padding: 10px 0 10px 0; } +div.ch-all .head { + background-color: #8e5903; + padding: 10px 0 10px 0; +} + div.ch-iv .head { background-color: #1c6800; padding: 10px 0 10px 0; diff --git a/tools/esp8266/web.cpp b/tools/esp8266/web.cpp index 1bd12af59..563cb635b 100644 --- a/tools/esp8266/web.cpp +++ b/tools/esp8266/web.cpp @@ -437,8 +437,13 @@ void web::showVisualization(void) { void web::showLiveData(void) { DPRINTLN(DBG_VERBOSE, F("web::showLiveData")); - String modHtml; + String modHtml, totalModHtml; + float totalYield = 0, totalYieldToday = 0, totalActual = 0; + uint8_t count = 0; + for (uint8_t id = 0; id < mMain->mSys->getNumInverters(); id++) { + count++; + Inverter<> *iv = mMain->mSys->getInverterByPos(id); if (NULL != iv) { #ifdef LIVEDATA_VISUALIZED @@ -462,6 +467,19 @@ void web::showLiveData(void) { for (uint8_t fld = 0; fld < 11; fld++) { pos = (iv->getPosByChFld(CH0, list[fld])); + + if(fld == 6){ + totalYield += iv->getValue(pos); + } + + if(fld == 7){ + totalYieldToday += iv->getValue(pos); + } + + if(fld == 2){ + totalActual += iv->getValue(pos); + } + if (0xff != pos) { modHtml += F("
"); modHtml += F("") + String(iv->getValue(pos)); @@ -513,7 +531,34 @@ void web::showLiveData(void) { } } - mWeb->send(200, F("text/html"), modHtml); + if(count > 1){ + totalModHtml += F("
" + "
Gesamt"); + + totalModHtml += F("
"); + totalModHtml += F("") + String(totalActual); + totalModHtml += F("W"); + totalModHtml += F("P_AC All"); + totalModHtml += F("
"); + + totalModHtml += F("
"); + totalModHtml += F("") + String(totalYieldToday); + totalModHtml += F("Wh"); + totalModHtml += F("YieldDayAll"); + totalModHtml += F("
"); + + totalModHtml += F("
"); + totalModHtml += F("") + String(totalYield); + totalModHtml += F("kWh"); + totalModHtml += F("YieldTotalAll"); + totalModHtml += F("
"); + + totalModHtml += F("
"); + totalModHtml += F("
"); + mWeb->send(200, F("text/html"), totalModHtml + modHtml); + } else { + mWeb->send(200, F("text/html"), modHtml); + } } From 84ed32a05ac2b1b9fb6c77606dd13f5b8820f8d8 Mon Sep 17 00:00:00 2001 From: thfcm Date: Sun, 4 Sep 2022 21:47:40 +0200 Subject: [PATCH 4/9] Added some additional hints --- tools/esp8266/config.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tools/esp8266/config.h b/tools/esp8266/config.h index ab633f9af..25d8769d3 100644 --- a/tools/esp8266/config.h +++ b/tools/esp8266/config.h @@ -6,21 +6,30 @@ #ifndef __CONFIG_H__ #define __CONFIG_H__ -// fallback WiFi info + +//------------------------------------- +// WIFI CONFIGURATION +//------------------------------------- + +// Fallback WiFi Info #define FB_WIFI_SSID "YOUR_WIFI_SSID" #define FB_WIFI_PWD "YOUR_WIFI_PWD" -// access point info +// Access Point Info +// In case there is no WiFi Network or Ahoy can not connect to it, it will act as an Access Point + #define WIFI_AP_SSID "AHOY-DTU" #define WIFI_AP_PWD "esp_8266" -// stay in access point mode all the time + +// If the next line is uncommented, Ahoy will stay in access point mode all the time //#define AP_ONLY //------------------------------------- // CONFIGURATION - COMPILE TIME //------------------------------------- + // time in seconds how long the station info (ssid + pwd) will be tried #define WIFI_TRY_CONNECT_TIME 30 @@ -31,7 +40,7 @@ // default device name #define DEF_DEVICE_NAME "AHOY-DTU" -// default pinout +// default pinout (GPIO Number) #define DEF_RF24_CS_PIN 15 #define DEF_RF24_CE_PIN 2 #define DEF_RF24_IRQ_PIN 0 From 77b706a1ce936787f61d6d93bf7995be622cc0ec Mon Sep 17 00:00:00 2001 From: thfcm Date: Sun, 4 Sep 2022 21:51:46 +0200 Subject: [PATCH 5/9] Set default NTP Port to 123 --- tools/esp8266/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/esp8266/config.h b/tools/esp8266/config.h index 25d8769d3..bfbfeb863 100644 --- a/tools/esp8266/config.h +++ b/tools/esp8266/config.h @@ -85,7 +85,7 @@ #define DEF_NTP_SERVER_NAME "pool.ntp.org" // default NTP server port -#define DEF_NTP_PORT 8888 +#define DEF_NTP_PORT 123 // NTP refresh interval in ms (default 12h) #define NTP_REFRESH_INTERVAL 12 * 3600 * 1000 From 03a6b87cc1d889d6082c0b4e088d530f8990f914 Mon Sep 17 00:00:00 2001 From: Andreas Schiffler Date: Mon, 5 Sep 2022 08:53:41 +0200 Subject: [PATCH 6/9] fix in parser for 1CH inverters --- tools/esp8266/hmDefines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/esp8266/hmDefines.h b/tools/esp8266/hmDefines.h index 28615ed71..baec0f75d 100644 --- a/tools/esp8266/hmDefines.h +++ b/tools/esp8266/hmDefines.h @@ -125,7 +125,7 @@ const byteAssign_t hm1chAssignment[] = { { FLD_PRA, UNIT_VA, CH0, 20, 2, 10 }, { FLD_F, UNIT_HZ, CH0, 16, 2, 100 }, { FLD_T, UNIT_C, CH0, 26, 2, 10 }, - { FLD_ALARM_MES_ID, UNIT_NONE, CH0, 28, 2, 1 }, + { FLD_ALARM_MES_ID, UNIT_NONE, CH0, 24, 2, 1 }, { FLD_YD, UNIT_WH, CH0, CALC_YD_CH0, 0, CMD_CALC }, { FLD_YT, UNIT_KWH, CH0, CALC_YT_CH0, 0, CMD_CALC }, { FLD_PDC, UNIT_W, CH0, CALC_PDC_CH0, 0, CMD_CALC }, From 0ae56efb2f2b8dade6c1d3f062aa3c697ace8847 Mon Sep 17 00:00:00 2001 From: Andreas Schiffler Date: Mon, 5 Sep 2022 09:01:38 +0200 Subject: [PATCH 7/9] Build Dev-Version 0.5.17 --- tools/esp8266/defines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/esp8266/defines.h b/tools/esp8266/defines.h index 33732ff5f..210604a59 100644 --- a/tools/esp8266/defines.h +++ b/tools/esp8266/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 5 -#define VERSION_PATCH 16 +#define VERSION_PATCH 17 //------------------------------------- From 6be2b0979ffd5ff549263f71668c7c66fd105d25 Mon Sep 17 00:00:00 2001 From: Andreas Schiffler Date: Mon, 5 Sep 2022 20:07:48 +0200 Subject: [PATCH 8/9] speed up set power limit --- tools/esp8266/app.cpp | 9 ++++++++- tools/esp8266/app.h | 1 + tools/esp8266/hmInverter.h | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tools/esp8266/app.cpp b/tools/esp8266/app.cpp index 1394876cf..7c4fa9013 100644 --- a/tools/esp8266/app.cpp +++ b/tools/esp8266/app.cpp @@ -89,6 +89,7 @@ void app::loop(void) { if(0 != len) { Inverter<> *iv = mSys->findInverter(&p->packet[1]); if(NULL != iv && p->packet[0] == (TX_REQ_INFO + 0x80)) { // response from get information command + mPayload[iv->id].txId = p->packet[0]; DPRINTLN(DBG_DEBUG, F("Response from info request received")); uint8_t *pid = &p->packet[9]; if (*pid == 0x00) @@ -115,6 +116,7 @@ void app::loop(void) { } } if(NULL != iv && p->packet[0] == (TX_REQ_DEVCONTROL + 0x80)) { // response from dev control command + mPayload[iv->id].txId = p->packet[0]; DPRINTLN(DBG_DEBUG, F("Response from devcontrol request received")); iv->devControlRequest = false; switch (p->packet[12]) { @@ -248,6 +250,7 @@ void app::loop(void) { if(mConfig.serialDebug) DPRINTLN(DBG_INFO, F("Devcontrol request ") + String(iv->devControlCmd) + F(" power limit ") + String(iv->powerLimit[0])); mSys->Radio.sendControlPacket(iv->radioId.u64, iv->devControlCmd ,iv->powerLimit); + iv->clearCmdQueue(); iv->enqueCommand(SystemConfigPara); } else { mSys->Radio.sendTimePacket(iv->radioId.u64,iv->getQueuedCmd(), mPayload[iv->id].ts,iv->alarmMesIndex); @@ -306,7 +309,11 @@ void app::processPayload(bool retransmit) { for(uint8_t id = 0; id < mSys->getNumInverters(); id++) { Inverter<> *iv = mSys->getInverterByPos(id); if(NULL != iv) { - if(!mPayload[iv->id].complete) { + if(mPayload[iv->id].txId != (TX_REQ_INFO + 0x80)) { + // no processing needed if txId is not 0x95 + mPayload[iv->id].complete = true; + } + if(!mPayload[iv->id].complete ) { if(!buildPayload(iv->id)) { if(mPayload[iv->id].requested) { if(retransmit) { diff --git a/tools/esp8266/app.h b/tools/esp8266/app.h index 4accf7d09..a2738a1a4 100644 --- a/tools/esp8266/app.h +++ b/tools/esp8266/app.h @@ -45,6 +45,7 @@ const char* const pinArgNames[] = {"pinCs", "pinCe", "pinIrq"}; typedef struct { + uint8_t txId; uint8_t invId; uint32_t ts; uint8_t data[MAX_PAYLOAD_ENTRIES][MAX_RF_PAYLOAD_SIZE]; diff --git a/tools/esp8266/hmInverter.h b/tools/esp8266/hmInverter.h index fd2eafeee..fa8c557e8 100644 --- a/tools/esp8266/hmInverter.h +++ b/tools/esp8266/hmInverter.h @@ -149,6 +149,12 @@ class Inverter { } } + void clearCmdQueue(){ + while (!_commandQueue.empty()){ + // Will destroy CommandAbstract Class Object (?) + _commandQueue.pop(); + } + } uint8_t getQueuedCmd() { if (_commandQueue.empty()){ From c9a9a630934ccda757ace195d6c096cab5779e07 Mon Sep 17 00:00:00 2001 From: Andreas Schiffler Date: Tue, 6 Sep 2022 09:05:27 +0200 Subject: [PATCH 9/9] documentation and service release --- tools/esp8266/CHANGES.md | 91 ++---------------------------------- tools/esp8266/User_Manual.md | 65 +++++++++++++++++++++++++- 2 files changed, 69 insertions(+), 87 deletions(-) diff --git a/tools/esp8266/CHANGES.md b/tools/esp8266/CHANGES.md index 5b047ae94..85cd7aeab 100644 --- a/tools/esp8266/CHANGES.md +++ b/tools/esp8266/CHANGES.md @@ -1,88 +1,7 @@ # Changelog -- v0.5.16 - * Add alarm messages dictonary in the hminverter class - * show last alarm message in the overview after receiving the message id from the AlarmData command - * Added No-PowerLimit function/setting (thx @lumapu) - * Bug fix #195 trailing and leading spaces in setup parameters (thx @lumapu) - * Added parametric CAD model for a case (thx @cubinet-code) - * Code styling improvements (eg. dynamic creation of html code) (thx @stefan123t, @lumapu) - * Mqtt publish action is now after successful parse a payload, no own ticker - * Fixes/improvements #183, #184, #216, #213, #196, #176, #171 -- v0.5.15 - * Bug fix: mqtt payload handling (thx @klahus1, silverserver) - * Bug fix: eeprom alignment fixed (thx @klahus1) - * mqtt reconnect improvements (thx @tastendruecker123 , @HorstG-57 ) - * simple command scheduler (one place fifo) - * InverterDevInform_All Command parser and output to mqtt - * New workflow to build github release - * Introduction of a command queue (like OpenDTU) - * Feedback from inverter for actual power limit via InfoCmd -> SystemConfigPara (0x05) placed in visualization - * REST API will enqueue a new info command (all commands supported) - * Change in power limit will (Setup, MQTT or REST API) enqueues a new infocmd request to get actual power limit - * Actual power limit is available under MQTT topic //ch0/PowerLimit ALWAYS in percent - * Firmware information will be requested automatically up on start of dtu - * Added User_Manual.md - -- v0.5.14 -- v0.5.13 -- v0.5.12 -- v0.5.11 -- v0.5.10 -- v0.5.9 *fix PowerLimit PowerPFDev.Desc=0x0001 for permanent -- v0.5.8 *fix #146 device name in setup -- v0.5.7 *add collapsible setup -- v0.5.6 *fix only MQTT sub after the first loop in a conenction -- v0.5.5 *fixed MQTT sub only after connection is established (HorstG-57) - + added in app.cpp some compiler if statements - *fix: compile possible for non repository versions (if project was download as zip - lumapu) - *fix README.md - Update line 69 (`RF24` 1.4.2 -> 1.4.5) (DanielR92) - *Update hmRadio.h (lumapu) -- v0.5.4 + added Github report text with a URL (aschiffler) - + added auto_firmware_version.py for GIT_HASH - + added switch case AlarmData/AlarmUpdate -- v0.5.3 #Bugfix #125 PowerLimit - + prototype webapi to get info, improved pwr limit (aschiffler) - + Merge remote-tracking branch 'upstream/main' into pwrlimit -- v0.5.2 add #114 ntp_server_name and port to eeprom - + stefan123t added some functions (devcontrol/cbMqtt/...) -- v0.5.1 *Merge branch 'upstream/HEAD' into control - *update revision (0.4.26 -> 0.5.1) -- v0.4.26 first poc for power set via mqtt -- v0.4.25 added default SERIAL/MQTT/SEND_INTERVAL #100, fixed env:node_mcu_v2 build #101 -- v0.4.24 added fixes for #63, #88, #93. revert #36 (*) EEPROM changes -- v0.4.23 added workflow, fix index.html to load inverter info immediately, changed timestamp to 1 for stand alone ESP #90, Implement MQTT discovery for Home Assistant -- v0.4.22 compiles with PlatformIO -- v0.4.21 reduced warnings -- v0.4.20 improved setup (if no data is in EEprom), improved NRF24 Pinout regarding to #36, Standard Pinout should be now: #36 (comment), add JSON output, fix favicon, improve eeprom default settings (*) EEPROM changes -- v0.4.19 updated debug messages: now 5 different levels are available, fixed CRC loop issue, add fritzing/schematics for Arduino, Raspberry Pi and NodeMCU -- v0.4.18 Creative Commons NC-SA-BY v3.0 license included, tried to increase stability, fix NRF24 CRClength, add debug & documentation links, added variable error messages using #pragma error -- v0.4.17 add printed circuit board layout, more debug output (#retransmits), improved loop counters (*) EEPROM changes -- v0.4.16 request only one inverter per loop (#53 (comment)), mqtt loop interval calculated by # of inverters and inverter request interval, limit maximum number of retries, added feature request #62 (readable names for channels), improved setup page, added javascript to hide / show channel fields (*) EEPROM changes -- v0.4.15 reduced debug messages, fixes after merge -- v0.4.14 added RX channel 40, improved RF24 ISR, reduced AP active time to 60s (will be increase once a client is connected), added `yield` without success -> random reboot (cause 4) (*) EEPROM changes -- v0.4.13 rename to AHOY-DTU, add RX channel 40, update stats on index based on mSendInterval, MQTT Interval, EEPROM CRC settings, fix #56 v0.4.10 ESP8266 stuck in boot loop -- v0.4.12 version skipped ? -- v0.4.11 inverter dependent mqtt (is avail), implemented heap stats #58, inserted 'break' in ISR while loop -- v0.4.10 reduced heap size (>50%) by using 'F()' for (nearly) all static strings, added Wemos D1 case STL files -- v0.4.9 try to fix mqtt and wifi loss issue #52, document libraries (*) EEPROM changes -- v0.4.8 moved mqtt loop out of checkTicker as mentioned in #49, added irritation and efficiency calculations, improved style (*) EEPROM changes -- v0.4.7 version skipped ? -- v0.4.6 version skipped ? -- v0.4.5 fix #38 4-channel inverter current assignment, added last received timestamp in /hoymiles livedata web page #47, improved style.css, improved NTP as described in #46 -- v0.4.4 added free heap, mentioned in #24 (added in serial print, status on index and mqtt), fixed #45, AC current by factor 10 too high, fixed failed payload counter -- v0.4.3 fixed #41 HM800 Yield total and Yield day were mixed around. Found issue while comparing to Python version, fixed #43 HM350 channel 2 is displayed in Live-View, added #42 YieldTotal and YieldTotal Day for HM600 - HM800 inverters -- v0.4.2 fix #39 Assignment 2-Channel inverters (HM-600, HM-700, HM-800) -- v0.4.1 multi inverter support, full re transmit included -- v0.4.0 complete payload processed (and crc checked), inverter type is defined by serial number, serial debug can be switched live (using setup), Note: only one inverter is supported for now! -- v0.3.9 fix #26 ticker / interval in app.cpp -- v0.3.8 improved stability (in comparison to 0.3.7), reset wifi AP timout once a client is detected, fix #26 wrong variable reset -- v0.3.7 added rx channel switching, switched to crc8 check for valid packet-payload -- v0.3.6 improved tickers, only one ticker is active, added feature to use the ESP as access point for all the time, added serial features to setup -- v0.3.5 fixed erase settings, fixed behavior if no MQTT IP is set (the system was nearly unusable because of delayed responses), fixed Station / AP WiFi on startup -> more information will be printed to the serial console, added new ticker for serial value dump -- v0.3.4 added config.h for general configuration, added option to compile WiFi SSID + PWD to firmware, added option to configure WiFi access point name and password, added feature to retry connect to station WiFi (configurable timeouts), updated index.html, added option for factory reset, added info about project on index.html, moved "update" and "home" to footer, fixed #23 HM1200 yield day unit, fixed DNS name of ESP after setup (some commits before) -- v0.3.3 converted to "poor-man-ticker" using millis() for uptime, send and mqtt, added inverter overview, added send count to statistics -- v0.3.2 compile of merge, binary published on https://www.mikrocontroller.net/topic/525778?goto=7051413#7051413 -- v0.3.1 fix: doCalculations was not called -- v0.3.0 version 0.3.0, added unit test -(*) EEPROM changes require settings to be changed, your settings will be overwritten and need to be set again! +- v0.5.17 + * Bug fix for 1 channel inverters (HM300, HM400) see #246 + * Bug fix for read back the active power limit from inverter #243 (before version 0.5.16 the reported limit was just a copy of the user set point, now it is the actual value which the inverter uses) + * Update the [user manual](https://github.com/grindylow/ahoy/blob/main/tools/esp8266/User_Manual.md); added section aobut the published data on mqtt; section about zero export control; added section about code implementation command queue + * Added tx-Id number to packet payload struct. (eg. can be 0x95 or 0xD1) --> less messages fails and faster handling of changing power limit diff --git a/tools/esp8266/User_Manual.md b/tools/esp8266/User_Manual.md index 7de5822dd..7e9ef5058 100644 --- a/tools/esp8266/User_Manual.md +++ b/tools/esp8266/User_Manual.md @@ -9,6 +9,42 @@ In the initial case or after click "erase settings" the fields for the inverter Set at least the serial number and a name for each inverter, check the "reboot after save" and click the "Save" button. +## MQTT Output +The ahoy dtu will publish on the following topics +``//ch0/#`` +| Topic | Example Value | Remarks | +|---|---|---| +|U_AC | 233.300|actual AC Voltage in Volt| +|I_AC | 0.300 | actual AC Current in Ampere| +|P_AC | 71.000| actual AC Power in Watt| +|P_ACr | 21.200| actual AC reactive power in VAr| +|Freq | 49.990|actual AC Frequency in 1/s| +|Pct | 95.800|actual AC Power factor in %| +|Temp | 19.800|Temperature of inverter in Celsius| +|LARM_MES_ID | 9.000|Last Alarm Message Id| +|YieldDay | 51.000|Energy converted to AC per day in Watt hours (measured on DC)| +|YieldTotal | 465.294|Energy converted to AC since reset Watt hours (measured on DC)| +|P_DC | 74.600|actual DC Power in Watt| +|Efficiency | 95.174|actual ration AC Power over DC Power in percent| +|FWVersion | 10012.000| Firmware version eg. 1.00.12| +|FWBuildYear | 2020.000| Firmware build date| +|FWBuildMonthDay | 624.000| Firmware build month and day eg. 24th of june| +|HWPartId | 100.000| Hardware Id| +|PowerLimit | 80.000|actual set point for power limit control AC active power in percent| +|LastAlarmCode | 1.000| Last Alarm Code eg. "inverter start"| + +``//ch/#`` + +```` is in the range 1 to 4 depending on the inverter type +| Topic | Example Value | Remarks | +|---|---|---| +|U_DC | 38.900| actual DC Voltage in Volt| +|I_DC | 0.640 | actual DC current in Ampere| +|P_DC | 25.000 | actual DC power in Watt| +|YieldDay | 17.000 | Energy converted to AC per day Watt hours per module/channel (measured on DC) | +|YieldTotal | 110.819 | Energy converted to AC since reset Watt hours per module/channel (measured on DC) | +|Irradiation |5.65 | ratio DC Power over set maximum power per module/channel in percent | + ## Active Power Limit via Setup Page If you leave the field "Active Power Limit" empty during the setup and reboot the ahoy-dtu will set a value of 65535 in the setup. That is the value you have to fill in case you want to operate the inverter without a active power limit. @@ -39,6 +75,12 @@ To set the active power limit (controled value is the AC Power of the inverter) | /devcontrol//11/1 | [2...100] | % | not persistent | /devcontrol//11/257 | [2...100] | % | persistent +๐Ÿ‘† ```` is the number of the specific inverter in the setup page. + +* First inverter --> ```` = 0 +* Second inverter --> ```` = 1 +* ... + ### Developer Information MQTT Interface ``/devcontrol///`` @@ -143,6 +185,10 @@ In the same approach as for MQTT any other SubCmd and also MainCmd can be applie } ``` +## Zero Export Control +* You can use the mqtt topic ``/devcontrol//11`` with a number as payload (eg. 300 -> 300 Watt) to set the power limit to the published number in Watt. (In regular cases the inverter will use the new set point within one intervall period; to verify this see next bullet) +* You can check the inverter set point for the power limit control on the topic ``//ch0/PowerLimit`` ๐Ÿ‘† This value is ALWAYS in percent of the maximum power limit of the inverter. In regular cases this value will be updated within approx. 15 seconds. (depends on request intervall) +* You can monitor the actual AC power by subscribing to the topic ``//ch0/P_AC`` ๐Ÿ‘† This value is ALWAYS in Watt ## Issues and Debuging for active power limit settings Turn on the serial debugging in the setup. Try to have find out if the behavior is deterministic. That means can you reproduce the behavior. Be patient and wait on inverter reactions at least some minutes and beware that the DC-Power is sufficient. @@ -154,7 +200,9 @@ In case of issues please report: **Developer Information General for Active Power Limit** -โšกWas verified by field tests and feedback from three users + +โšกThe following was verified by field tests and feedback from users + Internally this values will be set for the second two bytes for MainCmd: 0x51 SubCmd: 0x0b --> DevControl set ActivePowerLimit ```C typedef enum { @@ -181,3 +229,18 @@ Gather user inverter information here to understand what differs between some in | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +## Developer Information about Command Queue +After reboot or startup the ahoy firmware it will enque three commands in the following sequence: +1. Get active power limit in percent ( ```SystemConfigPara = 5 // 0x05```) +2. Get firmware version (```InverterDevInform_All = 1 // 0x01```) +3. Get data (```RealTimeRunData_Debug = 11 // 0x0b```) + +With the command get data (```RealTimeRunData_Debug = 11 // 0x0b```) the alarm message counter will be updated. In the initial case then aonther command is queued to get the alarm code (``` AlarmData = 17 // 0x11```). + +This command (``` AlarmData = 17 // 0x11```) will enqued in any operation phase if alarm message counter is raised by one or greater compared to the last request with command get data (```RealTimeRunData_Debug = 11 // 0x0b```) + +In case all commands are processed (```_commandQueue.empty() == true```) then as a default command the get data (```RealTimeRunData_Debug = 11 // 0x0b```) will be enqueued. + +In case a Device Control command (Power Limit, Off, On) is requested via MQTT or REST API this request will be send before any other enqueued command. +In case of a accepted change in power limit the command get active power limit in percent ( ```SystemConfigPara = 5 // 0x05```) will be enqueued. The acceptance is checked by the reponse packets on the devive control commands (tx id 0x51 --> rx id 0xD1) if in byte 12 the requested sub-command (eg. power limit) is present. \ No newline at end of file