@ -125,7 +125,7 @@ void app::loop(void) {
mPayload[iv->id].txId = p->packet[0];
DPRINTLN(DBG_DEBUG, F("Response from devcontrol request received"));
iv->devControlRequest = false;
if (p->packet[12] == ActivePowerContr && p->packet[13] == 0x00) {
if ((p->packet[12] == ActivePowerContr) && (p->packet[13] == 0x00)) {
if (p->packet[10] == 0x00 && p->packet[11] == 0x00)
DPRINTLN(DBG_INFO, F("Inverter ") + String(iv->id) + F(" has accepted power limit set point ") + String(iv->powerLimit[0]) + F(" with PowerLimitControl ") + String(iv->powerLimit[1]));
else
@ -42,9 +42,9 @@
<select name="pwrlimcntrl" id="pwrlimcntrl">
<option value="" selected disabled hidden>select the unit and persistence</option>
<option value="0">absolute in Watt non persistent</option>
<option value="1">relativ in percent non persistent</option>
<option value="1">relative in percent non persistent</option>
<option value="256">absolute in Watt persistent</option>
<option value="257">relativ in percent persistent</option>
<option value="257">relative in percent persistent</option>
</select>
<br/>
<input type="button" value="Send Power Limit" class="btn" id="sendpwrlim"/>
@ -135,16 +135,17 @@
function apiCb(obj) {
var e = document.getElementById("apiResult");
if(obj["success"])
e.innerHTML = "ok";
e.innerHTML = "command excuted";
e.innerHTML = "Error: " + obj["error"];
}
function setTime() {
var date = new Date();
var offset = date.getTimezoneOffset() * -60;
var obj = new Object();
obj.cmd = "set_time";
obj.ts = parseInt(date.getTime() / 1000);
obj.ts = parseInt(offset + (date.getTime() / 1000));
getAjax("/api/setup", apiCb, "POST", JSON.stringify(obj));
@ -392,12 +392,10 @@ bool webApi::setCtrl(DynamicJsonDocument jsonIn, JsonObject jsonOut) {
//-----------------------------------------------------------------------------
bool webApi::setSetup(DynamicJsonDocument jsonIn, JsonObject jsonOut) {
if(F("set_time") == jsonIn[F("cmd")]) {
if(F("set_time") == jsonIn[F("cmd")])
mApp->setTimestamp(jsonIn[F("ts")]);
else if(F("sync_ntp") == jsonIn[F("cmd")]) {
else if(F("sync_ntp") == jsonIn[F("cmd")])
mApp->setTimestamp(0); // 0: update ntp flag
else {
jsonOut[F("error")] = F("unknown cmd");
return false;