NetIO 230A - Installationsscript

Bei Reichelt sind neue Modelle vorrätig. :slight_smile:

Danke - hab’s grad gefunden^^

Hätte, ich vorher mal schauen sollen - aber irgendwas ist ja immer^^

LAN NETIO230B-SW - IP-Steckdosenleiste mit 4 Steckdosen, schwarz - Messen, steuern, regeln bei Reichelt Elektronik

Weiss jemand ob die Anbindung ähnlich wie bei der 230a funktioniert ? Oder sind eure Glaskugeln auch defekt ? ^^

Wie wäre es, wenn Du dann mal in die Anleitung schauen würdest. Den Rest hast Du ja jetzt gefunden. :smiley:

Na, in meiner grenzenloser Naivität dachte ich, eventuell hätte schon jemand so ein Gerät im Einsatz und könnte aus dem Nähkästchen plaudern.

Dann werd ich mal lesen gehen…^^

Habs mal schnell überflogen. Geht, ob die Befehle die selben sind weiss ich jetzt nicht, da ich es nicht im Einsatz habe.

Danke Rainer !

Ich vermute es auch - http Zugang und Telnet ist beides da - sieht passend aus.

Ich werde mal eines bestellen und berichten…

jiepp, NETIO-230B

Mcbelly, hast Du schon bestellt? Ich habe gestern Zufällig auch einen bestellt. Evtl willst Du dann auf meinen Bericht warten !?!

Oh ja, danke !

Bestellt habe ich noch nicht, dann warte ich auf Deinen Bericht !

Vielen Dank :slight_smile:

Wird gemacht…

Ich sehe gerade dass Reichelt im Webshop keine Verfügbarkeitsanzeige hat.

Dann warten wir mal ab…

Ich hab am 230A hinten Adapter von Kaltgerätestecker auf Schuko-Buchse. Ist günstiger als 20,- EUR mehr auszugeben für die Netio mit Schuko.

Bin auf den Bericht allerdings auch gespannt …

So, NETIO 230B ist angekommen, gleich angeschlossen, das Installationsscipt aus diesem Thread durchrattern lassen, erstes Ergebnis:

  1. Das Script schaltet alle Eingänge ein und aus, jedoch mit ca 2 Sekunden verzögerung - erstmal nicht weiter schlimm, aber die Bedienung des 230B über das Webinterface passiert ohne einer Verzögerung, vielleicht maximal 100ms.

  2. Beim jeden Schalten erhalte ich folgende Fehlermeldungen:


Warning:  Connection Closed Gracefully. in C:\IP-Symcon\scripts\35605.ips.php on line 16

Warning:  Connection Closed Gracefully. in C:\IP-Symcon\scripts\35605.ips.php on line 17

Warning:  Connection Closed Gracefully. in C:\IP-Symcon\scripts\35605.ips.php on line 18

Warning:  Connection Closed Gracefully. in C:\IP-Symcon\scripts\35605.ips.php on line 19

Der PHP Code dazu sieht so aus:

<?
/*
// Script zum Ausschalten von Port 3
*/

$IPAddress = GetValueString(22257 /*[Testbereich\NetIO 230B\Logindaten\IP-Address]*/);
$Username = GetValueString(34497 /*[Testbereich\NetIO 230B\Logindaten\Username]*/);
$Password = GetValueString(51387 /*[Testbereich\NetIO 230B\Logindaten\Password]*/);

// Kommandos definieren 
$Login = "http://$IPAddress/tgi/control.tgi?login=p:$Username:$Password";
$Switch = "http://$IPAddress/tgi/control.tgi?p=uu0u";
$GetStatus = "http://$IPAddress/tgi/control.tgi?p=l";
$Logout = "http://$IPAddress/tgi/control.tgi?quit=quit";

$DoLogin = Sys_GetURLContent($Login);
$DoSwitch = Sys_GetURLContent($Switch);
$PortStatus = Sys_GetURLContent($GetStatus);
$DoLogout = Sys_GetURLContent($Logout);

// Statusvariable für Port aktualisieren: 
$Port3Status = substr($PortStatus,10,1);
SetValue(38358 /*[Testbereich\NetIO 230B\Port 3]*/,$Port3Status)

?>

Diese Fehlermeldung wurde weiter vorne im Thread auch schon mit dem 230A angezeigt, man kann diese verhindern, indem man ein @ vor jeder Zeile hinschreibt. Gesagt, getan…

  1. Die Statusabfrage funktioniert nicht. Egal, ob man den Zustand per Script oder händisch ändert, die Variable dazu bleibt immer auf „false“.

Nachdem ich blutiger Anfänger bin was POST Formulare betrifft, poste ich mal die Seitenquellen, evtl kann ja jemand erkennen, was zu einer Statusabfrage gesndet werden muss und warum so eine Verzögerung drinnen ist.

Erste Seite / Loginseite:

<html>
<head>
<title>NETIO-230B WebControl</title>
<style TYPE="text/css"> 
.P1 { font-family: Tahoma; font-size: 10pt; }
.P2 { font-family: Tahoma; font-size: 10pt; font-weight: bold; }
 
body, table {
  background-color: #e4e9e5;
  font-family: Tahoma; 
  font-size: 10pt; 
  margin: 0;
}
 
#topBar {
  background: url("/gradient_b.png") repeat-x scroll 0 0 #4e8657;
  width: 100%;
  border-top: 0px solid white;
  color: white;
  height: 45px;
  overflow: hidden;
  position: relative;
  font-family: Tahoma; 
  font-size: 14pt; 
  font-weight: bold; 
  z-index: 2;
}
</style>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<script LANGUAGE="javascript" SRC="/md5.js" TYPE="text/javascript"> 
</script>
<script LANGUAGE="javascript" TYPE="text/javascript"> 
    function calcResponse() {
        str = document.login.Username.value + 
            document.login.Password.value +
            document.login.Challenge.value;
 
        document.login.Response.value = hex_md5(str);
        document.login.Password.value = "";
        document.login.Challenge.value = "";
        document.login.submit();
    }
</script>
</head>
<body>
<div ID="topBar">
<center><img SRC="logo0000.png" ALT="NETIO-230B"></center></div>
<center>
<table BORDER="0" WIDTH="392" ALIGN="center" VALIGN="middle" CLASS="P1">
<tr>
<td NOWRAP>
<form NAME="login" ACTION="/tgi/login.tgi" METHOD="post">
<table NAME="myTable" ALIGN="center" CELLPADDING="10" WIDTH="96%" CELLSPACING="0">
<tr ALIGN="left" VALIGN="top">
<td></td></tr>
<tr>
<td NOWRAP COLSPAN="2">
<p CLASS="P2" ALIGN="center">NETIO-230B WebControl</p></td></tr>
<tr>
<td CLASS="P1" COLSPAN="2" ALIGN="center">Please enter user name and password.<br>
NOTE: JAVAScript must be Enabled.</td>
</tr>
 
<tr ALIGN="left" VALIGN="top">
<td CLASS="P2">User Name</td>
<td><input CLASS="P1" TYPE="text" NAME="Username" VALUE="admin" SIZE="32" MAXLENGTH="32"></td></tr>
<tr ALIGN="left" VALIGN="top">
<td CLASS="P2">Password</td>
<td><input CLASS="P1" TYPE="password" NAME="Password" VALUE="" SIZE="32" MAXLENGTH="32"></td></tr>
<tr ALIGN="left" VALIGN="top">
<td COLSPAN="2">
<p ALIGN="center"><input CLASS="P1" ONCLICK="calcResponse(); return false;" TYPE="Submit" NAME="Submitbtn" VALUE="      OK      "> *** <input CLASS="P1" TYPE="button" NAME="Cancel" VALUE="   Cancel   " ONCLICK="document.login.Username.value='';document.login.Password.value=''"></p></td></tr></table>
 
<input TYPE="hidden" NAME="Challenge" VALUE="E25C1696"> <input TYPE="hidden" NAME="Response" VALUE=""> 
</form></td></tr></table></center>
<script LANGUAGE="javascript" TYPE="text/javascript"> 
   if (document.login.Username.value ==' '){
       document.login.Password.focus();
      }
      else {
           document.login.Username.focus();
           }
</script>
</body>
</html>


Nach dem Login die Seite mit den manuellen Steuerungsmöglichkeiten:

http://192.168.0.107/manControl.htm^

<html>
<head>
<title>Manual Control</title>
<style TYPE="text/css"> 
.P1 { font-family: Tahoma; font-size: 10pt; background: transparent;}
.P2 { font-family: Tahoma; font-size: 14pt; font-weight: bold; }
.P3 { font-family: Tahoma; font-size: 10pt; font-weight: bold; }
.P4 { line-height: 5px; }
.P5 { font-family: Tahoma; font-size: 8pt; }
.mytable{ width: 425px; }
.mybutton { width: 90px; font-family: Tahoma; font-size: 10pt; }
 
body {
  background-color: #e4e9e5;
  margin: 0;
}
 
#topBar {
  background: url("/gradient_b.png") repeat-x scroll 0 0 #4e8657;
  width: 100%;
  border-top: 0px solid white;
  color: white;
  height: 45px;
  overflow: hidden;
  position: relative;
  z-index: 2;
  font-family: Tahoma; 
  font-size: 14pt; 
  font-weight: bold; 
}
</style>
</head>
<body>
<div ID="topBar"><img SRC="/outputs.png" ALT="">Manual control</div>
<form NAME="manControl" METHOD="post" ACTION="/tgi/manControl.tgi">
<table CELLPADDING="5" BORDER="0" HEIGHT="4" WIDTH="12">
<tbody>
<tr CLASS="P3" ALIGN="center" VALIGN="center">
<td ALIGN="center" NOWRAP="nowrap">Name</td>
<td ALIGN="center" NOWRAP="nowrap">No.</td>
<td ALIGN="cenetr" NOWRAP="nowrap">Manual</td>
<td ALIGN="center" NOWRAP="nowrap">Status</td>
<td ALIGN="center" NOWRAP="nowrap">Interrupt </td></tr>
<tr class="P1">
<td align="center" nowrap="nowrap">output_1</td>
<td align="center" nowrap="nowrap">1 </td>
<td align="center" nowrap="nowrap"><input type="checkbox" name="man00" value="on" checked="checked"></td>
<td align="center" nowrap="nowrap"><input type="radio" name="set00" value="1"><font COLOR="#ff0000">ON</font>
<input type="radio" name="set00" value="0" checked="checked"><font COLOR="#00ff00">OFF</font></td>
<td align="center" nowrap="nowrap"><input type="checkbox" name="int00" value="on">
</td></tr>
<tr class="P1">
<td align="center" nowrap="nowrap">output_2</td>
<td align="center" nowrap="nowrap">2 </td>
<td align="center" nowrap="nowrap"><input type="checkbox" name="man01" value="on" checked="checked"></td>
<td align="center" nowrap="nowrap"><input type="radio" name="set01" value="1"><font COLOR="#ff0000">ON</font>
<input type="radio" name="set01" value="0" checked="checked"><font COLOR="#00ff00">OFF</font></td>
<td align="center" nowrap="nowrap"><input type="checkbox" name="int01" value="on">
</td></tr>
<tr class="P1">
<td align="center" nowrap="nowrap">output_3</td>
<td align="center" nowrap="nowrap">3 </td>
<td align="center" nowrap="nowrap"><input type="checkbox" name="man02" value="on" checked="checked"></td>
<td align="center" nowrap="nowrap"><input type="radio" name="set02" value="1" checked="checked"><font COLOR="#ff0000">ON</font>
<input type="radio" name="set02" value="0"><font COLOR="#00ff00">OFF</font></td>
<td align="center" nowrap="nowrap"><input type="checkbox" name="int02" value="on">
</td></tr>
<tr class="P1">
<td align="center" nowrap="nowrap">output_4</td>
<td align="center" nowrap="nowrap">4 </td>
<td align="center" nowrap="nowrap"><input type="checkbox" name="man03" value="on" checked="checked"></td>
<td align="center" nowrap="nowrap"><input type="radio" name="set03" value="1" checked="checked"><font COLOR="#ff0000">ON</font>
<input type="radio" name="set03" value="0"><font COLOR="#00ff00">OFF</font></td>
<td align="center" nowrap="nowrap"><input type="checkbox" name="int03" value="on">
</td></tr>
<tr CLASS="P1">
<td COLSPAN="2" ALIGN="center" NOWRAP="nowrap">
<p ALIGN="center"><input NAME="DoIt" VALUE="Apply" TYPE="submit" > <input NAME="AllOff" VALUE="All off" TYPE="submit" ></p></td></tr></tbody></table></form>
 
</body>
</html>


Die Seite für die Statusanzeige:

http://192.168.0.107/switchState.htm

<html>
<head>
<title>State</title>
<style TYPE="text/css"> 
.P1 { font-family: Tahoma; font-size: 10pt; background: transparent;}
.P2 { font-family: Tahoma; font-size: 14pt; font-weight: bold; }
.P3 { font-family: Tahoma; font-size: 10pt; font-weight: bold; }
.P4 { line-height: 5px; }
.P5 { font-family: Tahoma; font-size: 8pt; }
.mytable{ width: 425px; }
.mybutton { width: 90px; font-family: Tahoma; font-size: 10pt; }
 
body {
  background-color: #e4e9e5;
  margin: 0;
}
 
#topBar {
  background: url("/gradient_b.png") repeat-x scroll 0 0 #4e8657;
  width: 100%;
  border-top: 0px solid white;
  color: white;
  height: 45px;
  overflow: hidden;
  position: relative;
  z-index: 2;
  font-family: Tahoma; 
  font-size: 14pt; 
  font-weight: bold; 
}
</style>
</head>
<body>
<div ID="topBar"><img SRC="/outputs.png" ALT="">Output status and configuration</div>
<form NAME="switchState" METHOD="post" ACTION="/tgi/switchState.tgi">
<table CELLPADDING="5" BORDER="0" HEIGHT="4" WIDTH="12">
<tbody>
<tr CLASS="P3" ALIGN="center" VALIGN="center">
<td ALIGN="center" NOWRAP="nowrap">Select</td>
<td ALIGN="cenetr" NOWRAP="nowrap">Name</td>
<td ALIGN="center" NOWRAP="nowrap">No.</td>
<td ALIGN="center" NOWRAP="nowrap">Mode</td>
<td ALIGN="center" NOWRAP="nowrap">Status</td>
<td ALIGN="center" NOWRAP="nowrap">Watchdog </td></tr>
<tr class="P1"><td align="center" nowrap="nowrap">
 <input name="sel" value="0" type="radio"checked="Checked"></td>
<td align="center" nowrap="nowrap">output_1</td>
<td align="center" nowrap="nowrap">1 </td>
<td align="center" nowrap="nowrap"> MANUAL </td>
<td align="center" nowrap="nowrap"><font COLOR="#00ff00"> OFF </font></td>
<td align="center" nowrap="nowrap"> NO 
</td></tr>
<tr class="P1"><td align="center" nowrap="nowrap">
 <input name="sel" value="1" type="radio"></td>
<td align="center" nowrap="nowrap">output_2</td>
<td align="center" nowrap="nowrap">2 </td>
<td align="center" nowrap="nowrap"> MANUAL </td>
<td align="center" nowrap="nowrap"><font COLOR="#00ff00"> OFF </font></td>
<td align="center" nowrap="nowrap"> NO 
</td></tr>
<tr class="P1"><td align="center" nowrap="nowrap">
 <input name="sel" value="2" type="radio"></td>
<td align="center" nowrap="nowrap">output_3</td>
<td align="center" nowrap="nowrap">3 </td>
<td align="center" nowrap="nowrap"> MANUAL </td>
<td align="center" nowrap="nowrap"><font COLOR="#ff0000"> ON </font></td>
<td align="center" nowrap="nowrap"> NO 
</td></tr>
<tr class="P1"><td align="center" nowrap="nowrap">
 <input name="sel" value="3" type="radio"></td>
<td align="center" nowrap="nowrap">output_4</td>
<td align="center" nowrap="nowrap">4 </td>
<td align="center" nowrap="nowrap"> MANUAL </td>
<td align="center" nowrap="nowrap"><font COLOR="#ff0000"> ON </font></td>
<td align="center" nowrap="nowrap"> NO 
</td></tr>
<tr>
<td COLSPAN="8" ALIGN="left" NOWRAP="nowrap">
<p ALIGN="center"><input NAME="Refresh status" VALUE="Reload" TYPE="submit"> <input NAME="Modify" VALUE="Modify" TYPE="submit"> <input NAME="Manual" VALUE="Manual Control" TYPE="submit"></p></td></tr></tbody></table></form>
</body>
</html>


So, habe die Lösung:

Das NETIO muss auf Firmware 3.1 geupdated werden, dann gibt es unter system - einstellungen einen Schalter: CGI COMPATIBILITY (compatibility with previous versions), dieser muss gesetzt werden, dann funktioniert auch auf einmal die Statusabfrage.

Trotzdem scheint mir die Sache nicht ganz stabil zu sein. Wenn ich einen Port einschalte, nach 2 Sekunden wieder ausschalte, und dann wieder einschalte, dann hängt IPS 5 Sekunden und verschluckt den Befehl, manchmal wird der Befehl auch noch nach den 5 Sekunden nachträglich ausgeführt.

Ich denke dass ich eine Methode über Telnet bevorzugen möchte. Über Client Socket zu senden habe ich schon geschafft. Ich bin jedoch noch nicht dahinter gekommen, wie man die empfangenen Ergebnise vom Socket wieder auslesen kann. Im Debug Fenster sehe ich das vom NETIOn zurück gesendete Ergebnis. Aber wie kann ich daraus eine Variable erzeugen?

wie man die empfangenen Ergebnise vom Socket wieder auslesen kann. Im Debug Fenster sehe ich das vom NETIOn zurück gesendete Ergebnis. Aber wie kann ich daraus eine Variable erzeugen?
Mit einer Registervariable.

RegisterVariable: IP-Symcon :: Automatisierungssoftware

Das habe ich mir schon angesehen und die Zähne daran ausgebissen. Wenn ich folgendes ausführe:

<?

RegVar_SendText(28503 /*[NETIO230B\Register Variable]*/, "login admin admin".chr(13));

if ($IPS_SENDER == "RegisterVariable")
{

$IPS_INSTANCE = 28503 /*[NETIO230B\Register Variable]*/;

  $data  = RegVar_GetBuffer($IPS_INSTANCE);
 
  $data .= $IPS_VALUE;
  
  echo $data;
}
?>

dann erhalte keinen Inhalt in der Variable $data. Aber im Debug Fenster des Client Sockets sehe ich dass mein Login gesendet wird, und auch ein OK zurück kommt.

Hmm, Sorry, dass das bei Dir nicht funktioniert. Ich habe es für das 230A geschrieben und setze es damit hier auch ohne Probleme und auch ohne Verzögerungen ein. Wenn ich draufklicke, schaltet der Port sofort und zwar genau so schnell wie über die interne Webseite … :confused:

Die 230A und B scheinen sich also zu unterscheiden?!

Gruß,
Christoph

Also wenn ich über den Client Socket sende, dann habe ich auch keine Verzögerung drinnen. Nur das Auslesen der Ports schaffe ich noch nicht über die Register Variable.

Wie soll ich die Register Variable auslesen lassen?

Soll ich der Register Variable ein zyklisches Ereignis ausführen lassen:
RegVar_SendText($IPS_TARGET, „port list“.chr(13));

Und dann der gleichen Register Variable ein Zielscript zuweisen, das den empfangenen Text auswertet und für die 4 Ports dann 4 andere Variablen füttert?

So, jetzt habe ich die Methode, wie im letzten Betrag angefragt, einfach mal geschrieben und ausprobiert. Es funktioniert. Ich habe jedoch keinen Schimmer, ob es eine schönere Methode gibt. Ich kann nun mit Telnet/Client Socket die Steckdosen steuern und abfragen, die Verzögerung ist auch weg, die Stabilität ist super. Jetzt funktioniert es auch mit den Standardeinstellungen der Steckdose, also mit ausgeschaltetem „CGI COMPATIBILITY“.

Die Steckdosenleiste braucht im Ruhezustand 2.3 bis 2.5 Watt und steigt mit jedem angezogenem Relais um weitere 0.4 bis 0.5W - gemessen mit einem Reichelt KD 302 Schätzeisen.

Magst Du den Code mal hier posten?

Natürlich, gerne, nur gestern Nacht ist es mir zu spät geworden. Heute Abend sollte es klappen…