Browse Source

Merge branch 'development03' of https://github.com/lumapu/ahoy into development03

pull/807/head
Markus Krause 2 years ago
parent
commit
e598865114
  1. 2
      doc/prometheus_ep_description.md
  2. 5
      src/CHANGES.md
  3. 2
      src/defines.h
  4. 2
      src/hm/hmInverter.h
  5. 17
      src/web/web.h

2
doc/prometheus_ep_description.md

@ -18,6 +18,8 @@ Prometheus metrics provided at `/metrics`.
| Metric name | Type | Description | Labels |
|----------------------------------------|---------|--------------------------------------------------------|--------------|
| `ahoy_solar_info` | Gauge | Information about the AhoyDTU device | version, image, devicename |
| `ahoy_solar_uptime` | Counter | Seconds since boot of the AhoyDTU device | devicename |
| `ahoy_solar_rssi_db` | Gauge | Quality of the Wifi STA connection | devicename |
| `ahoy_solar_inverter_info` | Gauge | Information about the configured inverter(s) | name, serial |
| `ahoy_solar_inverter_enabled` | Gauge | Is the inverter enabled? | inverter |
| `ahoy_solar_inverter_is_available` | Gauge | is the inverter available? | inverter |

5
src/CHANGES.md

@ -2,6 +2,11 @@
(starting from release version `0.5.66`)
## 0.5.107
* fix: show save message
* fix: removed serial newline for `enqueueCmd`
* Merged improved Prometheus #808
## 0.5.106
* merged MI and debug message changes #804
* fixed MQTT autodiscover #794, #632

2
src/defines.h

@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 5
#define VERSION_PATCH 106
#define VERSION_PATCH 107
//-------------------------------------
typedef struct {

2
src/hm/hmInverter.h

@ -144,7 +144,7 @@ class Inverter {
void enqueCommand(uint8_t cmd) {
_commandQueue.push(std::make_shared<T>(cmd));
DPRINT_IVID(DBG_INFO, id);
DBGPRINTLN(F("enqueCommand: 0x"));
DBGPRINT(F("enqueCommand: 0x"));
DBGHEXLN(cmd);
}

17
src/web/web.h

@ -596,7 +596,7 @@ class Web {
mApp->saveSettings((request->arg("reboot") == "on"));
AsyncWebServerResponse *response = request->beginResponse_P(200, F("text/html; charset=UTF-8"), system_html, save_html_len);
AsyncWebServerResponse *response = request->beginResponse_P(200, F("text/html; charset=UTF-8"), save_html, save_html_len);
response->addHeader(F("Content-Encoding"), "gzip");
request->send(response);
}
@ -684,8 +684,17 @@ class Web {
mApp->getVersion(), mConfig->sys.deviceName);
metrics = String(type) + String(topic);
snprintf(topic,sizeof(topic),"# TYPE ahoy_solar_freeheap gauge\nahoy_solar_freeheap{devicename=\"%s\"} %u\n",mConfig->sys.deviceName,ESP.getFreeHeap());
metrics += String(topic);
snprintf(type,sizeof(type),"# TYPE ahoy_solar_freeheap gauge\n");
snprintf(topic,sizeof(topic),"ahoy_solar_freeheap{devicename=\"%s\"} %u\n",mConfig->sys.deviceName,ESP.getFreeHeap());
metrics += String(type) + String(topic);
snprintf(type,sizeof(type),"# TYPE ahoy_solar_uptime counter\n");
snprintf(topic,sizeof(topic),"ahoy_solar_uptime{devicename=\"%s\"} %u\n", mConfig->sys.deviceName, mApp->getUptime());
metrics += String(type) + String(topic);
snprintf(type,sizeof(type),"# TYPE ahoy_solar_wifi_rssi_db gauge\n");
snprintf(topic,sizeof(topic),"ahoy_solar_wifi_rssi_db{devicename=\"%s\"} %d\n", mConfig->sys.deviceName, WiFi.RSSI());
metrics += String(type) + String(topic);
// NRF Statistics
stat = mApp->getStatistics();
@ -792,7 +801,7 @@ class Web {
String radioStatistic(String statistic, uint32_t value) {
char type[60], topic[80], val[25];
snprintf(type, sizeof(type), "# TYPE ahoy_solar_radio_%s gauge",statistic.c_str());
snprintf(type, sizeof(type), "# TYPE ahoy_solar_radio_%s counter",statistic.c_str());
snprintf(topic, sizeof(topic), "ahoy_solar_radio_%s",statistic.c_str());
snprintf(val, sizeof(val), "%d", value);
return ( String(type) + "\n" + String(topic) + " " + String(val) + "\n");

Loading…
Cancel
Save