Browse Source

0.8.1030017

pull/1647/head
Patrick Amrhein 8 months ago
parent
commit
768e0d47bd
  1. 2
      src/defines.h
  2. 21
      src/plugins/zeroExport/powermeter.h
  3. 20
      src/plugins/zeroExport/zeroExport.h

2
src/defines.h

@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 8
#define VERSION_PATCH 1030016
#define VERSION_PATCH 1030017
//-------------------------------------
typedef struct {
uint8_t ch;

21
src/plugins/zeroExport/powermeter.h

@ -115,15 +115,15 @@ class powermeter {
#endif
}
// if (mMqtt->isConnected()) mMqtt->publish(String("zero/state/groups/" + String(group) + "/result").c_str(), String(ret).c_str(), false);
if (result) {
bufferWrite(power, group);
// MQTT - Powermeter
/// BUG: 002 Anfang - Muss dieser Teil raus? Führt er zu abstürzen wie BUG 001?
if (mMqtt->isConnected()) {
mMqtt->publish(String("zero/state/groups/" + String(group) + "/powermeter/P").c_str(), String(ah::round1(power)).c_str(), false);
}
/// BUG: 002 Ende
}
}
}
@ -218,6 +218,7 @@ class powermeter {
float power = 0.0;
/// TODO: Json aktivieren
// //TODO: datajson 100 enough?
// // this if-statement need to check if value contains a json object.
// // is it so, then deserialize it and get the values (Shelly GEN2)
@ -232,19 +233,19 @@ class powermeter {
// }
// } else {
// //TODO: check if parse is possible here? Is that right?
power = (uint16_t)obj["val"];
power = (float)obj["val"];
// }
bufferWrite(power, group);
// MQTT - Powermeter
if (mCfg->debug) {
if (mMqtt->isConnected()) {
mMqtt->publish(String("zero/state/groups/" + String(group) + "/powermeter/P").c_str(), String(ah::round1(power)).c_str(), false);
}
}
return;
/// BUG: 001 Anfang - Dieser Teil ist deaktiviert weil er zu abstürzen der DTU führt
// if (mCfg->debug) {
// if (mMqtt->isConnected()) {
// mMqtt->publish(String("zero/state/groups/" + String(group) + "/powermeter/P").c_str(), String(ah::round1(power)).c_str(), false);
// }
// }
/// BUG: 001 Ende
}
#endif /*defined(ZEROEXPORT_POWERMETER_MQTT)*/

20
src/plugins/zeroExport/zeroExport.h

@ -345,9 +345,11 @@ class ZeroExport {
sendLog();
// MQTT - Powermeter
if (mMqtt->isConnected()) {
mqttPublish(String("zero/state/groups/" + String(group) + "/inverter/" + String(inv)).c_str(), mDocLog.as<std::string>().c_str());
}
/// BUG: 003 Anfang
// if (mMqtt->isConnected()) {
// mqttPublish(String("zero/state/groups/" + String(group) + "/inverter/" + String(inv)).c_str(), mDocLog.as<std::string>().c_str());
// }
/// BUG: 003 Ende
clearLog();
@ -821,11 +823,13 @@ class ZeroExport {
}
// Log over MQTT
if (mCfg->log_over_mqtt) {
if (mMqtt->isConnected()) {
mMqtt->publish("zero/log", mDocLog.as<std::string>().c_str(), false);
}
}
/// BUG: 004 Anfang
// if (mCfg->log_over_mqtt) {
// if (mMqtt->isConnected()) {
// mMqtt->publish("zero/log", mDocLog.as<std::string>().c_str(), false);
// }
// }
/// BUG: 004 Ende
}
/** clearLog

Loading…
Cancel
Save