mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-30 20:09:14 +03:00
bugfix Thermostat, ExternalMqtt; add widget liter
This commit is contained in:
@@ -301,6 +301,13 @@
|
|||||||
"after": "cm",
|
"after": "cm",
|
||||||
"icon": "speedometer"
|
"icon": "speedometer"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "anydataLiter",
|
||||||
|
"label": "Литры",
|
||||||
|
"widget": "anydata",
|
||||||
|
"after": "ltr",
|
||||||
|
"icon": "speedometer"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "nil",
|
"name": "nil",
|
||||||
"label": "Без виджета"
|
"label": "Без виджета"
|
||||||
|
|||||||
@@ -301,6 +301,13 @@
|
|||||||
"after": "cm",
|
"after": "cm",
|
||||||
"icon": "speedometer"
|
"icon": "speedometer"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "anydataLiter",
|
||||||
|
"label": "Литры",
|
||||||
|
"widget": "anydata",
|
||||||
|
"after": "ltr",
|
||||||
|
"icon": "speedometer"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "nil",
|
"name": "nil",
|
||||||
"label": "Без виджета"
|
"label": "Без виджета"
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ boolean publishChartMqtt(const String& topic, const String& data);
|
|||||||
boolean publishJsonMqtt(const String& topic, const String& json);
|
boolean publishJsonMqtt(const String& topic, const String& json);
|
||||||
boolean publishStatusMqtt(const String& topic, const String& data);
|
boolean publishStatusMqtt(const String& topic, const String& data);
|
||||||
boolean publishEvent(const String& topic, const String& data);
|
boolean publishEvent(const String& topic, const String& data);
|
||||||
void mqttSubscribeExternal(String topic, bool usePrefix);
|
void mqttSubscribeExternal(String topic, bool usePrefix = false);
|
||||||
|
|
||||||
bool publishChartFileToMqtt(String path, String id, int maxCount);
|
bool publishChartFileToMqtt(String path, String id, int maxCount);
|
||||||
|
|
||||||
|
|||||||
@@ -239,9 +239,9 @@ protected:
|
|||||||
}
|
}
|
||||||
if (sp && pv)
|
if (sp && pv)
|
||||||
{
|
{
|
||||||
value.valD = pid(sp, pv, pv_last, ierr, _int);
|
// value.valD = pid(sp, pv, pv_last, ierr, _int);
|
||||||
value.valS = (String)(int)pid(sp, pv, pv_last, ierr, _int);
|
// value.valS = (String)(int)value.valD;
|
||||||
regEvent(value.valS, "ThermostatPID", false, true);
|
regEvent(pid(sp, pv, pv_last, ierr, _int), "ThermostatPID", false, true);
|
||||||
}
|
}
|
||||||
pv_last = pv;
|
pv_last = pv;
|
||||||
}
|
}
|
||||||
@@ -332,8 +332,8 @@ private:
|
|||||||
public:
|
public:
|
||||||
ThermostatETK(String parameters) : IoTItem(parameters)
|
ThermostatETK(String parameters) : IoTItem(parameters)
|
||||||
{
|
{
|
||||||
jsonRead(parameters, "set_id", _set_id);
|
// jsonRead(parameters, "set_id", _set_id);
|
||||||
jsonRead(parameters, "term_id", _term_id);
|
// jsonRead(parameters, "term_id", _term_id);
|
||||||
jsonRead(parameters, "iv_k", _iv_k);
|
jsonRead(parameters, "iv_k", _iv_k);
|
||||||
jsonRead(parameters, "outside_id", _outside_id);
|
jsonRead(parameters, "outside_id", _outside_id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ private:
|
|||||||
bool dataFromNode = false;
|
bool dataFromNode = false;
|
||||||
String _topic = "";
|
String _topic = "";
|
||||||
bool _isJson;
|
bool _isJson;
|
||||||
bool _addPrefix;
|
// bool _addPrefix;
|
||||||
bool _debug;
|
bool _debug;
|
||||||
bool sendOk = false;
|
bool sendOk = false;
|
||||||
|
|
||||||
@@ -28,12 +28,12 @@ public:
|
|||||||
jsonRead(parameters, F("offline"), offline);
|
jsonRead(parameters, F("offline"), offline);
|
||||||
_topic = jsonReadStr(parameters, "topic");
|
_topic = jsonReadStr(parameters, "topic");
|
||||||
jsonRead(parameters, "isJson", _isJson);
|
jsonRead(parameters, "isJson", _isJson);
|
||||||
jsonRead(parameters, "addPrefix", _addPrefix);
|
// jsonRead(parameters, "addPrefix", _addPrefix);
|
||||||
jsonRead(parameters, "debug", _debug);
|
jsonRead(parameters, "debug", _debug);
|
||||||
dataFromNode = false;
|
dataFromNode = false;
|
||||||
if (mqttIsConnect())
|
if (mqttIsConnect())
|
||||||
sendOk = true;
|
sendOk = true;
|
||||||
mqttSubscribeExternal(_topic, _addPrefix);
|
mqttSubscribeExternal(_topic);
|
||||||
}
|
}
|
||||||
char *TimeToString(unsigned long t)
|
char *TimeToString(unsigned long t)
|
||||||
{
|
{
|
||||||
@@ -113,7 +113,7 @@ public:
|
|||||||
if (mqttIsConnect() && !sendOk)
|
if (mqttIsConnect() && !sendOk)
|
||||||
{
|
{
|
||||||
sendOk = true;
|
sendOk = true;
|
||||||
mqttSubscribeExternal(_topic, _addPrefix);
|
mqttSubscribeExternal(_topic);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void onMqttWsAppConnectEvent()
|
void onMqttWsAppConnectEvent()
|
||||||
@@ -144,6 +144,8 @@ public:
|
|||||||
if (_minutesPassed >= offline)
|
if (_minutesPassed >= offline)
|
||||||
{
|
{
|
||||||
jsonWriteStr(json, F("info"), F("offline"));
|
jsonWriteStr(json, F("info"), F("offline"));
|
||||||
|
regEvent(NAN, "ExternalMQTT");
|
||||||
|
SerialPrint("E", "ExternalMQTT", "V error", _id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
"descr": "",
|
"descr": "",
|
||||||
"sensor": "",
|
"sensor": "",
|
||||||
"topic": "",
|
"topic": "",
|
||||||
"addPrefix": 0,
|
|
||||||
"isJson": 1,
|
"isJson": 1,
|
||||||
"round": "",
|
"round": "",
|
||||||
"orange": 60,
|
"orange": 60,
|
||||||
@@ -24,7 +23,7 @@
|
|||||||
],
|
],
|
||||||
"about": {
|
"about": {
|
||||||
"authorName": "AVAKS",
|
"authorName": "AVAKS",
|
||||||
"authorContact": "https://t.me/@avaks_dev",
|
"authorContact": "https://t.me/@avaks",
|
||||||
"authorGit": "https://github.com/avaksru",
|
"authorGit": "https://github.com/avaksru",
|
||||||
"specialThanks": "",
|
"specialThanks": "",
|
||||||
"moduleName": "ExternalMQTT",
|
"moduleName": "ExternalMQTT",
|
||||||
@@ -53,6 +52,7 @@
|
|||||||
"usedLibs": {
|
"usedLibs": {
|
||||||
"esp32_4mb": [],
|
"esp32_4mb": [],
|
||||||
"esp32s2_4mb": [],
|
"esp32s2_4mb": [],
|
||||||
|
"esp32cam_4mb": [],
|
||||||
"esp8266_4mb": [],
|
"esp8266_4mb": [],
|
||||||
"esp8266_1mb": [],
|
"esp8266_1mb": [],
|
||||||
"esp8266_1mb_ota": [],
|
"esp8266_1mb_ota": [],
|
||||||
|
|||||||
Reference in New Issue
Block a user