Die CCU2 hab ich auch schon mehrmals "getötet", mit User und PW
Hab mich hingesetzt und mir das Skript mal ganz genau angesehen, einfaches Programmieren ist jetzt nicht so der Stress und es hinbekommen, hab noch SysVariablen geändert und es läuft. Allerdings ohne cuxd, wo ich mir noch nicht sicher bin, was es mir für Vorteile bringen würde.
Ich frage ab, hole mir das xml und ziehe mir die entsprechenden Strings raus und schreibe die auf eine Systemvariable.
Wie gesagt, CuxD hab ich zwar laufen aber mich damit noch nicht beschäftigt.
Bei der CuxD Variante, soweit ich das verstehe, schreibe ich die Werte auf die Kanäle der "Fernbedienung", oder? Und dann? Ja, ich weiss, es ist kein Homematic Forum, deshalb OT
Danke Euch für die Hilfe!
LG aus Graz, Andi
Code: Alles auswählen
string Url='http://192.168.224.151/xml?cmd=status';
var posStart;
var posEnd;
var substring;
var posValueStart;
var posValueEnd;
string stderr;
var stdout;
system.Exec("wget -q -O - "#Url, &stdout, &stderr);
WriteLine("Abrufen");
WriteLine(stdout);
!Status auslesen
posStart = '<status><status>';
posEnd = '/status';
posValueStart = stdout.Find(posStart) + posStart.Length();
posValueEnd = stdout.Find(posEnd)-posValueStart+1;
substring = stdout.Substr(posValueStart, posValueEnd) ;
dom.GetObject('Robby-Status').State(substring);
!WriteLine('Status: ' # substring);
!Laufzeit auslesen
posStart = '<duration>';
posEnd = '/duration';
posValueStart = stdout.Find(posStart) + posStart.Length();
posValueEnd = stdout.Find(posEnd)-posValueStart+1;
substring = stdout.Substr(posValueStart, posValueEnd);
substring = substring.ToInteger()/60;
dom.GetObject('Robby-letzte-Zeit').State(substring);
!WriteLine('Laufzeit: '#substring);
!Modus auslesen
posStart = '<mode>';
posEnd = '/mode';
posValueStart = stdout.Find(posStart) + posStart.Length();
posValueEnd = stdout.Find(posEnd)-posValueStart+1;
substring = stdout.Substr(posValueStart, posValueEnd) ;
dom.GetObject('Robby-Modus').State(substring);
!WriteLine('Modus: ' # substring);
!Battery auslesen
posStart = '<battery>';
posEnd = '/battery';
posValueStart = stdout.Find(posStart) + posStart.Length();
posValueEnd = stdout.Find(posEnd)-posValueStart+1;
substring = stdout.Substr(posValueStart, posValueEnd) ;
dom.GetObject('Robby-Battery').State(substring);
!WriteLine('Battery: '# substring);
!Betriebszeit auslesen
posStart = '<hours>';
posEnd = '/hours';
posValueStart = stdout.Find(posStart) + posStart.Length();
posValueEnd = stdout.Find(posEnd)-posValueStart+1;
substring = stdout.Substr(posValueStart, posValueEnd) ;
dom.GetObject('Robby-Betriebsstunden').State(substring.ToString(1));
!WriteLine('Betriebsstunden' # substring);
!Timerstatatus auslesen
posStart = '<timer><status>';
posValueStart = stdout.Find(posStart) + posStart.Length();
substring = stdout.Substr(posValueStart, 1) ;
dom.GetObject('Robby-Timer').State(substring);
if (substring.ToInteger()==2) {
posStart = '<next><date>';
posEnd = '/date';
posValueStart = stdout.Find(posStart) + posStart.Length();
posValueEnd = stdout.Find(posEnd)-posValueStart+1;
substring = stdout.Substr(posValueStart, posValueEnd) ;
dom.GetObject('Robby-Timer_Date').State(substring);
!WriteLine('Timer_Date: '# substring);
posStart = '<time>';
posEnd = '/time';
posValueStart = stdout.Find(posStart) + posStart.Length();
posValueEnd = stdout.Find(posEnd)-posValueStart+1;
substring = stdout.Substr(posValueStart, posValueEnd) ;
dom.GetObject('Robby-Timer_Time').State(substring);
!WriteLine('Timer_Time: '# substring);
} else {
if (substring.ToInteger()==0) {
dom.GetObject('Robby-Timer_Date').State("deaktiviert");
dom.GetObject('Robby-Timer_Time').State("deaktiviert");
} else {
dom.GetObject('Robby-Timer_Date').State("aktiv");
dom.GetObject('Robby-Timer_Time').State("aktiv");
}
}