Merge pull request #259 from IoTManagerProject/ver4dev

Ver4dev
This commit is contained in:
2023-01-30 14:30:16 +03:00
committed by GitHub
21 changed files with 804 additions and 144 deletions

View File

@@ -162,7 +162,21 @@
}, },
{ {
"global": 0, "global": 0,
"name": "11. Виртуальная кнопка", "name": "11. Цветной текст",
"type": "Reading",
"subtype": "VariableColor",
"id": "color",
"needSave": 0,
"widget": "anydataDef",
"page": "Вывод",
"descr": "Цветной текст",
"val": "...",
"round": 0,
"num": 11
},
{
"global": 0,
"name": "12. Виртуальная кнопка",
"type": "Reading", "type": "Reading",
"subtype": "VButton", "subtype": "VButton",
"id": "vbtn", "id": "vbtn",
@@ -172,13 +186,13 @@
"descr": "Кнопка", "descr": "Кнопка",
"int": "0", "int": "0",
"val": "0", "val": "0",
"num": 11 "num": 12
}, },
{ {
"header": "Сенсоры" "header": "Сенсоры"
}, },
{ {
"name": "12. Acs712 Ток", "name": "13. Acs712 Ток",
"type": "Reading", "type": "Reading",
"subtype": "Acs712", "subtype": "Acs712",
"id": "amp", "id": "amp",
@@ -188,11 +202,11 @@
"round": 3, "round": 3,
"pin": 39, "pin": 39,
"int": 5, "int": 5,
"num": 12 "num": 13
}, },
{ {
"global": 0, "global": 0,
"name": "13. AHTXX Температура", "name": "14. AHTXX Температура",
"type": "Reading", "type": "Reading",
"subtype": "AhtXXt", "subtype": "AhtXXt",
"id": "Temp20", "id": "Temp20",
@@ -203,11 +217,11 @@
"addr": "0x38", "addr": "0x38",
"shtType": 1, "shtType": 1,
"round": 1, "round": 1,
"num": 13 "num": 14
}, },
{ {
"global": 0, "global": 0,
"name": "14. AHTXX Влажность", "name": "15. AHTXX Влажность",
"type": "Reading", "type": "Reading",
"subtype": "AhtXXh", "subtype": "AhtXXh",
"id": "Hum20", "id": "Hum20",
@@ -218,11 +232,11 @@
"addr": "0x38", "addr": "0x38",
"shtType": 1, "shtType": 1,
"round": 1, "round": 1,
"num": 14 "num": 15
}, },
{ {
"global": 0, "global": 0,
"name": "15. Аналоговый сенсор", "name": "16. Аналоговый сенсор",
"type": "Reading", "type": "Reading",
"subtype": "AnalogAdc", "subtype": "AnalogAdc",
"id": "t", "id": "t",
@@ -236,11 +250,11 @@
"pin": 0, "pin": 0,
"int": 15, "int": 15,
"avgSteps": 1, "avgSteps": 1,
"num": 15 "num": 16
}, },
{ {
"global": 0, "global": 0,
"name": "16. BME280 Температура", "name": "17. BME280 Температура",
"type": "Reading", "type": "Reading",
"subtype": "Bme280t", "subtype": "Bme280t",
"id": "tmp3", "id": "tmp3",
@@ -250,11 +264,11 @@
"int": 15, "int": 15,
"addr": "0x77", "addr": "0x77",
"round": 1, "round": 1,
"num": 16 "num": 17
}, },
{ {
"global": 0, "global": 0,
"name": "17. BME280 Давление", "name": "18. BME280 Давление",
"type": "Reading", "type": "Reading",
"subtype": "Bme280p", "subtype": "Bme280p",
"id": "Press3", "id": "Press3",
@@ -264,11 +278,11 @@
"int": 15, "int": 15,
"addr": "0x77", "addr": "0x77",
"round": 1, "round": 1,
"num": 17 "num": 18
}, },
{ {
"global": 0, "global": 0,
"name": "18. BME280 Влажность", "name": "19. BME280 Влажность",
"type": "Reading", "type": "Reading",
"subtype": "Bme280h", "subtype": "Bme280h",
"id": "Hum3", "id": "Hum3",
@@ -278,11 +292,11 @@
"int": 15, "int": 15,
"addr": "0x77", "addr": "0x77",
"round": 1, "round": 1,
"num": 18 "num": 19
}, },
{ {
"global": 0, "global": 0,
"name": "19. BMP280 Температура", "name": "20. BMP280 Температура",
"type": "Reading", "type": "Reading",
"subtype": "Bmp280t", "subtype": "Bmp280t",
"id": "tmp3", "id": "tmp3",
@@ -292,11 +306,11 @@
"int": 15, "int": 15,
"addr": "0x77", "addr": "0x77",
"round": 1, "round": 1,
"num": 19 "num": 20
}, },
{ {
"global": 0, "global": 0,
"name": "20. BMP280 Давление", "name": "21. BMP280 Давление",
"type": "Reading", "type": "Reading",
"subtype": "Bmp280p", "subtype": "Bmp280p",
"id": "Press3", "id": "Press3",
@@ -306,11 +320,11 @@
"int": 15, "int": 15,
"addr": "0x77", "addr": "0x77",
"round": 1, "round": 1,
"num": 20 "num": 21
}, },
{ {
"global": 0, "global": 0,
"name": "21. DHT11 Температура", "name": "22. DHT11 Температура",
"type": "Reading", "type": "Reading",
"subtype": "Dht1122t", "subtype": "Dht1122t",
"id": "tmp3", "id": "tmp3",
@@ -320,11 +334,11 @@
"int": 15, "int": 15,
"pin": 0, "pin": 0,
"senstype": "dht11", "senstype": "dht11",
"num": 21 "num": 22
}, },
{ {
"global": 0, "global": 0,
"name": "22. DHT11 Влажность", "name": "23. DHT11 Влажность",
"type": "Reading", "type": "Reading",
"subtype": "Dht1122h", "subtype": "Dht1122h",
"id": "Hum3", "id": "Hum3",
@@ -334,11 +348,11 @@
"int": 15, "int": 15,
"pin": 0, "pin": 0,
"senstype": "dht11", "senstype": "dht11",
"num": 22 "num": 23
}, },
{ {
"global": 0, "global": 0,
"name": "23. DS18B20 Температура", "name": "24. DS18B20 Температура",
"type": "Reading", "type": "Reading",
"subtype": "Ds18b20", "subtype": "Ds18b20",
"id": "dstmp", "id": "dstmp",
@@ -350,11 +364,11 @@
"index": 0, "index": 0,
"addr": "", "addr": "",
"round": 1, "round": 1,
"num": 23 "num": 24
}, },
{ {
"global": 0, "global": 0,
"name": "24. PZEM 004t Напряжение", "name": "25. PZEM 004t Напряжение",
"type": "Reading", "type": "Reading",
"subtype": "Pzem004v", "subtype": "Pzem004v",
"id": "v", "id": "v",
@@ -364,11 +378,11 @@
"int": 15, "int": 15,
"addr": "0xF8", "addr": "0xF8",
"round": 1, "round": 1,
"num": 24 "num": 25
}, },
{ {
"global": 0, "global": 0,
"name": "25. PZEM 004t Сила тока", "name": "26. PZEM 004t Сила тока",
"type": "Reading", "type": "Reading",
"subtype": "Pzem004a", "subtype": "Pzem004a",
"id": "a", "id": "a",
@@ -378,11 +392,11 @@
"int": 15, "int": 15,
"addr": "0xF8", "addr": "0xF8",
"round": 1, "round": 1,
"num": 25 "num": 26
}, },
{ {
"global": 0, "global": 0,
"name": "26. PZEM 004t Мощность", "name": "27. PZEM 004t Мощность",
"type": "Reading", "type": "Reading",
"subtype": "Pzem004w", "subtype": "Pzem004w",
"id": "w", "id": "w",
@@ -392,11 +406,11 @@
"int": 15, "int": 15,
"addr": "0xF8", "addr": "0xF8",
"round": 1, "round": 1,
"num": 26 "num": 27
}, },
{ {
"global": 0, "global": 0,
"name": "27. PZEM 004t Энергия", "name": "28. PZEM 004t Энергия",
"type": "Reading", "type": "Reading",
"subtype": "Pzem004wh", "subtype": "Pzem004wh",
"id": "wh", "id": "wh",
@@ -406,11 +420,11 @@
"int": 15, "int": 15,
"addr": "0xF8", "addr": "0xF8",
"round": 1, "round": 1,
"num": 27 "num": 28
}, },
{ {
"global": 0, "global": 0,
"name": "28. PZEM 004t Частота", "name": "29. PZEM 004t Частота",
"type": "Reading", "type": "Reading",
"subtype": "Pzem004hz", "subtype": "Pzem004hz",
"id": "hz", "id": "hz",
@@ -420,11 +434,11 @@
"int": 15, "int": 15,
"addr": "0xF8", "addr": "0xF8",
"round": 1, "round": 1,
"num": 28 "num": 29
}, },
{ {
"global": 0, "global": 0,
"name": "29. PZEM 004t Косинус", "name": "30. PZEM 004t Косинус",
"type": "Reading", "type": "Reading",
"subtype": "Pzem004pf", "subtype": "Pzem004pf",
"id": "pf", "id": "pf",
@@ -434,11 +448,11 @@
"int": 15, "int": 15,
"addr": "0xF8", "addr": "0xF8",
"round": 1, "round": 1,
"num": 29 "num": 30
}, },
{ {
"global": 0, "global": 0,
"name": "30. PZEM настройка", "name": "31. PZEM настройка",
"type": "Reading", "type": "Reading",
"subtype": "Pzem004cmd", "subtype": "Pzem004cmd",
"id": "set", "id": "set",
@@ -450,11 +464,11 @@
"changeaddr": 0, "changeaddr": 0,
"setaddr": "0x01", "setaddr": "0x01",
"reset": 0, "reset": 0,
"num": 30 "num": 31
}, },
{ {
"global": 0, "global": 0,
"name": "31. Sht20 Температура", "name": "32. Sht20 Температура",
"type": "Reading", "type": "Reading",
"subtype": "Sht20t", "subtype": "Sht20t",
"id": "tmp2", "id": "tmp2",
@@ -463,11 +477,11 @@
"descr": "Температура", "descr": "Температура",
"int": 15, "int": 15,
"round": 1, "round": 1,
"num": 31 "num": 32
}, },
{ {
"global": 0, "global": 0,
"name": "32. Sht20 Влажность", "name": "33. Sht20 Влажность",
"type": "Reading", "type": "Reading",
"subtype": "Sht20h", "subtype": "Sht20h",
"id": "Hum2", "id": "Hum2",
@@ -476,11 +490,11 @@
"descr": "Влажность", "descr": "Влажность",
"int": 15, "int": 15,
"round": 1, "round": 1,
"num": 32 "num": 33
}, },
{ {
"global": 0, "global": 0,
"name": "33. Sht30 Температура", "name": "34. Sht30 Температура",
"type": "Reading", "type": "Reading",
"subtype": "Sht30t", "subtype": "Sht30t",
"id": "tmp30", "id": "tmp30",
@@ -489,11 +503,11 @@
"descr": "SHT30 Температура", "descr": "SHT30 Температура",
"int": 15, "int": 15,
"round": 1, "round": 1,
"num": 33 "num": 34
}, },
{ {
"global": 0, "global": 0,
"name": "34. Sht30 Влажность", "name": "35. Sht30 Влажность",
"type": "Reading", "type": "Reading",
"subtype": "Sht30h", "subtype": "Sht30h",
"id": "Hum30", "id": "Hum30",
@@ -502,12 +516,12 @@
"descr": "SHT30 Влажность", "descr": "SHT30 Влажность",
"int": 15, "int": 15,
"round": 1, "round": 1,
"num": 34 "num": 35
}, },
{ {
"global": 0, "global": 0,
"name": "35. HC-SR04 Ультразвуковой дальномер", "name": "36. HC-SR04 Ультразвуковой дальномер",
"num": 35, "num": 36,
"type": "Reading", "type": "Reading",
"subtype": "Sonar", "subtype": "Sonar",
"id": "sonar", "id": "sonar",
@@ -519,7 +533,7 @@
"int": 5 "int": 5
}, },
{ {
"name": "36. UART", "name": "37. UART",
"type": "Reading", "type": "Reading",
"subtype": "UART", "subtype": "UART",
"page": "", "page": "",
@@ -531,14 +545,14 @@
"line": 2, "line": 2,
"speed": 9600, "speed": 9600,
"eventFormat": 0, "eventFormat": 0,
"num": 36 "num": 37
}, },
{ {
"header": "Исполнительные устройства" "header": "Исполнительные устройства"
}, },
{ {
"global": 0, "global": 0,
"name": "37. Кнопка подключенная к пину", "name": "38. Кнопка подключенная к пину",
"type": "Writing", "type": "Writing",
"subtype": "ButtonIn", "subtype": "ButtonIn",
"id": "btn", "id": "btn",
@@ -552,11 +566,11 @@
"pinMode": "INPUT", "pinMode": "INPUT",
"debounceDelay": 50, "debounceDelay": 50,
"fixState": 0, "fixState": 0,
"num": 37 "num": 38
}, },
{ {
"global": 0, "global": 0,
"name": "38. Управление пином", "name": "39. Управление пином",
"type": "Writing", "type": "Writing",
"subtype": "ButtonOut", "subtype": "ButtonOut",
"needSave": 0, "needSave": 0,
@@ -567,11 +581,11 @@
"int": 0, "int": 0,
"inv": 0, "inv": 0,
"pin": 2, "pin": 2,
"num": 38 "num": 39
}, },
{ {
"global": 0, "global": 0,
"name": "39. Сервопривод", "name": "40. Сервопривод",
"type": "Writing", "type": "Writing",
"subtype": "IoTServo", "subtype": "IoTServo",
"id": "servo", "id": "servo",
@@ -582,11 +596,11 @@
"pin": 12, "pin": 12,
"apin": -1, "apin": -1,
"amap": "0, 4096, 0, 180", "amap": "0, 4096, 0, 180",
"num": 39 "num": 40
}, },
{ {
"global": 0, "global": 0,
"name": "40. Расширитель портов Mcp23017", "name": "41. Расширитель портов Mcp23017",
"type": "Reading", "type": "Reading",
"subtype": "Mcp23017", "subtype": "Mcp23017",
"id": "Mcp", "id": "Mcp",
@@ -596,11 +610,11 @@
"int": "0", "int": "0",
"addr": "0x20", "addr": "0x20",
"index": 1, "index": 1,
"num": 40 "num": 41
}, },
{ {
"global": 0, "global": 0,
"name": "41. MP3 плеер", "name": "42. MP3 плеер",
"type": "Reading", "type": "Reading",
"subtype": "Mp3", "subtype": "Mp3",
"id": "mp3", "id": "mp3",
@@ -610,11 +624,11 @@
"int": 1, "int": 1,
"pins": "14,12", "pins": "14,12",
"volume": 20, "volume": 20,
"num": 41 "num": 42
}, },
{ {
"global": 0, "global": 0,
"name": "42. Сенсорная кнопка", "name": "43. Сенсорная кнопка",
"type": "Writing", "type": "Writing",
"subtype": "Multitouch", "subtype": "Multitouch",
"id": "impulse", "id": "impulse",
@@ -628,11 +642,11 @@
"pinMode": "INPUT", "pinMode": "INPUT",
"debounceDelay": 50, "debounceDelay": 50,
"PWMDelay": 500, "PWMDelay": 500,
"num": 42 "num": 43
}, },
{ {
"global": 0, "global": 0,
"name": "43. Расширитель портов Pcf8574", "name": "44. Расширитель портов Pcf8574",
"type": "Reading", "type": "Reading",
"subtype": "Pcf8574", "subtype": "Pcf8574",
"id": "Pcf", "id": "Pcf",
@@ -642,11 +656,11 @@
"int": "0", "int": "0",
"addr": "0x20", "addr": "0x20",
"index": 1, "index": 1,
"num": 43 "num": 44
}, },
{ {
"global": 0, "global": 0,
"name": "44. PWM ESP8266", "name": "45. PWM ESP8266",
"type": "Writing", "type": "Writing",
"subtype": "Pwm8266", "subtype": "Pwm8266",
"id": "pwm", "id": "pwm",
@@ -658,11 +672,11 @@
"freq": 5000, "freq": 5000,
"val": 0, "val": 0,
"apin": -1, "apin": -1,
"num": 44 "num": 45
}, },
{ {
"global": 0, "global": 0,
"name": "45. Телеграм-Лайт", "name": "46. Телеграм-Лайт",
"type": "Writing", "type": "Writing",
"subtype": "TelegramLT", "subtype": "TelegramLT",
"id": "tg", "id": "tg",
@@ -671,14 +685,14 @@
"descr": "", "descr": "",
"token": "", "token": "",
"chatID": "", "chatID": "",
"num": 45 "num": 46
}, },
{ {
"header": "Экраны" "header": "Экраны"
}, },
{ {
"global": 0, "global": 0,
"name": "46. LCD экран 2004", "name": "47. LCD экран 2004",
"type": "Reading", "type": "Reading",
"subtype": "Lcd2004", "subtype": "Lcd2004",
"id": "Lcd", "id": "Lcd",
@@ -690,10 +704,10 @@
"size": "20,4", "size": "20,4",
"coord": "0,0", "coord": "0,0",
"id2show": "id датчика", "id2show": "id датчика",
"num": 46 "num": 47
}, },
{ {
"name": "47. LCD экран 1602", "name": "48. LCD экран 1602",
"type": "Reading", "type": "Reading",
"subtype": "Lcd2004", "subtype": "Lcd2004",
"id": "Lcd", "id": "Lcd",
@@ -705,6 +719,6 @@
"size": "16,2", "size": "16,2",
"coord": "0,0", "coord": "0,0",
"id2show": "id датчика", "id2show": "id датчика",
"num": 47 "num": 48
} }
] ]

View File

@@ -19,13 +19,6 @@
#define FIRMWARE_NAME "esp32_4mb" #define FIRMWARE_NAME "esp32_4mb"
#endif #endif
#define MYSENSORS
//#ifdef esp32_4mb_ms
//#define FIRMWARE_NAME "esp32_4mb_ms"
//#define MYSENSORS
//#endif
//Размер буфера json //Размер буфера json
#define JSON_BUFFER_SIZE 2048 //держим 2 кб не меняем #define JSON_BUFFER_SIZE 2048 //держим 2 кб не меняем
#define WEB_SOCKETS_FRAME_SIZE 2048 #define WEB_SOCKETS_FRAME_SIZE 2048

View File

@@ -50,9 +50,17 @@
"path": "src/modules/virtual/Variable", "path": "src/modules/virtual/Variable",
"active": true "active": true
}, },
{
"path": "src/modules/virtual/VariableColor",
"active": true
},
{ {
"path": "src/modules/virtual/VButton", "path": "src/modules/virtual/VButton",
"active": true "active": true
},
{
"path": "src/modules/virtual/Weather",
"active": false
} }
], ],
"Сенсоры": [ "Сенсоры": [
@@ -182,6 +190,10 @@
"path": "src/modules/exec/IoTServo", "path": "src/modules/exec/IoTServo",
"active": true "active": true
}, },
{
"path": "src/modules/exec/Mcp23008",
"active": false
},
{ {
"path": "src/modules/exec/Mcp23017", "path": "src/modules/exec/Mcp23017",
"active": true "active": true

View File

@@ -264,6 +264,7 @@ build_src_filter =
+<modules/virtual/LogingDaily> +<modules/virtual/LogingDaily>
+<modules/virtual/Timer> +<modules/virtual/Timer>
+<modules/virtual/Variable> +<modules/virtual/Variable>
+<modules/virtual/VariableColor>
+<modules/virtual/VButton> +<modules/virtual/VButton>
+<modules/sensors/Acs712> +<modules/sensors/Acs712>
+<modules/sensors/AhtXX> +<modules/sensors/AhtXX>

View File

@@ -6,7 +6,7 @@ void mqttInit() {
WIFI_MQTT_CONNECTION_CHECK, MQTT_RECONNECT_INTERVAL, WIFI_MQTT_CONNECTION_CHECK, MQTT_RECONNECT_INTERVAL,
[&](void*) { [&](void*) {
if (WiFi.status() == WL_CONNECTED) { if (WiFi.status() == WL_CONNECTED) {
SerialPrint("i", F("WIFI"), F("OK")); SerialPrint("i", F("WIFI"), "OK: " + jsonReadStr(settingsFlashJson, F("ip")));
wifiUptimeCalc(); wifiUptimeCalc();
if (mqtt.connected()) { if (mqtt.connected()) {
SerialPrint("i", F("MQTT"), "OK"); SerialPrint("i", F("MQTT"), "OK");
@@ -110,8 +110,8 @@ void mqttSubscribe() {
mqtt.subscribe((mqttRootDevice + "/update").c_str()); mqtt.subscribe((mqttRootDevice + "/update").c_str());
if (jsonReadBool(settingsFlashJson, "mqttin")) { if (jsonReadBool(settingsFlashJson, "mqttin")) {
mqtt.subscribe((mqttPrefix + "/+/+/event").c_str()); mqtt.subscribe((mqttPrefix + "/+/+/event/#").c_str());
mqtt.subscribe((mqttPrefix + "/+/+/order").c_str()); mqtt.subscribe((mqttPrefix + "/+/+/order/#").c_str());
mqtt.subscribe((mqttPrefix + "/+/+/info").c_str()); mqtt.subscribe((mqttPrefix + "/+/+/info").c_str());
} }
} }

View File

@@ -63,6 +63,7 @@ void IoTItem::setValue(const String& valStr, bool genEvent) {
if (value.isDecimal) { if (value.isDecimal) {
value.valD = valStr.toFloat(); value.valD = valStr.toFloat();
getRoundValue();
} else { } else {
value.valS = valStr; value.valS = valStr;
} }
@@ -105,7 +106,7 @@ void IoTItem::regEvent(const String& value, const String& consoleInfo, bool erro
} }
// отправка события другим устройствам в сети если не было ошибки // отправка события другим устройствам в сети если не было ошибки
if (jsonReadBool(settingsFlashJson, "mqttin") && _global && !error) { if (_global && !error) {
String json = "{}"; String json = "{}";
jsonWriteStr_(json, "id", _id); jsonWriteStr_(json, "id", _id);
jsonWriteStr_(json, "val", value); jsonWriteStr_(json, "val", value);
@@ -117,15 +118,19 @@ void IoTItem::regEvent(const String& value, const String& consoleInfo, bool erro
} }
String IoTItem::getRoundValue() { String IoTItem::getRoundValue() {
if (!value.isDecimal) return value.valS;
if (_round >= 0 && _round <= 6) { if (_round >= 0 && _round <= 6) {
int sot = _round ? pow(10, (int)_round) : 1; int sot = _round ? pow(10, (int)_round) : 1;
value.valD = round(value.valD * sot) / sot; value.valD = round(value.valD * sot) / sot;
char buf[15]; char buf[15];
sprintf(buf, ("%1." + (String)_round + "f").c_str(), value.valD); sprintf(buf, ("%1." + (String)_round + "f").c_str(), value.valD);
return (String)buf; value.valS = (String)buf;
return value.valS;
} else { } else {
return (String)value.valD; value.valS = (String)value.valD;
return value.valS;
} }
} }

View File

@@ -112,6 +112,7 @@ class VariableExprAST : public ExprAST {
// if (Item->value.isDecimal) // if (Item->value.isDecimal)
// Serial.printf("Call from VariableExprAST: %s = %f\n", Name.c_str(), Item->value.valD); // Serial.printf("Call from VariableExprAST: %s = %f\n", Name.c_str(), Item->value.valD);
// else Serial.printf("Call from VariableExprAST: %s = %s\n", Name.c_str(), Item->value.valS.c_str()); // else Serial.printf("Call from VariableExprAST: %s = %s\n", Name.c_str(), Item->value.valS.c_str());
Item->getRoundValue();
return &(Item->value); return &(Item->value);
} }
@@ -125,7 +126,7 @@ class BinaryExprAST : public ExprAST {
signed char Op; signed char Op;
ExprAST *LHS, *RHS; ExprAST *LHS, *RHS;
IoTValue val; IoTValue val;
String lhsStr, rhsStr; //String lhsStr, rhsStr;
public: public:
BinaryExprAST(signed char op, ExprAST *lhs, ExprAST *rhs) BinaryExprAST(signed char op, ExprAST *lhs, ExprAST *rhs)
@@ -139,21 +140,6 @@ class BinaryExprAST : public ExprAST {
IoTValue *exec() { IoTValue *exec() {
if (isIotScenException) return nullptr; if (isIotScenException) return nullptr;
// String printStr = "";
// if (Op == tok_equal)
// printStr = "==";
// else if (Op == tok_notequal)
// printStr = "!=";
// else if (Op == tok_lesseq)
// printStr = "<=";
// else if (Op == tok_greateq)
// printStr = ">=";
// else
// printStr = printStr + (char)Op;
// Serial.printf("Call from BinaryExprAST: %s\n", printStr.c_str());
if (RHS == nullptr || LHS == nullptr) return nullptr; if (RHS == nullptr || LHS == nullptr) return nullptr;
IoTValue *rhs = RHS->exec(); // получаем значение правого операнда для возможного использования в операции присваивания IoTValue *rhs = RHS->exec(); // получаем значение правого операнда для возможного использования в операции присваивания
@@ -170,8 +156,12 @@ class BinaryExprAST : public ExprAST {
IoTValue *lhs = LHS->exec(); // если присваивания не произошло, значит операция иная и необходимо значение левого операнда IoTValue *lhs = LHS->exec(); // если присваивания не произошло, значит операция иная и необходимо значение левого операнда
if (lhs == nullptr) return nullptr; if (lhs == nullptr) return nullptr;
// все бинарные операции кроме +, - и == обязаны работать с числами
if (lhs->isDecimal && rhs->isDecimal) { if (Op != '+' && Op != '-' && Op != tok_equal) {
// поэтому преобразовываем строки в булевые интерпретации
if (!lhs->isDecimal) lhs->valD = lhs->valS != ""; // пустая строка = false
if (!rhs->isDecimal) rhs->valD = rhs->valS != ""; // пустая строка = false
switch (Op) { switch (Op) {
case '>': case '>':
val.valD = lhs->valD > rhs->valD; val.valD = lhs->valD > rhs->valD;
@@ -185,19 +175,10 @@ class BinaryExprAST : public ExprAST {
case tok_greateq: case tok_greateq:
val.valD = lhs->valD >= rhs->valD; val.valD = lhs->valD >= rhs->valD;
break; break;
case tok_equal:
val.valD = lhs->valD == rhs->valD;
break;
case tok_notequal: case tok_notequal:
val.valD = lhs->valD != rhs->valD; val.valD = lhs->valD != rhs->valD;
break; break;
case '+':
val.valD = lhs->valD + rhs->valD;
break;
case '-':
val.valD = lhs->valD - rhs->valD;
break;
case '*': case '*':
val.valD = lhs->valD * rhs->valD; val.valD = lhs->valD * rhs->valD;
break; break;
@@ -218,37 +199,43 @@ class BinaryExprAST : public ExprAST {
default: default:
break; break;
} }
return &val; } else { // иначе имеем дело с операциями + или - или ==, которые могут работать с разными типами данных
} if (lhs->isDecimal && lhs->valS == "") lhs->valS = (String)lhs->valD; // небольшой костыль пока не переделаем работу со значениями, планируется добавить long, работу со временем, перенести округление и модификаторы в IoTValue
if (rhs->isDecimal && rhs->valS == "") rhs->valS = (String)rhs->valD; // пока для сохранения округления в IoTItem применяется хитрость с сохранением внешнего вида числа в строку valS,
if (!lhs->isDecimal || !rhs->isDecimal) { // но некоторые модули и системные не делают этого, поэтому отлавливаем эту ситуацию тут и учитываем.
if (lhs->isDecimal)
lhsStr = (String)lhs->valD;
else
lhsStr = lhs->valS;
if (rhs->isDecimal)
rhsStr = (String)rhs->valD;
else
rhsStr = rhs->valS;
switch (Op) { switch (Op) {
case tok_equal: case tok_equal:
val.valD = compStr(lhsStr, rhsStr); if (lhs->isDecimal && rhs->isDecimal)
val.valD = lhs->valD == rhs->valD;
else
val.valD = compStr(lhs->valS, rhs->valS);
break; break;
case '+': case '+':
val.valS = lhsStr + rhsStr; if (lhs->isDecimal && rhs->isDecimal)
val.valD = 1; val.valD = lhs->valD + rhs->valD;
val.isDecimal = false; else {
val.valS = lhs->valS + rhs->valS;
val.valD = 1;
val.isDecimal = false;
}
break;
case '-':
if (lhs->isDecimal && rhs->isDecimal)
val.valD = lhs->valD - rhs->valD;
else {
val.valS = lhs->valS;
val.valS.replace(rhs->valS, "");
val.valD = 1;
val.isDecimal = false;
}
break; break;
default: default:
break; break;
} }
return &val; }
}
return &val; return &val;
} }

View File

@@ -5,6 +5,7 @@ void* getAPI_Loging(String subtype, String params);
void* getAPI_LogingDaily(String subtype, String params); void* getAPI_LogingDaily(String subtype, String params);
void* getAPI_Timer(String subtype, String params); void* getAPI_Timer(String subtype, String params);
void* getAPI_Variable(String subtype, String params); void* getAPI_Variable(String subtype, String params);
void* getAPI_VariableColor(String subtype, String params);
void* getAPI_VButton(String subtype, String params); void* getAPI_VButton(String subtype, String params);
void* getAPI_Acs712(String subtype, String params); void* getAPI_Acs712(String subtype, String params);
void* getAPI_AhtXX(String subtype, String params); void* getAPI_AhtXX(String subtype, String params);
@@ -36,6 +37,7 @@ if ((tmpAPI = getAPI_Loging(subtype, params)) != nullptr) return tmpAPI;
if ((tmpAPI = getAPI_LogingDaily(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_LogingDaily(subtype, params)) != nullptr) return tmpAPI;
if ((tmpAPI = getAPI_Timer(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Timer(subtype, params)) != nullptr) return tmpAPI;
if ((tmpAPI = getAPI_Variable(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Variable(subtype, params)) != nullptr) return tmpAPI;
if ((tmpAPI = getAPI_VariableColor(subtype, params)) != nullptr) return tmpAPI;
if ((tmpAPI = getAPI_VButton(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_VButton(subtype, params)) != nullptr) return tmpAPI;
if ((tmpAPI = getAPI_Acs712(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Acs712(subtype, params)) != nullptr) return tmpAPI;
if ((tmpAPI = getAPI_AhtXX(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_AhtXX(subtype, params)) != nullptr) return tmpAPI;

View File

@@ -0,0 +1,85 @@
#include "Global.h"
#include "classes/IoTItem.h"
#include "classes/IoTGpio.h"
#include <Adafruit_MCP23X08.h>
class Mcp23008Driver : public IoTGpio {
private:
Adafruit_MCP23X08 _mcp;
public:
Mcp23008Driver(int index, String addr) : IoTGpio(index) {
if (!_mcp.begin_I2C(hexStringToUint8(addr))) {
Serial.println("MCP23X08 Init Error.");
}
}
void pinMode(uint8_t pin, uint8_t mode) {
_mcp.pinMode(pin, mode);
}
void digitalWrite(uint8_t pin, uint8_t val) {
_mcp.digitalWrite(pin, val);
}
int digitalRead(uint8_t pin) {
return _mcp.digitalRead(pin);
}
void digitalInvert(uint8_t pin) {
_mcp.digitalWrite(pin, 1 - _mcp.digitalRead(pin));
}
~Mcp23008Driver() {};
};
class Mcp23008 : public IoTItem {
private:
Mcp23008Driver* _driver;
String _addr;
public:
Mcp23008(String parameters) : IoTItem(parameters) {
_driver = nullptr;
jsonRead(parameters, "addr", _addr);
if (_addr == "") {
scanI2C();
return;
}
int index;
jsonRead(parameters, "index", index);
if (index > 4) {
Serial.println("MCP23X08 wrong index. Must be 0 - 4");
return;
}
_driver = new Mcp23008Driver(index, _addr);
}
void doByInterval() {
if (_addr == "") {
scanI2C();
return;
}
}
//возвращает ссылку на экземпляр класса Mcp23008Driver
IoTGpio* getGpioDriver() {
return _driver;
}
~Mcp23008() {
delete _driver;
};
};
void* getAPI_Mcp23008(String subtype, String param) {
if (subtype == F("Mcp23008")) {
return new Mcp23008(param);
} else {
return nullptr;
}
}

View File

@@ -0,0 +1,67 @@
{
"menuSection": "Исполнительные устройства",
"configItem": [{
"global": 0,
"name": "Расширитель портов Mcp23008",
"type": "Reading",
"subtype": "Mcp23008",
"id": "Mcp",
"widget": "",
"page": "",
"descr": "",
"int": "0",
"addr": "0x20",
"index": 1
}],
"about": {
"authorName": "Ilya Belyakov",
"authorContact": "https://t.me/Biveraxe",
"authorGit": "https://github.com/biveraxe",
"specialThanks": "",
"moduleName": "Mcp23008",
"moduleVersion": "1.0",
"usedRam": {
"esp32_4mb": 15,
"esp8266_4mb": 15
},
"title": "Расширитель портов Mcp23008",
"moduleDesc": "Добавляет в систему дополнительные GPIO для элементов, которые поддерживают такую функцию.",
"propInfo": {
"int": "Не используется",
"addr": "Адрес устройства на шине, обычно 0x20",
"index": "Значения от 1 до 4, где при выборе 1 будет нумерация pin 100-115, при выборе 2 200-215 и т.д."
}
},
"defActive": false,
"usedLibs": {
"esp32_4mb": [
"adafruit/Adafruit Mcp23017 Arduino Library@^2.1.0",
"adafruit/Adafruit BusIO @ ^1.13.2"
],
"esp8266_4mb": [
"adafruit/Adafruit Mcp23017 Arduino Library@^2.1.0",
"adafruit/Adafruit BusIO @ ^1.13.2"
],
"esp8266_1mb": [
"adafruit/Adafruit Mcp23017 Arduino Library@^2.1.0",
"adafruit/Adafruit BusIO @ ^1.13.2"
],
"esp8266_1mb_ota": [
"adafruit/Adafruit Mcp23017 Arduino Library@^2.1.0",
"adafruit/Adafruit BusIO @ ^1.13.2"
],
"esp8285_1mb": [
"adafruit/Adafruit Mcp23017 Arduino Library@^2.1.0",
"adafruit/Adafruit BusIO @ ^1.13.2"
],
"esp8285_1mb_ota": [
"adafruit/Adafruit Mcp23017 Arduino Library@^2.1.0",
"adafruit/Adafruit BusIO @ ^1.13.2"
]
}
}

View File

@@ -1,5 +1,7 @@
#pragma once #pragma once
#include "Const.h" #include "Const.h"
#define MYSENSORS
#ifdef MYSENSORS #ifdef MYSENSORS
/* /*

View File

@@ -0,0 +1,133 @@
#include "Global.h"
#include "classes/IoTItem.h"
class ExternalMQTT : public IoTItem
{
private:
String _MAC;
String _sensor;
IoTItem *tmp;
int _minutesPassed = 0;
String json = "{}";
int orange = 0;
int red = 0;
int offline = 0;
bool dataFromNode = false;
public:
ExternalMQTT(String parameters) : IoTItem(parameters)
{
_MAC = jsonReadStr(parameters, "MAC");
_sensor = jsonReadStr(parameters, "sensor");
jsonRead(parameters, F("orange"), orange);
jsonRead(parameters, F("red"), red);
jsonRead(parameters, F("offline"), offline);
dataFromNode = false;
}
char *TimeToString(unsigned long t)
{
static char str[12];
long h = t / 3600;
t = t % 3600;
int m = t / 60;
int s = t % 60;
sprintf(str, "%02ld:%02d:%02d", h, m, s);
return str;
}
void onMqttRecive(String &topic, String &msg)
{
if (msg.indexOf("HELLO") == -1)
{
// SerialPrint("i", "onMqttRecive", "Прилетело " + topic);
// SerialPrint("i", "onMqttRecive", "Прилетело " + msg);
String dev = selectToMarkerLast(topic, "/");
dev.toUpperCase();
dev.replace(":", "");
if (_MAC == "")
{
SerialPrint("i", "onMqttRecive", dev + " --> " + msg);
}
DynamicJsonDocument doc(JSON_BUFFER_SIZE);
DeserializationError error = deserializeJson(doc, msg);
if (error)
{
SerialPrint("E", F("onMqttRecive"), error.f_str());
}
JsonObject jsonObject = doc.as<JsonObject>();
for (JsonPair kv : jsonObject)
{
String key = kv.key().c_str();
String val = kv.value();
if (_MAC == dev && _sensor == key)
{
dataFromNode = true;
_minutesPassed = 0;
setValue(val);
// setNewWidgetAttributes();
}
// Serial.println("Key: " + key);
// Serial.println("Value: " + val);
}
}
}
void doByInterval()
{
_minutesPassed++;
setNewWidgetAttributes();
}
void onMqttWsAppConnectEvent()
{
setNewWidgetAttributes();
}
void setNewWidgetAttributes()
{
jsonWriteStr(json, F("info"), prettyMinutsTimeout(_minutesPassed));
if (dataFromNode)
{
if (orange != 0 && red != 0 && offline != 0)
{
if (_minutesPassed < orange)
{
jsonWriteStr(json, F("color"), "");
}
if (_minutesPassed >= orange && _minutesPassed < red)
{
jsonWriteStr(json, F("color"), F("orange")); // сделаем виджет оранжевым
}
if (_minutesPassed >= red && _minutesPassed < offline)
{
jsonWriteStr(json, F("color"), F("red")); // сделаем виджет красным
}
if (_minutesPassed >= offline)
{
jsonWriteStr(json, F("info"), F("offline"));
}
}
}
else
{
jsonWriteStr(json, F("info"), F("awaiting"));
}
sendSubWidgetsValues(_id, json);
}
~ExternalMQTT(){};
};
void *getAPI_ExternalMQTT(String subtype, String param)
{
if (subtype == F("ExternalMQTT"))
{
return new ExternalMQTT(param);
}
else
{
return nullptr;
}
}

View File

@@ -0,0 +1,58 @@
{
"menuSection": "Сенсоры",
"configItem": [
{
"global": 0,
"name": "MQTT парсер",
"type": "Reading",
"subtype": "ExternalMQTT",
"id": "MQTTin",
"widget": "",
"page": "",
"descr": "",
"MAC": "",
"sensor": "",
"round": "",
"orange": 60,
"red": 120,
"offline": 180,
"int": 60
}
],
"about": {
"authorName": "AVAKS",
"authorContact": "https://t.me/@avaks_dev",
"authorGit": "https://github.com/avaksru",
"specialThanks": "",
"moduleName": "ExternalMQTT",
"moduleVersion": "1",
"usedRam": {
"esp32_4mb": 15,
"esp8266_4mb": 15
},
"title": "ExternalMQTT",
"moduleDesc": "Модуль получения данных из OpenMQTTGateway, Zigbee2MQTT, SLS, Tasmota, NodeRead, HA, openHAB, Fhem, domotiz, EEdom",
"propInfo": {
"round": "Округление после запятой.",
"int": "Интервал для изменения цвета",
"orange": "количество минут после которого окрасить виджет в оранжевый цвет",
"red": "количество минут после которого окрасить виджет в красный цвет",
"offline": "количество минут после которого отобразить что устройство offline, если все три orange red и offline поставить в ноль - то функция окраски выключится",
"MAC": "MAC адрес беспроводного датчика",
"sensor": "Тип сенсора: температура / влажность / время / ... "
}
},
"defActive": false,
"usedLibs": {
"esp32_4mb": [],
"esp8266_4mb": [],
"esp8266_1mb": [],
"esp8266_1mb_ota": [],
"esp8285_1mb": [],
"esp8285_1mb_ota": []
}
}

View File

@@ -169,13 +169,15 @@ class UART : public IoTItem {
IoTValue execute(String command, std::vector<IoTValue> &param) { IoTValue execute(String command, std::vector<IoTValue> &param) {
if (command == "println") { if (command == "println") {
if (param.size() == 1) { if (param.size() == 1) {
if (param[0].isDecimal) uartPrintln((String)param[0].valD); //if (param[0].isDecimal) uartPrintln((String)param[0].valD);
else uartPrintln(param[0].valS); //else uartPrintln(param[0].valS);
uartPrintln(param[0].valS);
} }
} else if (command == "print") { } else if (command == "print") {
if (param.size() == 1) { if (param.size() == 1) {
if (param[0].isDecimal) uartPrint((String)param[0].valD); //if (param[0].isDecimal) uartPrint((String)param[0].valD);
else uartPrint(param[0].valS); //else uartPrint(param[0].valS);
uartPrintln(param[0].valS);
} }
} else if (command == "printHex") { } else if (command == "printHex") {
if (param.size() == 1) { if (param.size() == 1) {
@@ -184,10 +186,11 @@ class UART : public IoTItem {
} else if (command == "printFFF") { } else if (command == "printFFF") {
if (param.size() == 2) { if (param.size() == 2) {
String strToUart = ""; String strToUart = "";
if (param[0].isDecimal) // if (param[0].isDecimal)
strToUart = param[0].valD; // strToUart = param[0].valD;
else // else
strToUart = param[0].valS; // strToUart = param[0].valS;
strToUart = param[0].valS;
if (param[1].valD) if (param[1].valD)
uartPrintFFF("\"" + strToUart + "\""); uartPrintFFF("\"" + strToUart + "\"");

View File

@@ -32,7 +32,7 @@
"title": "Таймер обратного отсчета", "title": "Таймер обратного отсчета",
"moduleDesc": "Добавляет инструмент таймеров обратного отсчета для организации периодичных операций или логических конструкций. Часто используется как вспомогательный элемент для автоматизации.", "moduleDesc": "Добавляет инструмент таймеров обратного отсчета для организации периодичных операций или логических конструкций. Часто используется как вспомогательный элемент для автоматизации.",
"propInfo": { "propInfo": {
"int": "Задает размер в секундах одного шага(тика) таймера.", "int": "Задает размер в миллисекундах (1000 = 1сек) одного шага(тика) таймера.",
"countDown": "Начальное значение таймера, с которого начинается обратный отсчет. countDown=0 - бесконечный счет (имеет смысл при ticker=1, иначе таймер будет выключен), countDown=-1 - отключает таймер совсем (используется для запуска системы с выключенным таймером)", "countDown": "Начальное значение таймера, с которого начинается обратный отсчет. countDown=0 - бесконечный счет (имеет смысл при ticker=1, иначе таймер будет выключен), countDown=-1 - отключает таймер совсем (используется для запуска системы с выключенным таймером)",
"ticker": "Генерировать(1) или нет(0) события при каждом тике таймера.", "ticker": "Генерировать(1) или нет(0) события при каждом тике таймера.",
"repeat": "Сбрасывать(1) или нет(0) таймер в начальное состояние при достижении нуля.", "repeat": "Сбрасывать(1) или нет(0) таймер в начальное состояние при достижении нуля.",

View File

@@ -0,0 +1,46 @@
#include "Global.h"
#include "classes/IoTItem.h"
// дочь - родитель
class VariableColor : public IoTItem
{
private:
public:
VariableColor(String parameters) : IoTItem(parameters)
{
}
void doByInterval()
{
}
// событие когда пользователь подключается приложением или веб интерфейсом к усройству
void onMqttWsAppConnectEvent()
{
SerialPrint("i", "Connecting", "Dashbord open ");
regEvent(value.valS, "VariableColor", false, true);
}
IoTValue execute(String command, std::vector<IoTValue> &param)
{
if (command == "widget" && param.size() == 2)
{
String json = "{}";
jsonWriteStr(json, param[0].valS, param[1].valS);
sendSubWidgetsValues(_id, json);
}
return {};
}
};
void *getAPI_VariableColor(String subtype, String param)
{
if (subtype == F("VariableColor"))
{
return new VariableColor(param);
}
else
{
return nullptr;
}
}

View File

@@ -0,0 +1,46 @@
{
"menuSection": "Виртуальные элементы",
"configItem": [
{
"global": 0,
"name": "Цветной текст",
"type": "Reading",
"subtype": "VariableColor",
"id": "color",
"needSave": 0,
"widget": "anydataDef",
"page": "Вывод",
"descr": "Цветной текст",
"val": "...",
"round": 0
}
],
"about": {
"authorName": "AVAKS",
"authorContact": "https://t.me/@avaks_dev",
"authorGit": "https://github.com/avaksru",
"specialThanks": "",
"moduleName": "VariableColor",
"moduleVersion": "1",
"usedRam": {
"esp32_4mb": 15,
"esp8266_4mb": 15
},
"title": "Цветной текст",
"moduleDesc": "Текст с возможностью динамического изменения цвета",
"propInfo": {
"val": "Значение при старте"
}
},
"defActive": true,
"usedLibs": {
"esp32_4mb": [],
"esp8266_4mb": [],
"esp8266_1mb": [],
"esp8266_1mb_ota": [],
"esp8285_1mb": [],
"esp8285_1mb_ota": []
}
}

View File

@@ -0,0 +1,153 @@
#include "Global.h"
#include "classes/IoTItem.h"
#include <ArduinoJson.h>
long prevWeatherMillis = millis() - 60001;
StaticJsonDocument<JSON_BUFFER_SIZE * 2> Weatherdoc;
extern IoTGpio IoTgpio;
class Weather : public IoTItem
{
private:
String _location;
String _param;
long interval;
public:
Weather(String parameters) : IoTItem(parameters)
{
_location = jsonReadStr(parameters, "location");
_param = jsonReadStr(parameters, "param");
jsonRead(parameters, F("int"), interval);
interval = interval * 1000 * 60 * 60; // интервал проверки погоды в часах
}
void getWeather()
{
String ret;
if (WiFi.status() == WL_CONNECTED)
{
// char c;
String payload;
WiFiClient client;
HTTPClient http;
http.begin(client, "http://live-control.com/iotm/weather.php");
http.addHeader("Content-Type", "application/x-www-form-urlencoded");
String httpRequestData = "loc=" + _location;
int httpResponseCode = http.POST(httpRequestData);
if (httpResponseCode > 0)
{
ret = httpResponseCode;
if (httpResponseCode == HTTP_CODE_OK)
{
payload = http.getString();
deserializeJson(Weatherdoc, payload);
// ret += payload;
}
}
else
{
ret = http.errorToString(httpResponseCode).c_str();
}
SerialPrint("<-", F("getWeather"), httpRequestData);
SerialPrint("->", F("getWeather"), "server: " + ret);
http.end();
}
}
void doByInterval()
{
if (prevWeatherMillis + 60000 < millis())
{
getWeather();
prevWeatherMillis = millis();
}
if (jsonReadStr(Weatherdoc["current_condition"][0], "temp_C", true) != "null")
{
if (_param == "temp_C")
{
value.valS = jsonReadStr(Weatherdoc["current_condition"][0], "temp_C", true);
}
if (_param == "avgtempC")
{
value.valS = jsonReadStr(Weatherdoc["weather"][0], "avgtempC", true);
}
if (_param == "humidity")
{
value.valS = jsonReadStr(Weatherdoc["current_condition"][0], "humidity", true);
}
if (_param == "weatherCode")
{
value.valS = jsonReadStr(Weatherdoc["current_condition"][0], "weatherCode", true);
}
if (_param == "sunrise")
{
value.valS = jsonReadStr(Weatherdoc["weather"][0]["astronomy"][0], "sunrise", true);
}
if (_param == "sunset")
{
value.valS = jsonReadStr(Weatherdoc["weather"][0]["astronomy"][0], "sunset", true);
}
if (_param == "rangetempC")
{
value.valS = jsonReadStr(Weatherdoc["weather"][0], "mintempC", true) + "..." + jsonReadStr(Weatherdoc["weather"][0], "maxtempC", true);
}
// погода на завтра
if (_param == "temp_C_tomorrow")
{
value.valS = jsonReadStr(Weatherdoc["weather"][1], "avgtempC", true);
}
if (_param == "rangetempC_tomorrow")
{
value.valS = jsonReadStr(Weatherdoc["weather"][1], "mintempC", true) + "..." + jsonReadStr(Weatherdoc["weather"][1], "maxtempC", true);
}
regEvent(value.valS, "Weather");
}
}
void loop()
{
if (enableDoByInt)
{
currentMillis = millis();
difference = currentMillis - prevMillis;
if (difference >= interval)
{
prevMillis = millis();
this->doByInterval();
}
}
}
IoTValue execute(String command, std::vector<IoTValue> &param)
{
if (command == "get")
{
getWeather();
doByInterval();
}
return {};
}
~Weather(){};
};
void *getAPI_Weather(String subtype, String param)
{
if (subtype == F("Weather"))
{
return new Weather(param);
}
else
{
return nullptr;
}
}

View File

@@ -0,0 +1,53 @@
{
"menuSection": "Виртуальные элементы",
"configItem": [
{
"global": 0,
"name": "Погода",
"type": "Reading",
"subtype": "Weather",
"id": "Weather",
"needSave": 0,
"widget": "anydataDef",
"page": "Погода",
"descr": "",
"int": 3,
"location": "Moscow",
"param": "temp_C",
"round": 0,
"val": "..."
}
],
"about": {
"authorName": "AVAKS",
"authorContact": "https://t.me/@avaks_dev",
"authorGit": "https://github.com/avaksru",
"specialThanks": "",
"moduleName": "Weather",
"moduleVersion": "1",
"usedRam": {
"esp32_4mb": 15,
"esp8266_4mb": 15
},
"title": "Погода",
"moduleDesc": "Получение погоды из интернет",
"propInfo": {
"location": "Город.",
"param": "temp_C - температура, humidity - влажность, weatherCode - погодный код, sunrise - рассвет, sunset - закат, rangetempC - (-3...-10 C), temp_C_tomorrow - температура завтра, rangetempC_tomorrow - (-3...-10 C) на завтра",
"int": "Интервал запроса погоды в часах"
}
},
"defActive": false,
"usedLibs": {
"esp32_4mb": [],
"esp8266_4mb": [],
"esp8266_1mb": [],
"esp8266_1mb_ota": [],
"esp8285_1mb": [],
"esp8285_1mb_ota": []
}
}