Nach Update auf 2.31 .25 läuft mein Piko Skript nicht mehr
Verfasst: 08.02.2018, 14:27
Hallo Ihr,
ich frage per Skript meinen Piko Wechselrichter die Leistungsdaten ab und bekomme eine XML zurück. Diese durchsuche ich dann nach einem String "aktuell" und dann hole ich mir den entsprechenden Zahlenwert nach dem String.
Mit WriteLine(daten); bekam ich immer wunderbar die Zahl zurück, seit dem Update erscheint aber immer das folgende, LeistungsWert als Zahl gefolgt von einem/ , zum Beispiel -> 55 /
Grundsätzlich passt der / ja auch, er kommt auch in den Daten vor.
Das bekomme ich dann klarerweise nimmer in die
Systemvariable.
Leider kommen zzt keine 4stellingen Leistungswerte vom Dach, dann werde ich versuchen, den String nochmal zu beschneiden.
Wie kann denn das sein? Wurde das was geändert??
P.S. Hier die Rückgabe vom Piko
---------------
ich frage per Skript meinen Piko Wechselrichter die Leistungsdaten ab und bekomme eine XML zurück. Diese durchsuche ich dann nach einem String "aktuell" und dann hole ich mir den entsprechenden Zahlenwert nach dem String.
Code: Alles auswählen
!IP vom Wechselrichter
var url = "http://192.168.0.13/index.fhtml";
dom.GetObject("CUxD.CUX2801002:1.CMD_SETS").State("wget --user=meiner --password=keiner -q -O - '"#url#"'");
dom.GetObject("CUxD.CUX2801002:1.CMD_QUERY_RET").State(1);
string stdout = dom.GetObject("CUxD.CUX2801002:1.CMD_RETS").State();
!Rückgabe der kompletten Seite vom Wechselrichter
!WriteLine(stdout);
!string word = "!aktuell";
string word = "aktuell";
integer word_laenge = word.Length();
integer word_position = stdout.Find(word);
!WriteLine(word_laenge);
!WriteLine(word_position);
string daten = stdout.Substr((word_position + word_laenge +1), 61);
!WriteLine(daten);
integer word_position = daten.Find(word);
!WriteLine(word_position);
daten = daten.Substr(53, (word_position -1));
!WriteLine(daten);
!!!!!!!!! hier wirds falsch!!!!
dom.GetObject("Solar_Power").State(daten);
Grundsätzlich passt der / ja auch, er kommt auch in den Daten vor.
Das bekomme ich dann klarerweise nimmer in die
Code: Alles auswählen
dom.GetObject("Solar_Power").State(daten);
Leider kommen zzt keine 4stellingen Leistungswerte vom Dach, dann werde ich versuchen, den String nochmal zu beschneiden.
Code: Alles auswählen
daten = daten.Substr(4, 4);
P.S. Hier die Rückgabe vom Piko
---------------
Code: Alles auswählen
!DOCtype HTML PUBLIC "-//W3C//Dtd HTML 4.0 Transitional//EN"
html
head
meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"
meta name="Generator" CONTENT="ChrisB"
title PV Webserver /title
/head
body nof="(MB=(DefaultMasterborder, 65, 60, 150, 10), L=(HomeLayout, 700, 600))" bgcolor="#EAF7F7" text="#000000" link="#0033CC" vlink="#990099" alink="#FF0000" topmargin=0 leftmargin=0 marginwidth=0 marginheight=0
form method="post" action=""
table cellspacing="0" cellpadding="0" width="770" nof="ly"
tr td height="5" /td /tr
tr td width="190" height="55" /td
td width="400"
font face="Arial,Helvetica,Geneva,Sans-serif,sans-serif" size="+3"
PIKO 4.2
br font size="+1"
kostal_4_2 (255)
/font
/font
/td
td img alt="Logo" height="42" width="130" src="KSE.gif" /td
/tr
/table
font face="Arial,Helvetica,Geneva,Sans-serif,sans-serif"
table Border="0" width="100%" tr
td width="150" /td
td hr /td
/tr /table
table cellspacing="0" cellpadding="0" width="770"
tr td /td /tr
tr
td width="190" /td
td colspan="2"
b AC-Leistung /b /td
td   /td
td
b Energie /b /td /tr
tr td height="10" /td /tr
tr
td width="190" /td
td width="100"
aktuell /td
td width="70" align="right" bgcolor="#FFFFFF"
56 /td
td width="140"   W /td
td width="100"
Gesamtenergie /td
td width="70" align="right" bgcolor="#FFFFFF"
24426 /td
td width="50"   kWh /td
td   /td /tr
tr height="2" td /td /tr
tr
td width="190" /td
td width="100"
  /td
td width="70" align="right"
  /td
td width="140"   /td
td width="100"
Tagesenergie /td
td width="70" align="right" bgcolor="#FFFFFF"
0.11 /td
td width="50"   kWh /td
td   /td /tr
tr height="5" td /td /tr
tr
td width="190" /td
td width="100"
Status /td
td colspan="4"
Einspeisen MPP /td
td   /td /tr
tr height="8" td /td /tr
tr td colspan="7"
table align="top" width="100%" tr
td width="182" /td
td hr size="1" /font /td /tr
tr td height="5" /td /tr /table
/td /tr
tr
td width="190" /td
td colspan="2"
b PV-Generator /b /td
td width="140"   /td
td colspan="2"
b Ausgangsleistung /b /td
td width="30"   /td
td   /td /tr
tr td height="10" /td /tr
tr
td width="190" /td
td width="100"
u String 1 /u /td
td width="70"   /td
td width="140"   /td
td width="95"
u L1 /u /td
td width="70"   /td
td width="30"   /td
td   /td /tr
tr
td width="190" /td
td width="100"
Spannung /td
td width="70" align="right" bgcolor="#FFFFFF"
627 /td
td width="140"   V /td
td width="100"
Spannung /td
td width="70" align="right" bgcolor="#FFFFFF"
231 /td
td width="30"   V /td
td   /td /tr
tr height="2" td /td /tr
tr valign="top" align="left"
td width="190"   /td
td width="100"
Strom /td
td width="70" align="right" bgcolor="#FFFFFF"
0.11 /td
td width="140"   A /td
td width="100"
Leistung /td
td width="70" align="right" bgcolor="#FFFFFF"
56 /td
td width="30"   W /td
td   /td /tr
tr height="22" td /td /tr
tr
td width="190" /td
td width="100"
u String 2 /u /td
td width="70"   /td
td width="140"   /td
td width="100"
u L2 /u /td
td width="70"   /td
td width="30"   /td
td   /td /tr
tr
td width="190" /td
td width="100"
Spannung /td
td width="70" align="right" bgcolor="#FFFFFF"
0 /td
td width="140"   V /td
td width="100"
Spannung /td
td width="70" align="right" bgcolor="#FFFFFF"
231 /td
td width="30"   V /td
td   /td /tr
tr height="2" td /td /tr
tr valign="top" align="left"
td width="190"   /td
td width="100"
Strom /td
td width="70" align="right" bgcolor="#FFFFFF"
0.00 /td
td width="140"   A /td
td width="100"
Leistung /td
td width="70" align="right" bgcolor="#FFFFFF"
0 /td
td width="30"   W /td
td   /td /tr
tr height="22" td /td /tr
tr
td width="190" /td
td width="100"
u /u /td
td width="70"   /td
td width="140"   /td
td width="100"
u L3 /u /td
td width="70"   /td
td width="30"   /td
td   /td /tr
tr
td width="190" /td
td width="100"
/td
td width="70" align="right" bgcolor="#EAF7F7"
/td
td width="140"  
/td
td width="95"
Spannung /td
td width="70" align="right" bgcolor="#FFFFFF"
237 /td
td width="30"   V /td
td   /td /tr
tr height="2" td /td /tr
tr valign="top" align="left"
td width="190"   /td
td width="95"
/td
td width="70" align="right" bgcolor="#EAF7F7"
/td
td width="140"  
/td
td width="95"
Leistung /td
td width="70" align="right" bgcolor="#FFFFFF"
0 /td
td width="30"   W /td
td   /td /tr
tr td height="15" /td /tr
tr td colspan="7"
table align="top" width="100%"
tr td width="182" /td
td hr size="1" /font /td
/tr tr td height="5" /td /tr /table
/td /tr /table
table cellspacing="0" cellpadding="0" width="770"
tr td width="190" /td
td font face="Arial,Helvetica,Geneva,Sans-serif"
b RS485 Kommunikation /b /td /tr
tr td height="8" /td /tr
tr td width="190" /td
td font face="Arial,Helvetica,Geneva,Sans-serif"
Wechselrichter 
input type="Text" name="edWrNr" value="255" size="3" maxlength="3"
input type="submit" value="Anzeigen/Aktualisieren"
/td /tr tr td height="10" /td /tr
/table
/td /tr /table /font
hr
table cellspacing="0" cellpadding="0" width="770"
tr td height="5" /td /tr
tr td width="190" /td
td width="330"
font face="Arial,Helvetica,Geneva,Sans-serif,sans-serif"
a href="LogDaten.dat" Historie /a
     
a href="Info.fhtml" Infoseite /a /font /td
td align="right"
font face="Arial,Helvetica,Geneva,Sans-serif,sans-serif"
a href="Solar2.fhtml" Einstellungen /a /font /td
td width="50" /td
/tr /table /font
/form
/body
/html