Posiadam falownik FRONIUS, dostęp do parametrów jest bez loginu i hasła.
Można też pobierać parametry parsując JSON'a. Parametry są pod stałym linkiem "http://IP_FALOWNIKA/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DeviceID=1&DataCollection=CommonInverterData"
Kod: Zaznacz cały
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <ArduinoJson.h>
const char* ssid = "SSIDI";
const char* password = "password";
void setup () {
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting..");
}
Serial.println("Connected..");
}
void loop() {
if (WiFi.status() == WL_CONNECTED) {
HTTPClient http;
http.begin("http://IP_FALOWNIKA/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DeviceID=1&DataCollection=CommonInverterData");
int httpCode = http.GET();
const size_t capacity = JSON_OBJECT_SIZE(3) + JSON_ARRAY_SIZE(2) + 60;
DynamicJsonDocument doc(capacity);
String payload = http.getString(); //Get the request response payload
deserializeJson(doc, payload);
JsonObject Body_Data = doc["Body"]["Data"];
Serial.println("JSON print..");
float Body_Data_DAY_ENERGY_Value = Body_Data["DAY_ENERGY"]["Value"];
Serial.print("Ernergia: ");
Serial.println(Body_Data_DAY_ENERGY_Value);
int Body_Data_PAC_Value = Body_Data["PAC"]["Value"];
Serial.print("Bieżąca moc całkowita: ");
Serial.println(Body_Data_PAC_Value);
Serial.println("JSON end print..");
Serial.println("");
http.end();
}
delay(10000);
}