Browse Source

Inverter Ausschalten wenn Aufgrund der Leistung

nicht erforderlich konfigurierbar
pull/1615/head
Patrick Amrhein 9 months ago
parent
commit
9428bdc73a
  1. 5
      src/config/settings.h
  2. 3
      src/plugins/zeroExport/zeroExport.h
  3. 2
      src/web/RestApi.h
  4. 18
      src/web/html/setup.html
  5. 5
      src/web/lang.json

5
src/config/settings.h

@ -262,6 +262,7 @@ typedef struct {
int8_t target; int8_t target;
uint16_t powerMin; uint16_t powerMin;
uint16_t powerMax; uint16_t powerMax;
bool turnOff;
// //
zeroExportAction_t action; zeroExportAction_t action;
@ -681,6 +682,7 @@ class settings {
mCfg.plugin.zeroExport.groups[group].inverters[inv].target = -1; mCfg.plugin.zeroExport.groups[group].inverters[inv].target = -1;
mCfg.plugin.zeroExport.groups[group].inverters[inv].powerMin = 10; mCfg.plugin.zeroExport.groups[group].inverters[inv].powerMin = 10;
mCfg.plugin.zeroExport.groups[group].inverters[inv].powerMax = 600; mCfg.plugin.zeroExport.groups[group].inverters[inv].powerMax = 600;
mCfg.plugin.zeroExport.groups[group].inverters[inv].turnOff = false;
// //
mCfg.plugin.zeroExport.groups[group].inverters[inv].waitAck = 0; mCfg.plugin.zeroExport.groups[group].inverters[inv].waitAck = 0;
mCfg.plugin.zeroExport.groups[group].inverters[inv].action = zeroExportAction_t::doNone; mCfg.plugin.zeroExport.groups[group].inverters[inv].action = zeroExportAction_t::doNone;
@ -1006,6 +1008,7 @@ class settings {
obj[F("target")] = mCfg.plugin.zeroExport.groups[group].inverters[inv].target; obj[F("target")] = mCfg.plugin.zeroExport.groups[group].inverters[inv].target;
obj[F("powerMin")] = mCfg.plugin.zeroExport.groups[group].inverters[inv].powerMin; obj[F("powerMin")] = mCfg.plugin.zeroExport.groups[group].inverters[inv].powerMin;
obj[F("powerMax")] = mCfg.plugin.zeroExport.groups[group].inverters[inv].powerMax; obj[F("powerMax")] = mCfg.plugin.zeroExport.groups[group].inverters[inv].powerMax;
obj[F("turnOff")] = mCfg.plugin.zeroExport.groups[group].inverters[inv].turnOff;
} else { } else {
if (obj.containsKey(F("enabled"))) if (obj.containsKey(F("enabled")))
getVal<bool>(obj, F("enabled"), &mCfg.plugin.zeroExport.groups[group].inverters[inv].enabled); getVal<bool>(obj, F("enabled"), &mCfg.plugin.zeroExport.groups[group].inverters[inv].enabled);
@ -1017,6 +1020,8 @@ class settings {
getVal<uint16_t>(obj, F("powerMin"), &mCfg.plugin.zeroExport.groups[group].inverters[inv].powerMin); getVal<uint16_t>(obj, F("powerMin"), &mCfg.plugin.zeroExport.groups[group].inverters[inv].powerMin);
if (obj.containsKey(F("powerMax"))) if (obj.containsKey(F("powerMax")))
getVal<uint16_t>(obj, F("powerMax"), &mCfg.plugin.zeroExport.groups[group].inverters[inv].powerMax); getVal<uint16_t>(obj, F("powerMax"), &mCfg.plugin.zeroExport.groups[group].inverters[inv].powerMax);
if (obj.containsKey(F("turnOff")))
getVal<bool>(obj, F("turnOff"), &mCfg.plugin.zeroExport.groups[group].inverters[inv].turnOff);
} }
} }

3
src/plugins/zeroExport/zeroExport.h

@ -253,8 +253,7 @@ class ZeroExport {
mLog["do"] = "doTurnOn"; mLog["do"] = "doTurnOn";
} }
} }
// TODO: hier kommt eine CheckBox je Gruppe rein, die es verhindert, dass Inv ausgeschaltet werden. if ((CfgGroupInv->turnOff) && (CfgGroupInv->limitNew <= 0) && (CfgGroupInv->power > 0)) {
if ((CfgGroupInv->limitNew <= 0) && (CfgGroupInv->power > 0)) {
if (CfgGroupInv->actionTimer > 0) CfgGroupInv->actionTimer = 0; if (CfgGroupInv->actionTimer > 0) CfgGroupInv->actionTimer = 0;
if (CfgGroupInv->actionTimer == 0) CfgGroupInv->actionTimer = -1; if (CfgGroupInv->actionTimer == 0) CfgGroupInv->actionTimer = -1;
if (CfgGroupInv->actionTimer < 30) { if (CfgGroupInv->actionTimer < 30) {

2
src/web/RestApi.h

@ -852,6 +852,7 @@ class RestApi {
objGroupInv[F("target")] = (int8_t)mConfig->plugin.zeroExport.groups[group].inverters[inv].target; objGroupInv[F("target")] = (int8_t)mConfig->plugin.zeroExport.groups[group].inverters[inv].target;
objGroupInv[F("powerMin")] = (uint16_t)mConfig->plugin.zeroExport.groups[group].inverters[inv].powerMin; objGroupInv[F("powerMin")] = (uint16_t)mConfig->plugin.zeroExport.groups[group].inverters[inv].powerMin;
objGroupInv[F("powerMax")] = (uint16_t)mConfig->plugin.zeroExport.groups[group].inverters[inv].powerMax; objGroupInv[F("powerMax")] = (uint16_t)mConfig->plugin.zeroExport.groups[group].inverters[inv].powerMax;
objGroupInv[F("turnOff")] = (uint16_t)mConfig->plugin.zeroExport.groups[group].inverters[inv].turnOff;
} }
// Battery // Battery
objGroup[F("battEnabled")] = (bool)mConfig->plugin.zeroExport.groups[group].battEnabled; objGroup[F("battEnabled")] = (bool)mConfig->plugin.zeroExport.groups[group].battEnabled;
@ -1167,6 +1168,7 @@ class RestApi {
mConfig->plugin.zeroExport.groups[group].inverters[inv].target = jsonIn[F("inverters")][inv][F("target")]; mConfig->plugin.zeroExport.groups[group].inverters[inv].target = jsonIn[F("inverters")][inv][F("target")];
mConfig->plugin.zeroExport.groups[group].inverters[inv].powerMin = jsonIn[F("inverters")][inv][F("powerMin")]; mConfig->plugin.zeroExport.groups[group].inverters[inv].powerMin = jsonIn[F("inverters")][inv][F("powerMin")];
mConfig->plugin.zeroExport.groups[group].inverters[inv].powerMax = jsonIn[F("inverters")][inv][F("powerMax")]; mConfig->plugin.zeroExport.groups[group].inverters[inv].powerMax = jsonIn[F("inverters")][inv][F("powerMax")];
mConfig->plugin.zeroExport.groups[group].inverters[inv].turnOff = jsonIn[F("inverters")][inv][F("turnOff")];
} }
// Battery // Battery
mConfig->plugin.zeroExport.groups[group].battEnabled = jsonIn[F("battEnabled")]; mConfig->plugin.zeroExport.groups[group].battEnabled = jsonIn[F("battEnabled")];

18
src/web/html/setup.html

@ -1324,6 +1324,7 @@
ml("th", {}, "{#ZE_GROUP_TAB_INVERTER_SUM}"), ml("th", {}, "{#ZE_GROUP_TAB_INVERTER_SUM}"),
ml("th", {style: "width: 15%;"}, "{#ZE_GROUP_TAB_INVERTER_POWERMIN}"), ml("th", {style: "width: 15%;"}, "{#ZE_GROUP_TAB_INVERTER_POWERMIN}"),
ml("th", {style: "width: 15%;"}, "{#ZE_GROUP_TAB_INVERTER_POWERMAX}"), ml("th", {style: "width: 15%;"}, "{#ZE_GROUP_TAB_INVERTER_POWERMAX}"),
ml("th", {style: "width: 5%;"}, "{#ZE_GROUP_TAB_INVERTER_TURNOFF}"),
])); ]));
for(var inv = 0; inv < maxInv; inv++) { for(var inv = 0; inv < maxInv; inv++) {
@ -1331,7 +1332,7 @@
ml("td", {}, String(inv)), ml("td", {}, String(inv)),
ml("td", {}, ml("td", {},
ml("div", {}, [ ml("div", {}, [
ml("input", {name: "invEnabled"+inv, class: "text", id: "invEnabled"+inv, type: "checkbox"}, null) ml("input", {name: "invEnabled"+inv, class: "text", id: "invEnabled"+inv, type: "checkbox"}, null)
]), ]),
), ),
ml("td", {}, ml("td", {},
@ -1354,6 +1355,11 @@
ml("input", {name: "invPowerMax"+inv, class: "text", id: "invPowerMax"+inv, type: "number", min: "0", max: "65535"}, null) ml("input", {name: "invPowerMax"+inv, class: "text", id: "invPowerMax"+inv, type: "number", min: "0", max: "65535"}, null)
]), ]),
), ),
ml("td", {},
ml("div", {}, [
ml("input", {name: "invTurnOff"+inv, class: "text", id: "invTurnOff"+inv, type: "checkbox"}, null)
]),
),
])); ]));
} }
@ -1384,6 +1390,10 @@
]), ]),
// 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"}, [
// TODO: add
//divRow("{#ZE_GROUP_TAB_POWERMETER_REFRESH}",
//ml("select", {name: "pm_refresh", class: "text", type: "text", value: obj.pm_refresh}, null),
//),
divRow("{#ZE_GROUP_TAB_POWERMETER_TYPE}", divRow("{#ZE_GROUP_TAB_POWERMETER_TYPE}",
ml("select", {name: "pm_type", class: "text", id: "pm_type"}, null), ml("select", {name: "pm_type", class: "text", id: "pm_type"}, null),
), ),
@ -1531,6 +1541,11 @@
var e = document.getElementById("invPowerMax"+inv); var e = document.getElementById("invPowerMax"+inv);
e.value = (obj.inverters[inv].powerMax); e.value = (obj.inverters[inv].powerMax);
} }
// - TurnOff
for (var inv = 0; inv < maxInv; inv++) {
var e = document.getElementById("invTurnOff"+inv);
e.checked = (obj.inverters[inv].turnOff);
}
function save() { function save() {
var o = new Object(); var o = new Object();
@ -1560,6 +1575,7 @@
q.target = e.options[e.selectedIndex].value; q.target = e.options[e.selectedIndex].value;
q.powerMin = document.getElementById("invPowerMin"+inv).value; q.powerMin = document.getElementById("invPowerMin"+inv).value;
q.powerMax = document.getElementById("invPowerMax"+inv).value; q.powerMax = document.getElementById("invPowerMax"+inv).value;
q.turnOff = document.getElementById("invTurnOff"+inv).checked;
o.inverters.push(q); o.inverters.push(q);
} }
// Battery // Battery

5
src/web/lang.json

@ -938,6 +938,11 @@
"en": "Power (Max)", "en": "Power (Max)",
"de": "Leistung (Max)" "de": "Leistung (Max)"
}, },
{
"token": "ZE_GROUP_TAB_INVERTER_TURNOFF",
"en": "Turn On/Off",
"de": "Schalte Ein/Aus"
},
{ {
"token": "ZE_GROUP_TAB_BATTERY", "token": "ZE_GROUP_TAB_BATTERY",
"en": "Battery", "en": "Battery",

Loading…
Cancel
Save