Browse Source

0.8.970002-zero

pull/1535/head
Patrick Amrhein 10 months ago
parent
commit
dab72f3777
  1. 2
      src/config/settings.h
  2. 2
      src/defines.h
  3. 5
      src/plugins/zeroExport/zeroExport.h
  4. 64
      src/web/html/setup.html

2
src/config/settings.h

@ -188,7 +188,7 @@ typedef struct {
// Plugin ZeroExport // Plugin ZeroExport
#if defined(PLUGIN_ZEROEXPORT) #if defined(PLUGIN_ZEROEXPORT)
//#define ZEROEXPORT_DEV_POWERMETER #define ZEROEXPORT_DEV_POWERMETER
#define ZEROEXPORT_MAX_GROUPS 6 #define ZEROEXPORT_MAX_GROUPS 6
#define ZEROEXPORT_GROUP_MAX_LEN_NAME 25 #define ZEROEXPORT_GROUP_MAX_LEN_NAME 25
#define ZEROEXPORT_GROUP_MAX_LEN_PM_URL 100 #define ZEROEXPORT_GROUP_MAX_LEN_PM_URL 100

2
src/defines.h

@ -13,7 +13,7 @@
//------------------------------------- //-------------------------------------
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 8 #define VERSION_MINOR 8
#define VERSION_PATCH 970001 #define VERSION_PATCH 970002
//------------------------------------- //-------------------------------------
typedef struct { typedef struct {

5
src/plugins/zeroExport/zeroExport.h

@ -50,9 +50,6 @@ class ZeroExport {
mMqtt = mqtt; mMqtt = mqtt;
mIsInitialized = mPowermeter.setup(mCfg); mIsInitialized = mPowermeter.setup(mCfg);
// TODO: Sicherheitsreturn weil noch Sicherheitsfunktionen fehlen.
mIsInitialized = false;
} }
/** loop /** loop
@ -916,7 +913,7 @@ result = true;
mLog[String(i)] = String(i) + String(" grpTarget: ") + String(grpTarget[i]) + String(": ivPmin: ") + String(ivPmin[i]) + String(": ivPmax: ") + String(ivPmax[i]) + String(": ivId_Pmin: ") + String(ivId_Pmin[i]) + String(": ivId_Pmax: ") + String(ivId_Pmax[i]); mLog[String(i)] = String(i) + String(" grpTarget: ") + String(grpTarget[i]) + String(": ivPmin: ") + String(ivPmin[i]) + String(": ivPmax: ") + String(ivPmax[i]) + String(": ivId_Pmin: ") + String(ivId_Pmin[i]) + String(": ivId_Pmax: ") + String(ivId_Pmax[i]);
} }
for (uint8_t i = 7; i > 0; --i) { for (int8_t i = (7 - 1); i >= 0; i--) {
if (!grpTarget[i]) { if (!grpTarget[i]) {
continue; continue;
} }

64
src/web/html/setup.html

@ -1349,6 +1349,14 @@
divRow("{#ZE_GROUP_TAB_GENERAL_GRUPPE}", String(obj.id)), divRow("{#ZE_GROUP_TAB_GENERAL_GRUPPE}", String(obj.id)),
divRow("{#ZE_GROUP_TAB_GENERAL_ENABLE}", cbEnabled), divRow("{#ZE_GROUP_TAB_GENERAL_ENABLE}", cbEnabled),
divRow("{#ZE_GROUP_TAB_GENERAL_NAME}", ml("input", {name: "name", class: "text", type: "text", value: obj.name}, null)), divRow("{#ZE_GROUP_TAB_GENERAL_NAME}", ml("input", {name: "name", class: "text", type: "text", value: obj.name}, null)),
// TODO: Uebersetzen mit lang.json und auf die entsprechende Dokuseite verlinken
divRow("Hinweis: ",
ml("a", {href: "https://docs.ahoydtu.de/de/latest/zeroExport.html"}, "Bitte beachten Sie die Ausfüllhinweise in der Dokumentation."),
),
// TODO: Hinweis Github/Discord - Entfernen wenn erledigt
divRow("ACHTUNG: ",
ml("a", {href: "https://discord.com/channels/984173303147155506/1211365440253726851"}, "Bitte auf Github keine Issues zu Zero eröffnen, sondern direkt im Discord melden."),
),
]), ]),
// Powermeter // Powermeter
ml("div", {id: "div{#ZE_GROUP_TAB_POWERMETER}", class: "tab-content hide"}, [ ml("div", {id: "div{#ZE_GROUP_TAB_POWERMETER}", class: "tab-content hide"}, [
@ -1357,19 +1365,9 @@
), ),
divRow("{#ZE_GROUP_TAB_POWERMETER_URL}", [ divRow("{#ZE_GROUP_TAB_POWERMETER_URL}", [
ml("input", {name: "pm_url", class: "text", type: "text", value: obj.pm_url, maxlength: "100"}, null), ml("input", {name: "pm_url", class: "text", type: "text", value: obj.pm_url, maxlength: "100"}, null),
// TODO: Hilfstexte -> �bersetzen mit lang.json
ml("p", {}, "(3em) - http://IP/status"),
ml("p", {}, "(pro3em) - http://IP/rpc/Shelly.GetStatus"),
ml("p", {}, "(plus1pm) - http://IP/rpc/Shelly.GetStatus"),
ml("p", {}, "(plus2pm) - http://IP/rpc/Shelly.GetStatus"),
ml("p", {}, "(plus1pmAlternative) - http://IP/rpc/switch.GetStatus?id=0"),
ml("p", {}, "(plus2pmAlternative) - http://IP/rpc/switch.GetStatus?id=0"),
// ml("p", {}, "A JSON-Format is required to work properly.<br>HICHI: http://IP_Address/cm?cmnd=status%208"),
]), ]),
divRow("{#ZE_GROUP_TAB_POWERMETER_JSONPATH}", [ divRow("{#ZE_GROUP_TAB_POWERMETER_JSONPATH}", [
ml("input", {name: "pm_jsonPath", class: "text", type: "text", value: obj.pm_jsonPath}, null), ml("input", {name: "pm_jsonPath", class: "text", type: "text", value: obj.pm_jsonPath}, null),
// TODO: Hilfstexte -> �bersetzen mit lang.json
// ml("p", {}, "Only for HICHI needed!"),
]), ]),
divRow("{#ZE_GROUP_TAB_POWERMETER_USER}", divRow("{#ZE_GROUP_TAB_POWERMETER_USER}",
ml("input", {name: "pm_user", class: "text", type: "text", value: obj.pm_user}, null), ml("input", {name: "pm_user", class: "text", type: "text", value: obj.pm_user}, null),
@ -1377,10 +1375,26 @@
divRow("{#ZE_GROUP_TAB_POWERMETER_PASS}", divRow("{#ZE_GROUP_TAB_POWERMETER_PASS}",
ml("input", {name: "pm_pass", class: "text", type: "text", value: obj.pm_pass}, null), ml("input", {name: "pm_pass", class: "text", type: "text", value: obj.pm_pass}, null),
), ),
// TODO: Uebersetzen mit lang.json und auf die entsprechende Dokuseite verlinken
divRow("Hinweis: ",
ml("a", {href: "https://docs.ahoydtu.de/de/latest/zeroExport.html"}, "Bitte beachten Sie die Ausf&uuml;llhinweise in der Dokumentation."),
),
// TODO: Hinweis Github/Discord - Entfernen wenn erledigt
divRow("ACHTUNG: ",
ml("a", {href: "https://discord.com/channels/984173303147155506/1211365440253726851"}, "Bitte auf Github keine Issues zu Zero eröffnen, sondern direkt im Discord melden."),
),
]), ]),
// Inverter // Inverter
ml("div", {id: "div{#ZE_GROUP_TAB_INVERTER}", class: "tab-content hide"}, [ ml("div", {id: "div{#ZE_GROUP_TAB_INVERTER}", class: "tab-content hide"}, [
ml("table", {class: "table"}, ml("tbody", {}, lines)), ml("table", {class: "table"}, ml("tbody", {}, lines)),
// TODO: Uebersetzen mit lang.json und auf die entsprechende Dokuseite verlinken
divRow("Hinweis: ",
ml("a", {href: "https://docs.ahoydtu.de/de/latest/zeroExport.html"}, "Bitte beachten Sie die Ausf&uuml;llhinweise in der Dokumentation."),
),
// TODO: Hinweis Github/Discord - Entfernen wenn erledigt
divRow("ACHTUNG: ",
ml("a", {href: "https://discord.com/channels/984173303147155506/1211365440253726851"}, "Bitte auf Github keine Issues zu Zero eröffnen, sondern direkt im Discord melden."),
),
]), ]),
// Battery // Battery
ml("div", {id: "div{#ZE_GROUP_TAB_BATTERY}", class: "tab-content hide"}, [ ml("div", {id: "div{#ZE_GROUP_TAB_BATTERY}", class: "tab-content hide"}, [
@ -1388,6 +1402,14 @@
divRow("{#ZE_GROUP_TAB_BATTERY_BATTVOLTAGEON}", ml("input", {name: "battVoltageOn", class: "text", type: "number", min: "0", max: "100", step: "0.1", value: obj.battVoltageOn}, null)), divRow("{#ZE_GROUP_TAB_BATTERY_BATTVOLTAGEON}", ml("input", {name: "battVoltageOn", class: "text", type: "number", min: "0", max: "100", step: "0.1", value: obj.battVoltageOn}, null)),
divRow("{#ZE_GROUP_TAB_BATTERY_BATTVOLTAGEOFF}", ml("input", {name: "battVoltageOff", class: "text", type: "number", min: "0", max: "100", step: "0.1", value: obj.battVoltageOff}, null)), divRow("{#ZE_GROUP_TAB_BATTERY_BATTVOLTAGEOFF}", ml("input", {name: "battVoltageOff", class: "text", type: "number", min: "0", max: "100", step: "0.1", value: obj.battVoltageOff}, null)),
divRow("{#ZE_GROUP_TAB_BATTERY_ONOFF}", ml("input", {name: "battSwitch", id: "battSwitch", class: "btn", type: "button", value: "{#BTN_ONOFF}", onclick: battOnOff()}, null)), divRow("{#ZE_GROUP_TAB_BATTERY_ONOFF}", ml("input", {name: "battSwitch", id: "battSwitch", class: "btn", type: "button", value: "{#BTN_ONOFF}", onclick: battOnOff()}, null)),
// TODO: Uebersetzen mit lang.json und auf die entsprechende Dokuseite verlinken
divRow("Hinweis: ",
ml("a", {href: "https://docs.ahoydtu.de/de/latest/zeroExport.html"}, "Bitte beachten Sie die Ausf&uuml;llhinweise in der Dokumentation."),
),
// TODO: Hinweis Github/Discord - Entfernen wenn erledigt
divRow("ACHTUNG: ",
ml("a", {href: "https://discord.com/channels/984173303147155506/1211365440253726851"}, "Bitte auf Github keine Issues zu Zero eröffnen, sondern direkt im Discord melden."),
),
]), ]),
// Advanced // Advanced
ml("div", {id: "div{#ZE_GROUP_TAB_ADVANCED}", class: "tab-content hide"}, [ ml("div", {id: "div{#ZE_GROUP_TAB_ADVANCED}", class: "tab-content hide"}, [
@ -1398,11 +1420,19 @@
divRow("{#ZE_GROUP_TAB_ADVANCED_KP}", ml("input", {name: "Kp", class: "text", type: "number", min: "-1", max: "0", step: "0.001", value: obj.Kp}, null)), divRow("{#ZE_GROUP_TAB_ADVANCED_KP}", ml("input", {name: "Kp", class: "text", type: "number", min: "-1", max: "0", step: "0.001", value: obj.Kp}, null)),
divRow("{#ZE_GROUP_TAB_ADVANCED_KI}", ml("input", {name: "Ki", class: "text", type: "number", min: "-0.01", max: "0", step: "0.001", value: obj.Ki}, null)), divRow("{#ZE_GROUP_TAB_ADVANCED_KI}", ml("input", {name: "Ki", class: "text", type: "number", min: "-0.01", max: "0", step: "0.001", value: obj.Ki}, null)),
divRow("{#ZE_GROUP_TAB_ADVANCED_KD}", ml("input", {name: "Kd", class: "text", type: "number", min: "-0.01", max: "0", step: "0.001", value: obj.Kd}, null)), divRow("{#ZE_GROUP_TAB_ADVANCED_KD}", ml("input", {name: "Kd", class: "text", type: "number", min: "-0.01", max: "0", step: "0.001", value: obj.Kd}, null)),
// TODO: Uebersetzen mit lang.json und auf die entsprechende Dokuseite verlinken
divRow("Hinweis: ",
ml("a", {href: "https://docs.ahoydtu.de/de/latest/zeroExport.html"}, "Bitte beachten Sie die Ausf&uuml;llhinweise in der Dokumentation."),
),
// TODO: Hinweis Github/Discord - Entfernen wenn erledigt
divRow("ACHTUNG: ",
ml("a", {href: "https://discord.com/channels/984173303147155506/1211365440253726851"}, "Bitte auf Github keine Issues zu Zero eröffnen, sondern direkt im Discord melden."),
),
]), ]),
// Global // Global
ml("div", {class: "row mt-5"}, [ ml("div", {class: "row mt-5"}, [
ml("div", {class: "col-8", id: "res"}, ""), ml("div", {class: "col-8", id: "res"}, ""),
ml("div", {class: "col-4 a-r"}, ml("input", {type: "button", value: "{#ZE_GROUP_EDIT_BTN_SAVE}", class: "btn", onclick: function() { save(); }}, null)) ml("div", {class: "col-4 a-r"}, ml("input", {type: "button", value: "{#ZE_GROUP_EDIT_BTN_SAVE}", class: "btn", onclick: function() { save(); }}, null)),
]) ])
]); ]);
@ -1651,6 +1681,18 @@
var e = document.getElementById("ze_groups"); var e = document.getElementById("ze_groups");
e.innerHTML = ""; // remove all childs e.innerHTML = ""; // remove all childs
e.append(ml("table", {class: "table"}, ml("tbody", {}, lines))); e.append(ml("table", {class: "table"}, ml("tbody", {}, lines)));
// TODO: Uebersetzen mit lang.json und auf die entsprechende Dokuseite verlinken
e.append(
divRow("Hinweis: ",
ml("a", {href: "https://docs.ahoydtu.de/de/latest/zeroExport.html"}, "Bitte beachten Sie die Ausf&uuml;llhinweise in der Dokumentation."),
),
);
// TODO: Hinweis Github/Discord - Entfernen wenn erledigt
e.append(
divRow("ACHTUNG: ",
ml("a", {href: "https://discord.com/channels/984173303147155506/1211365440253726851"}, "Bitte auf Github keine Issues zu Zero eröffnen, sondern direkt im Discord melden."),
),
);
if(maxGroups > obj.groups.length) { if(maxGroups > obj.groups.length) {
e.append(ml("div", {class: "row my-3"}, ml("div", {class: "col a-r"}, ml("input", {type: "button", value: "{#BTN_INV_ADD}", class: "btn", onclick: function() { ZeroExportGroup_Modal(add); }}, null)))); e.append(ml("div", {class: "row my-3"}, ml("div", {class: "col a-r"}, ml("input", {type: "button", value: "{#BTN_INV_ADD}", class: "btn", onclick: function() { ZeroExportGroup_Modal(add); }}, null))));
} }

Loading…
Cancel
Save