* fixed timestamp for alarms send over MqTT
* auto-patch of `AsyncWebServer` #834, #1036
* Update documentation in Git regarding `ESP8266` default NRF24 pin assignments
This commit is contained in:
lumapu 2023-08-18 00:23:40 +02:00
parent ac53925a24
commit ed268d1b63
7 changed files with 54 additions and 9 deletions

View file

@ -1,5 +1,10 @@
# Development Changes
## 0.7.35 - 2023-08-17
* fixed timestamp for alarms send over MqTT
* auto-patch of `AsyncWebServer` #834, #1036
* Update documentation in Git regarding `ESP8266` default NRF24 pin assignments
## 0.7.34 - 2023-08-16
* fixed timezone offset of alarms
* added `AC` and `DC` to `/live` #1098

View file

@ -21,6 +21,7 @@ monitor_speed = 115200
extra_scripts =
pre:../scripts/auto_firmware_version.py
pre:web/html/convert.py
pre:../scripts/applyPatches.py
lib_deps =
https://github.com/yubox-node-org/ESPAsyncWebServer
@ -183,4 +184,4 @@ build_flags =
-std=gnu++17
build_unflags = -std=gnu++11
monitor_filters =
time ; Add timestamp with milliseconds for each new line
time ; Add timestamp with milliseconds for each new line

View file

@ -500,6 +500,8 @@ class PubMqtt {
void sendAlarmData() {
Inverter<> *iv;
uint32_t localTime = gTimezone.toLocal(*mUtcTimestamp);
uint32_t lastMidnight = gTimezone.toUTC(localTime - (localTime % 86400)); // last midnight local time
for(uint8_t i = 0; i < MAX_NUM_INVERTERS; i++) {
if(!mSendAlarm[i])
continue;
@ -527,11 +529,11 @@ class PubMqtt {
publish(mSubTopic, mVal, true);
snprintf(mSubTopic, 32 + MAX_NAME_LENGTH, "%s/alarm/%d/start", iv->config->name, j);
snprintf(mVal, 40, "%d", iv->lastAlarm[j].start);
snprintf(mVal, 40, "%d", iv->lastAlarm[j].start + lastMidnight);
publish(mSubTopic, mVal, true);
snprintf(mSubTopic, 32 + MAX_NAME_LENGTH, "%s/alarm/%d/end", iv->config->name, j);
snprintf(mVal, 40, "%d", iv->lastAlarm[j].end);
snprintf(mVal, 40, "%d", iv->lastAlarm[j].end + lastMidnight);
publish(mSubTopic, mVal, true);
yield();
}