Browse Source

0.8.130

* add timestamp to JSON output #1707
* restart Ahoy using MqTT #1667
pull/1692/merge
lumapu 2 months ago
parent
commit
24ceb3e97e
  1. 2
      src/CHANGES.md
  2. 7
      src/publisher/pubMqtt.h
  3. 1
      src/publisher/pubMqttIvData.h
  4. 2
      src/web/RestApi.h

2
src/CHANGES.md

@ -5,6 +5,8 @@
* merge PR: Power limit command accelerated #1704
* merge PR: reduce update cycle of ePaper from 5 to 10 seconds #1706
* merge PR: small fixes in different files #1711
* add timestamp to JSON output #1707
* restart Ahoy using MqTT #1667
## 0.8.129 - 2024-07-11
* sort alarms ascending #1471

7
src/publisher/pubMqtt.h

@ -285,6 +285,9 @@ class PubMqtt {
tickerMinute();
publish(mLwtTopic.data(), mqttStr[MQTT_STR_LWT_CONN], true, false);
snprintf(mVal.data(), mVal.size(), "ctrl/restart_ahoy");
subscribe(mVal.data());
for(uint8_t i = 0; i < MAX_NUM_INVERTERS; i++) {
snprintf(mVal.data(), mVal.size(), "ctrl/limit/%d", i);
subscribe(mVal.data(), QOS_2);
@ -386,9 +389,9 @@ class PubMqtt {
pos++;
}
/*char out[128];
char out[128];
serializeJson(root, out, 128);
DPRINTLN(DBG_INFO, "json: " + String(out));*/
DPRINTLN(DBG_INFO, "json: " + String(out));
(mSubscriptionCb)(root);
mRxCnt++;

1
src/publisher/pubMqttIvData.h

@ -231,6 +231,7 @@ class PubMqttIvData {
publish = true;
if (publish) {
doc[F("ts")] = rec->ts;
// if next channel or end->publish
serializeJson(doc, mVal.data(), mVal.size());
snprintf(mSubTopic.data(), mSubTopic.size(), "%s/ch%d", mIv->config->name, rec->assign[mPos].ch);

2
src/web/RestApi.h

@ -1072,6 +1072,8 @@ class RestApi {
} else if(F("dev") == jsonIn[F("cmd")]) {
DPRINTLN(DBG_INFO, F("dev cmd"));
iv->setDevCommand(jsonIn[F("val")].as<int>());
} else if(F("restart_ahoy") == jsonIn[F("cmd")]) {
mApp->setRebootFlag();
} else {
jsonOut[F("error")] = F("ERR_UNKNOWN_CMD");
return false;

Loading…
Cancel
Save