mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
.
This commit is contained in:
@@ -14,12 +14,16 @@ class Pzem004v : public IoTItem {
|
||||
public:
|
||||
Pzem004v(String parameters) : IoTItem(parameters) {
|
||||
addr = jsonReadStr(parameters, "addr");
|
||||
pzem = new PZEMSensor(myUART, hexStringToUint8(addr));
|
||||
if (myUART) {
|
||||
pzem = new PZEMSensor(myUART, hexStringToUint8(addr));
|
||||
}
|
||||
}
|
||||
|
||||
void doByInterval() {
|
||||
value.valD = pzem->values()->voltage;
|
||||
regEvent(value.valD, "Pzem Voltage");
|
||||
if (pzem) {
|
||||
value.valD = pzem->values()->voltage;
|
||||
regEvent(value.valD, "Pzem Voltage");
|
||||
}
|
||||
}
|
||||
|
||||
~Pzem004v(){};
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
"name": "PZEM 004t Мощность",
|
||||
"type": "Reading",
|
||||
"subtype": "Pzem004w",
|
||||
"id": "A",
|
||||
"id": "W",
|
||||
"widget": "anydataWt",
|
||||
"page": "Сенсоры",
|
||||
"descr": "Мощность",
|
||||
|
||||
Reference in New Issue
Block a user