Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Includes
- #include <ESP8266WiFi.h>
- //#include <WiFiClient.h>
- #include <ESP8266WebServer.h>
- #include <SimpleModbusMaster.h>
- #include <PubSubClient.h>
- //Modbus Config
- #define TxEnablePin D3 // RS485 modbus direction control pin:
- #define baud 9600 // modbus port speed:
- #define timeout 2000 // modbus timeout in mSec:
- #define polling 1000 // modbus scan rate in mSec:
- #define retry_count 0
- #define TOTAL_NO_OF_REGISTERS 400 // number of registers to poll for:
- //Network settings for client and server
- const char* ssid = "linksys"; // SSID des vorhandenen WLANs
- const char* password = "qwertzuiopasdfghjkl"; // Passwort für das vorhandene WLAN
- const char* mqtt_server = "192.168.1.16";
- WiFiClient espClient;
- PubSubClient client(espClient);
- long lastMsg = 0;
- char msg[50];
- int value = 0;
- IPAddress gateway(192, 168, 1, 1); // IP-Adresse des WLAN-Gateways
- IPAddress subnet(255, 255, 255, 0); // Subnetzmaske
- IPAddress ip(192, 168, 1, 160); // feste IP-Adresse für den WeMos
- ESP8266WebServer server(80); // Webserver initialisieren auf Port 80
- //Variables SDM630
- float L1_N;
- float L2_N;
- float L3_N;
- float Strom_L1;
- float Strom_L2;
- float Strom_L3;
- float Watt_L1;
- float Watt_L2;
- float Watt_L3;
- float VA_L1;
- float VA_L2;
- float VA_L3;
- float VAR_L1;
- float VAR_L2;
- float VAR_L3;
- float Powerfactor_L1;
- float Powerfactor_L2;
- float Powerfactor_L3;
- float Phasenwinkel_L1;
- float Phasenwinkel_L2;
- float Phasenwinkel_L3;
- float Average_line_to_neutral_volts;
- float Average_line_current;
- float Sum_of_line_currents;
- float Total_System_Power;
- float Total_system_volt_amps;
- float Total_system_VAr;
- float Total_system_power_factor;
- float Total_system_phase_angle;
- float Netzfrequenz;
- float Total_system_VA_demand;
- float Neutral_current_demand;
- float Maximum_neutral_current_demand;
- float Line1_to_Line2_volts;
- float Line2_to_Line3_volts;
- float Line3_to_Line1_volts;
- float Neutral_current;
- float Total_KWh;
- float Total_KVArh;
- float L1_import_KWh;
- float L2_import_KWh;
- float L3_import_KWh;
- float L1_export_KWh;
- float L2_export_KWh;
- float L3_export_KWh;
- float L1_total_KWh;
- float L2_total_KWh;
- float L3_total_KWh;
- float L1_import_KVArh;
- float L2_import_KVArh;
- float L3_import_KVArh;
- float L1_export_KVArh;
- float L2_export_KVArh;
- float L3_export_KVArh;
- float L1_total_KVArh;
- float L2_total_KVArh;
- float L3_total_KVArh;
- enum
- {
- PACKET1,
- PACKET2,
- PACKET3,
- PACKET4,
- PACKET5,
- PACKET6,
- PACKET7,
- PACKET8,
- PACKET9,
- PACKET10,
- PACKET11,
- PACKET12,
- PACKET13,
- PACKET14,
- TOTAL_NO_OF_PACKETS // leave this last entry
- };
- Packet packets[TOTAL_NO_OF_PACKETS]; // array of Packets to be configured
- //Modbus Variables
- unsigned int regs[TOTAL_NO_OF_REGISTERS]; // master register array
- long previousMillis = 0;
- long interval = 30000;
- unsigned long currentMillis;
- //Webpage Variables
- char ConnectString[255] = "";
- String Antwort = "";
- //Start WiFi connection
- void WLANVerbindung()
- {
- // WLAN-Verbindung herstellen
- WiFi.config(ip, gateway, subnet); // auskommentieren, falls eine dynamische IP bezogen werden soll
- WiFi.begin(ssid, password);
- Serial.print("Verbindungsaufbau");
- Serial.println(" erfolgreich!");
- Serial.println("");
- Serial.print("Verbunden mit: ");
- Serial.println(ssid);
- Serial.print("Signalstaerke: ");
- int rssi = WiFi.RSSI();
- Serial.print(rssi);
- Serial.println(" dBm");
- Serial.print("IP-Adresse: ");
- Serial.println(WiFi.localIP());
- Serial.println("");
- sprintf(ConnectString, "</br></br>Verbunden mit: %s </br>Signalstaerke: %d dBm </br></br>", ssid, rssi);
- server.on("/", Hauptseite);
- // HTTP-Server starten
- server.begin();
- }
- //Build Webpage content
- void Hauptseite()
- {
- //Reset Antwort
- Antwort = "";
- Antwort += "<meta http-equiv='refresh' content='60'/>";
- Antwort += ConnectString;
- Antwort += "<html><body bgcolor='#CCC'>";
- String Nothing = "";
- Antwort += ZeigeWertOnline("L1_N", L1_N, 2, "V");
- Antwort += ZeigeWertOnline("L2_N", L2_N, 2, "V");
- Antwort += ZeigeWertOnline("L3_N", L3_N, 2, "V");
- Antwort += ZeigeWertOnline("Strom_L1", Strom_L1, 3, "A");
- Antwort += ZeigeWertOnline("Strom_L2", Strom_L2, 3, "A");
- Antwort += ZeigeWertOnline("Strom_L3", Strom_L3, 3, "A");
- Antwort += ZeigeWertOnline("Watt_L1", Watt_L1, 2, "W");
- Antwort += ZeigeWertOnline("Watt_L2", Watt_L2, 2, "W");
- Antwort += ZeigeWertOnline("Watt_L3", Watt_L3, 2, "W");
- Antwort += ZeigeWertOnline("VA_L1", VA_L1, 2, "W");
- Antwort += ZeigeWertOnline("VA_L2", VA_L2, 2, "W");
- Antwort += ZeigeWertOnline("VA_L3", VA_L3, 2, "W");
- Antwort += ZeigeWertOnline("VAR_L1", VAR_L1, 2, "VAr");
- Antwort += ZeigeWertOnline("VAR_L2", VAR_L2, 2, "VAr");
- Antwort += ZeigeWertOnline("VAR_L3", VAR_L3, 2, "VAr");
- Antwort += ZeigeWertOnline("Powerfactor_L1", Powerfactor_L1, 3, " ");
- Antwort += ZeigeWertOnline("Powerfactor_L2", Powerfactor_L2, 3, " ");
- Antwort += ZeigeWertOnline("Powerfactor_L3", Powerfactor_L3, 3, " ");
- Antwort += ZeigeWertOnline("Phasenwinkel_L1", Phasenwinkel_L1, 3, " ");
- Antwort += ZeigeWertOnline("Phasenwinkel_L2", Phasenwinkel_L2, 3, " ");
- Antwort += ZeigeWertOnline("Phasenwinkel_L3", Phasenwinkel_L3, 3, " ");
- Antwort += ZeigeWertOnline("Average_line_to_neutral_volts", Average_line_to_neutral_volts, 3, " ");
- Antwort += ZeigeWertOnline("Average_line_current", Average_line_current, 2, " ");
- Antwort += ZeigeWertOnline("Sum_of_line currents", Sum_of_line_currents, 2, " ");
- Antwort += ZeigeWertOnline("Total_System_Power", Total_System_Power, 2, " ");
- Antwort += ZeigeWertOnline("Total_system_volt_amps", Total_system_volt_amps , 2, " ");
- Antwort += ZeigeWertOnline("Total_system_VAr", Total_system_VAr , 2, " ");
- Antwort += ZeigeWertOnline("Total_system_power_factor", Total_system_power_factor , 2, " ");
- Antwort += ZeigeWertOnline("Total_system_phase_angle", Total_system_phase_angle , 2, " ");
- Antwort += ZeigeWertOnline("Netzfrequenz", Netzfrequenz , 2, " ");
- Antwort += ZeigeWertOnline("Total_system_VA_demand", Total_system_VA_demand , 2, " ");
- Antwort += ZeigeWertOnline("Neutral_current_demand", Neutral_current_demand , 2, " ");
- Antwort += ZeigeWertOnline("Maximum_neutral_current_demand", Maximum_neutral_current_demand , 2, " ");
- Antwort += ZeigeWertOnline("Line1_to_Line2_volts", Line1_to_Line2_volts , 2, " ");
- Antwort += ZeigeWertOnline("Line2_to_Line3_volts", Line2_to_Line3_volts , 2, " ");
- Antwort += ZeigeWertOnline("Line3_to_Line1_volts", Line3_to_Line1_volts , 2, " ");
- Antwort += ZeigeWertOnline("Neutral_current", Neutral_current , 2, " ");
- Antwort += ZeigeWertOnline("Total_KWh", Total_KWh , 2, " ");
- Antwort += ZeigeWertOnline("Total_KVArh", Total_KVArh , 2, " ");
- Antwort += ZeigeWertOnline("L1_import_KWh", L1_import_KWh , 2, " ");
- Antwort += ZeigeWertOnline("L2_import_KWh", L2_import_KWh , 2, " ");
- Antwort += ZeigeWertOnline("L3_import_KWh", L3_import_KWh , 2, " ");
- Antwort += ZeigeWertOnline("L3_import_KWh", L3_import_KWh , 2, " ");
- Antwort += ZeigeWertOnline("L1_export_KWh", L1_export_KWh , 2, " ");
- Antwort += ZeigeWertOnline("L2_export_KWh", L2_export_KWh , 2, " ");
- Antwort += ZeigeWertOnline("L3_export_KWh", L3_export_KWh , 2, " ");
- Antwort += ZeigeWertOnline("L1_total_KWh", L1_total_KWh , 2, " ");
- Antwort += ZeigeWertOnline("L2_total_KWh", L2_total_KWh , 2, " ");
- Antwort += ZeigeWertOnline("L3_total_KWh", L3_total_KWh , 2, " ");
- Antwort += ZeigeWertOnline("L1_import_KVArh", L1_import_KVArh , 2, " ");
- Antwort += ZeigeWertOnline("L2_import_KVArh", L2_import_KVArh , 2, " ");
- Antwort += ZeigeWertOnline("L3_import_KVArh", L3_import_KVArh , 2, " ");
- Antwort += ZeigeWertOnline("L1_export_KVArh", L1_export_KVArh , 2, " ");
- Antwort += ZeigeWertOnline("L2_export_KVArh", L2_export_KVArh , 2, " ");
- Antwort += ZeigeWertOnline("L3_export_KVArh", L3_export_KVArh , 2, " ");
- Antwort += ZeigeWertOnline("L3_export_KVArh", L3_export_KVArh , 2, " ");
- Antwort += ZeigeWertOnline("L1_total_KVArh", L1_total_KVArh , 2, " ");
- Antwort += ZeigeWertOnline("L2_total_KVArh", L2_total_KVArh , 2, " ");
- Antwort += ZeigeWertOnline("L3_total_KVArh", L3_total_KVArh , 2, " ");
- //Packet Infos
- Antwort += String("</br>Requests: ");
- Antwort += String(packets[PACKET1].requests);
- Antwort += String("</br>Successful Requests: ");
- Antwort += String(packets[PACKET1].successful_requests);
- Antwort += String("</br>Failed Requests: ");
- Antwort += String(packets[PACKET1].failed_requests);
- Antwort += String("</br>Exception Errors: ");
- Antwort += String(packets[PACKET1].exception_errors);
- Antwort += String("</br>Requests: ");
- Antwort += String(packets[PACKET2].requests);
- Antwort += String("</br>Successful Requests: ");
- Antwort += String(packets[PACKET2].successful_requests);
- Antwort += String("</br>Failed Requests: ");
- Antwort += String(packets[PACKET2].failed_requests);
- Antwort += String("</br>Exception Errors: ");
- Antwort += String(packets[PACKET2].exception_errors);
- Antwort += String("</br>Requests: ");
- Antwort += String(packets[PACKET9].requests);
- Antwort += String("</br>Successful Requests: ");
- Antwort += String(packets[PACKET9].successful_requests);
- Antwort += String("</br>Failed Requests: ");
- Antwort += String(packets[PACKET9].failed_requests);
- Antwort += String("</br>Exception Errors: ");
- Antwort += String(packets[PACKET9].exception_errors);
- Antwort += "</body></html>";
- server.send ( 300, "text/html", Antwort );
- delay(100);
- //server.send(300, "text/plain", Antwort);
- //delay(150);
- }
- String ZeigeWertOnline(String Text, float WertFloat, int decimals, String Einheit)
- {
- return String(Text + ": " + String(WertFloat, decimals) + Einheit + "</br>");
- }
- void callback(char* topic, byte* payload, unsigned int length) {
- Serial.print("Message arrived [");
- Serial.print(topic);
- Serial.print("] ");
- for (int i = 0; i < length; i++) {
- Serial.print((char)payload[i]);
- }
- Serial.println();
- // Switch on the LED if an 1 was received as first character
- if ((char)payload[0] == '1') {
- digitalWrite(BUILTIN_LED, LOW); // Turn the LED on (Note that LOW is the voltage level
- // but actually the LED is on; this is because
- // it is active low on the ESP-01)
- } else {
- digitalWrite(BUILTIN_LED, HIGH); // Turn the LED off by making the voltage HIGH
- }
- }
- void reconnect() {
- // Loop until we're reconnected
- while (!client.connected()) {
- Serial.print("Attempting MQTT connection...");
- // Create a random client ID
- String clientId = "ESP8266Client-";
- clientId += String(random(0xffff), HEX);
- // Attempt to connect
- if (client.connect(clientId.c_str())) {
- Serial.println("connected");
- // Once connected, publish an announcement...
- client.publish("outTopic", "hello world");
- // ... and resubscribe
- client.subscribe("inTopic");
- } else {
- Serial.print("failed, rc=");
- Serial.print(client.state());
- Serial.println(" try again in 5 seconds");
- // Wait 5 seconds before retrying
- delay(5000);
- }
- }
- }
- //Software setup
- void setup()
- {
- client.setServer(mqtt_server, 1883);
- client.setCallback(callback);
- modbus_construct(&packets[PACKET1], 1, READ_INPUT_REGISTERS, 0, 20, 0); // initialize packet 1:
- modbus_construct(&packets[PACKET2], 1, READ_INPUT_REGISTERS, 20, 22, 20 ); // initialize packet 2:
- modbus_construct(&packets[PACKET3], 1, READ_INPUT_REGISTERS, 46, 4, 46 ); // initialize packet 3:
- modbus_construct(&packets[PACKET4], 1, READ_INPUT_REGISTERS, 52, 2, 52 ); // initialize packet 4:
- modbus_construct(&packets[PACKET5], 1, READ_INPUT_REGISTERS, 56, 2, 56 ); // initialize packet 5:
- modbus_construct(&packets[PACKET6], 1, READ_INPUT_REGISTERS, 60, 4, 60 ); // initialize packet 6:
- modbus_construct(&packets[PACKET7], 1, READ_INPUT_REGISTERS, 66, 2, 66 ); // initialize packet 7:
- modbus_construct(&packets[PACKET8], 1, READ_INPUT_REGISTERS, 70, 2, 70 ); // initialize packet 8:
- modbus_construct(&packets[PACKET9], 1, READ_INPUT_REGISTERS, 100, 2, 100 ); // initialize packet 9:
- modbus_construct(&packets[PACKET10], 1, READ_INPUT_REGISTERS, 104, 4, 104 ); // initialize packet 10:
- modbus_construct(&packets[PACKET11], 1, READ_INPUT_REGISTERS, 200, 6, 200 ); // initialize packet 11:
- modbus_construct(&packets[PACKET12], 1, READ_INPUT_REGISTERS, 224, 2, 224 ); // initialize packet 12:
- modbus_construct(&packets[PACKET13], 1, READ_INPUT_REGISTERS, 342, 20, 342 ); // initialize packet 13:
- modbus_construct(&packets[PACKET14], 1, READ_INPUT_REGISTERS, 362, 20, 362 ); // initialize packet 14:
- modbus_configure(&Serial, baud, SERIAL_8N1, timeout, polling, retry_count, TxEnablePin, packets, TOTAL_NO_OF_PACKETS, regs);
- delay(100);
- WLANVerbindung();
- WiFi.mode(WIFI_STA);
- }
- //Loop
- void loop()
- {
- if (!client.connected()) {
- reconnect();
- }
- client.loop();
- long now = millis();
- if (now - lastMsg > 2000) {
- lastMsg = now;
- ++value;
- snprintf (msg, 50, "hello world #%ld", value);
- Serial.print("Publish message: ");
- Serial.println(msg);
- client.publish("outTopic", msg);
- }
- //Modbus Update
- modbus_update();
- //Handle client requests
- server.handleClient(); // auf HTTP-Anfragen warten
- //Calculate SDM360 Vars
- unsigned long temp1 = (unsigned long) regs[0] << 16 | regs[1];
- unsigned long temp2 = (unsigned long) regs[2] << 16 | regs[3];
- unsigned long temp3 = (unsigned long) regs[4] << 16 | regs[5];
- unsigned long temp4 = (unsigned long) regs[6] << 16 | regs[7];
- unsigned long temp5 = (unsigned long) regs[8] << 16 | regs[9];
- unsigned long temp6 = (unsigned long) regs[10] << 16 | regs[11];
- unsigned long temp7 = (unsigned long) regs[12] << 16 | regs[13];
- unsigned long temp8 = (unsigned long) regs[14] << 16 | regs[15];
- unsigned long temp9 = (unsigned long) regs[16] << 16 | regs[17];
- unsigned long temp10 = (unsigned long) regs[18] << 16 | regs[19];
- unsigned long temp11 = (unsigned long) regs[20] << 16 | regs[21];
- unsigned long temp12 = (unsigned long) regs[22] << 16 | regs[23];
- unsigned long temp13 = (unsigned long) regs[24] << 16 | regs[25];
- unsigned long temp14 = (unsigned long) regs[26] << 16 | regs[27];
- unsigned long temp15 = (unsigned long) regs[28] << 16 | regs[29];
- unsigned long temp16 = (unsigned long) regs[30] << 16 | regs[31];
- unsigned long temp17 = (unsigned long) regs[32] << 16 | regs[33];
- unsigned long temp18 = (unsigned long) regs[34] << 16 | regs[35];
- unsigned long temp19 = (unsigned long) regs[36] << 16 | regs[37];
- unsigned long temp20 = (unsigned long) regs[38] << 16 | regs[39];
- unsigned long temp21 = (unsigned long) regs[40] << 16 | regs[41];
- unsigned long temp22 = (unsigned long) regs[42] << 16 | regs[43];
- unsigned long temp23 = (unsigned long) regs[46] << 16 | regs[47];
- unsigned long temp24 = (unsigned long) regs[48] << 16 | regs[49];
- unsigned long temp25 = (unsigned long) regs[52] << 16 | regs[53];
- unsigned long temp26 = (unsigned long) regs[56] << 16 | regs[57];
- unsigned long temp27 = (unsigned long) regs[60] << 16 | regs[61];
- unsigned long temp28 = (unsigned long) regs[62] << 16 | regs[63];
- unsigned long temp29 = (unsigned long) regs[66] << 16 | regs[67];
- unsigned long temp30 = (unsigned long) regs[70] << 16 | regs[71];
- unsigned long temp31 = (unsigned long) regs[100] << 16 | regs[101];
- unsigned long temp32 = (unsigned long) regs[104] << 16 | regs[105];
- unsigned long temp33 = (unsigned long) regs[106] << 16 | regs[107];
- unsigned long temp34 = (unsigned long) regs[200] << 16 | regs[201];
- unsigned long temp35 = (unsigned long) regs[202] << 16 | regs[203];
- unsigned long temp36 = (unsigned long) regs[204] << 16 | regs[205];
- unsigned long temp37 = (unsigned long) regs[224] << 16 | regs[225];
- unsigned long temp38 = (unsigned long) regs[342] << 16 | regs[343];
- unsigned long temp39 = (unsigned long) regs[344] << 16 | regs[345];
- unsigned long temp40 = (unsigned long) regs[346] << 16 | regs[347];
- unsigned long temp41 = (unsigned long) regs[348] << 16 | regs[349];
- unsigned long temp42 = (unsigned long) regs[350] << 16 | regs[351];
- unsigned long temp43 = (unsigned long) regs[352] << 16 | regs[353];
- unsigned long temp44 = (unsigned long) regs[354] << 16 | regs[355];
- unsigned long temp45 = (unsigned long) regs[356] << 16 | regs[357];
- unsigned long temp46 = (unsigned long) regs[358] << 16 | regs[359];
- unsigned long temp47 = (unsigned long) regs[360] << 16 | regs[361];
- unsigned long temp48 = (unsigned long) regs[362] << 16 | regs[363];
- unsigned long temp49 = (unsigned long) regs[364] << 16 | regs[365];
- unsigned long temp50 = (unsigned long) regs[366] << 16 | regs[367];
- unsigned long temp51 = (unsigned long) regs[368] << 16 | regs[369];
- unsigned long temp52 = (unsigned long) regs[370] << 16 | regs[371];
- unsigned long temp53 = (unsigned long) regs[372] << 16 | regs[373];
- unsigned long temp54 = (unsigned long) regs[374] << 16 | regs[375];
- unsigned long temp55 = (unsigned long) regs[376] << 16 | regs[377];
- unsigned long temp56 = (unsigned long) regs[378] << 16 | regs[379];
- unsigned long temp57 = (unsigned long) regs[380] << 16 | regs[381];
- L1_N = *(float*)&temp1;
- L2_N = *(float*)&temp2;
- L3_N = *(float*)&temp3;
- Strom_L1 = *(float*)&temp4;
- Strom_L2 = *(float*)&temp5;
- Strom_L3 = *(float*)&temp6;
- Watt_L1 = *(float*)&temp7;
- Watt_L2 = *(float*)&temp8;
- Watt_L3 = *(float*)&temp9;
- VA_L1 = *(float*)&temp10;
- VA_L2 = *(float*)&temp11;
- VA_L3 = *(float*)&temp12;
- VAR_L1 = *(float*)&temp13;
- VAR_L2 = *(float*)&temp14;
- VAR_L3 = *(float*)&temp15;
- Powerfactor_L1 = *(float*)&temp16;
- Powerfactor_L2 = *(float*)&temp17;
- Powerfactor_L3 = *(float*)&temp18;
- Phasenwinkel_L1 = *(float*)&temp19;
- Phasenwinkel_L2 = *(float*)&temp20;
- Phasenwinkel_L3 = *(float*)&temp21;
- Average_line_to_neutral_volts = *(float*)&temp22;
- Average_line_current = *(float*)&temp23;
- Sum_of_line_currents = *(float*)&temp24;
- Total_System_Power = *(float*)&temp25;
- Total_system_volt_amps = *(float*)&temp26;
- Total_system_VAr = *(float*)&temp27;
- Total_system_power_factor = *(float*)&temp28;
- Total_system_phase_angle = *(float*)&temp29;
- Netzfrequenz = *(float*)&temp30;
- Total_system_VA_demand = *(float*)&temp31;
- Neutral_current_demand = *(float*)&temp32;
- Maximum_neutral_current_demand = *(float*)&temp33;
- Line1_to_Line2_volts = *(float*)&temp34;
- Line2_to_Line3_volts = *(float*)&temp35;
- Line3_to_Line1_volts = *(float*)&temp36;
- Neutral_current = *(float*)&temp37;
- Total_KWh = *(float*)&temp38;
- Total_KVArh = *(float*)&temp39;
- L1_import_KWh = *(float*)&temp40;
- L2_import_KWh = *(float*)&temp41;
- L3_import_KWh = *(float*)&temp42;
- L1_export_KWh = *(float*)&temp43;
- L2_export_KWh = *(float*)&temp44;
- L3_export_KWh = *(float*)&temp45;
- L1_total_KWh = *(float*)&temp46;
- L2_total_KWh = *(float*)&temp47;
- L3_total_KWh = *(float*)&temp48;
- L1_import_KVArh = *(float*)&temp49;
- L2_import_KVArh = *(float*)&temp50;
- L3_import_KVArh = *(float*)&temp51;
- L1_export_KVArh = *(float*)&temp52;
- L2_export_KVArh = *(float*)&temp53;
- L3_export_KVArh = *(float*)&temp54;
- L1_total_KVArh = *(float*)&temp55;
- L2_total_KVArh = *(float*)&temp56;
- L3_total_KVArh = *(float*)&temp57;
- //Update
- //entfernt currentMillis = millis();
- //entfernt if (currentMillis - previousMillis >= interval)
- //entfernt {
- //entfernt MeldeWert("L1_N", L1_N); //Hier werden die Daten an die CCU geschickt
- //entfernt MeldeWert("L2_N", L2_N);
- //entfernt MeldeWert("L3_N", L3_N);
- //entfernt MeldeWert("Strom_L1", Strom_L1);
- //entfernt MeldeWert("Strom_L2", Strom_L2);
- //entfernt MeldeWert("Strom_L3", Strom_L3);
- //entfernt MeldeWert("Watt_L1", Watt_L1);
- //entfernt MeldeWert("Watt_L2", Watt_L2);
- //entfernt MeldeWert("Watt_L3", Watt_L3);
- //entfernt MeldeWert("VA_L1", VA_L1);
- //entfernt MeldeWert("Total_KWh", Total_KWh);
- //Update Millis
- //entfernt previousMillis = currentMillis;
- //entfernt }
- }
- //Send Value to Homematic
- //entfernt void MeldeWert(char* WertName, float Value)
- //entfernt {
- //entfernt String meldung = "";
- //entfernt WiFiClient client; // Webclient initialisieren
- //entfernt if (!client.connect(host, 8181)) { // mit dem CCU-Port 8181 verbinden
- //entfernt //Serial.println(" Fehler: Verbindung zur CCU konnte nicht aufgebaut werden");
- //entfernt delay(50);
- //entfernt return;
- //entfernt }
- //entfernt meldung = meldung + "GET /eriwan.exe?befehl=dom.GetObject('" + WertName + "').State('" + Value + "')";
- //entfernt client.println(meldung); // Daten an CCU melden
- //entfernt}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement