mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
Полностью добавлен модуль PZEM 004 t
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
"name": "anydataWth",
|
||||
"label": "Энергия",
|
||||
"widget": "anydata",
|
||||
"after": "Wt/hr",
|
||||
"after": "Wt/Hr",
|
||||
"icon": "speedometer"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -96,7 +96,7 @@ void IoTItem::regEvent(String value, String consoleInfo = "") {
|
||||
publishStatusMqtt(_id, value);
|
||||
|
||||
publishStatusWs(_id, value);
|
||||
SerialPrint("i", "Sensor " + consoleInfo, "'" + _id + "' data: " + value + "'");
|
||||
SerialPrint("i", "Sensor", consoleInfo + " '" + _id + "' data: " + value + "'");
|
||||
|
||||
// проверка если global установлен то шлем всем о событии
|
||||
// if (_global) {
|
||||
@@ -150,8 +150,6 @@ bool IoTItem::isGpioDriver() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//сетевое общение====================================================================================================================================
|
||||
|
||||
externalVariable::externalVariable(String parameters) : IoTItem(parameters) {
|
||||
|
||||
@@ -25,6 +25,7 @@ class Pzem004v : public IoTItem {
|
||||
if (online) {
|
||||
regEvent(value.valD, "Pzem V");
|
||||
} else {
|
||||
regEvent(NAN, "Pzem V");
|
||||
SerialPrint("E", "Pzem", "V error");
|
||||
}
|
||||
}
|
||||
@@ -53,6 +54,7 @@ class Pzem004a : public IoTItem {
|
||||
if (online) {
|
||||
regEvent(value.valD, "Pzem A");
|
||||
} else {
|
||||
regEvent(NAN, "Pzem A");
|
||||
SerialPrint("E", "Pzem", "A error");
|
||||
}
|
||||
}
|
||||
@@ -81,6 +83,7 @@ class Pzem004w : public IoTItem {
|
||||
if (online) {
|
||||
regEvent(value.valD, "Pzem W");
|
||||
} else {
|
||||
regEvent(NAN, "Pzem W");
|
||||
SerialPrint("E", "Pzem", "W error");
|
||||
}
|
||||
}
|
||||
@@ -109,6 +112,7 @@ class Pzem004wh : public IoTItem {
|
||||
if (online) {
|
||||
regEvent(value.valD, "Pzem Wh");
|
||||
} else {
|
||||
regEvent(NAN, "Pzem Wh");
|
||||
SerialPrint("E", "Pzem", "Wh error");
|
||||
}
|
||||
}
|
||||
@@ -137,6 +141,7 @@ class Pzem004hz : public IoTItem {
|
||||
if (online) {
|
||||
regEvent(value.valD, "Pzem Hz");
|
||||
} else {
|
||||
regEvent(NAN, "Pzem Hz");
|
||||
SerialPrint("E", "Pzem", "Hz error");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user