переименование модулей

This commit is contained in:
Dmitry Borisenko
2022-09-26 20:26:04 +02:00
parent b5b56fe00e
commit 909e28c36a
18 changed files with 638 additions and 470 deletions

View File

@@ -0,0 +1,93 @@
#include "Global.h"
#include "classes/IoTItem.h"
#include "PZEMSensor.h"
#include "SoftUART.h"
#include <map>
// std::map<String, Adafruit_Pzem004*> bmes;
//
// class Pzem004t : public IoTItem {
// private:
// Adafruit_Pzem004* _bme;
//
// public:
// Pzem004t(Adafruit_Pzem004* bme, String parameters) : IoTItem(parameters) {
// _bme = bme;
// }
//
// void doByInterval() {
// value.valD = _bme->readTemperature();
// if (value.valD < 145)
// regEvent(value.valD, "Pzem004t");
// else
// SerialPrint("E", "Sensor Pzem004t", "Error");
// }
//
// ~Pzem004t(){};
// };
//
// class Pzem004h : public IoTItem {
// private:
// Adafruit_Pzem004* _bme;
//
// public:
// Pzem004h(Adafruit_Pzem004* bme, String parameters) : IoTItem(parameters) {
// _bme = bme;
// }
//
// void doByInterval() {
// value.valD = _bme->readHumidity();
// if (value.valD < 100)
// regEvent(value.valD, "Pzem004h");
// else
// SerialPrint("E", "Sensor Pzem004h", "Error");
// }
//
// ~Pzem004h(){};
// };
//
// class Pzem004p : public IoTItem {
// private:
// Adafruit_Pzem004* _bme;
//
// public:
// Pzem004p(Adafruit_Pzem004* bme, String parameters) : IoTItem(parameters) {
// _bme = bme;
// }
//
// void doByInterval() {
// value.valD = _bme->readPressure();
// if (value.valD > 0) {
// value.valD = value.valD / 1.333224 / 100;
// regEvent(value.valD, "Pzem004p");
// } else
// SerialPrint("E", "Sensor Pzem004p", "Error");
// }
//
// ~Pzem004p(){};
// };
//
// void* getAPI_Pzem004(String subtype, String param) {
// if (subtype == F("Pzem004t") || subtype == F("Pzem004h") || subtype == F("Pzem004p")) {
// String addr;
// jsonRead(param, "addr", addr);
//
// if (bmes.find(addr) == bmes.end()) {
// bmes[addr] = new Adafruit_Pzem004();
// bmes[addr]->begin(hexStringToUint8(addr));
// }
//
// if (subtype == F("Pzem004t")) {
// return new Pzem004t(bmes[addr], param);
// } else if (subtype == F("Pzem004h")) {
// return new Pzem004h(bmes[addr], param);
// } else if (subtype == F("Pzem004p")) {
// return new Pzem004p(bmes[addr], param);
// }
// }
//
// return nullptr;
// }

View File

@@ -0,0 +1,68 @@
{
"menuSection": "Сенсоры",
"configItem": [
{
"name": "Cенсор температуры Bme280",
"type": "Reading",
"subtype": "Bme280t",
"id": "tmp3",
"widget": "anydataTmp",
"page": "Сенсоры",
"descr": "Температура",
"int": 15,
"addr": "0x77",
"round": 1
},
{
"name": "Cенсор давления Bme280",
"type": "Reading",
"subtype": "Bme280p",
"id": "Press3",
"widget": "anydataMm",
"page": "Сенсоры",
"descr": "Давление",
"int": 15,
"addr": "0x77",
"round": 1
},
{
"name": "Cенсор влажности Bme280",
"type": "Reading",
"subtype": "Bme280h",
"id": "Hum3",
"widget": "anydataHum",
"page": "Сенсоры",
"descr": "Влажность",
"int": 15,
"addr": "0x77",
"round": 1
}
],
"about": {
"authorName": "Dmitry Borisenko",
"authorContact": "https://t.me/Dmitry_Borisenko",
"authorGit": "https://github.com/DmitryBorisenko33",
"specialThanks": "Serghei Crasnicov @Serghei63",
"moduleName": "Bme280",
"moduleVersion": "1.0",
"usedRam": 15,
"subTypes": [
"Pzem004v",
"Pzem004a",
"Pzem004w",
"Pzem004hz",
"Pzem004wh"
],
"title": "Счетчик электроэнергии PZEM 004t версии 3.0 (с модбасом)",
"moduleDesc": "Считает потраченную электроэнергию, измеряет напряжение, частоту, силу тока и прочие параметры",
"propInfo": {
"addr": "Адрес modbus",
"int": "Количество секунд между опросами датчика"
}
},
"defActive": false,
"devices": {
"esp32_4mb": [],
"esp8266_4mb": []
}
}