Danke Mario.
Gruß
hoep
Die Suche ergab 5 Treffer
- 7. Juni 2016, 10:11
- Forum: EXTERNE SENSOREN | SONDEN
- Thema: Chlorsonde Wie/Wo/Wer/Was
- Antworten: 5
- Zugriffe: 317
- 7. Juni 2016, 09:08
- Forum: EXTERNE SENSOREN | SONDEN
- Thema: Chlorsonde Wie/Wo/Wer/Was
- Antworten: 5
- Zugriffe: 317
Chlorsonde Wie/Wo/Wer/Was
Hallo Leute,
irgendwie bin ich zu doof, den richtigen thread bezüglich Chlor-Sonde, Bezugsquelle und Nutzung/Einbau zu finden. Könnte jemand so nett sein, und mir einen Wink in die richtige Richtung geben ?
Danke
hoep
irgendwie bin ich zu doof, den richtigen thread bezüglich Chlor-Sonde, Bezugsquelle und Nutzung/Einbau zu finden. Könnte jemand so nett sein, und mir einen Wink in die richtige Richtung geben ?
Danke
hoep
- 5. Juni 2016, 17:06
- Forum: ANBINDUNG AN EXTERNE SOFTWARE
- Thema: Anbindung Controller an IP-Symcon
- Antworten: 53
- Zugriffe: 1267
Re: Anbindung Controller an IP-Symcon
Danke für den Hinweis, Script oben upgedatet und Abbruch Sprungmarke eingefügt).
Gruß
hoep
Gruß
hoep
- 5. Juni 2016, 13:25
- Forum: ANBINDUNG AN EXTERNE SOFTWARE
- Thema: Anbindung Controller an IP-Symcon
- Antworten: 53
- Zugriffe: 1267
Re: Anbindung Controller an IP-Symcon
Hallo mrcry73,
habe diesbezüglich wupperis Skript angepasst:
Gruß
hoep
Edit: Script angepasst und Abbruch Sprungmarke eingefügt (Nachdem ich noch ein paar andere Routinen drinnen hatte, die ich rausgelöscht habe, war mir dieser durchgerutscht).
Eigentlich sollte es reichen das Script einmal händisch auszuführen, dann sollten die Variablen angelegt werden (die kritische Variable - 24_XX glaube ich vorher löschen).
habe diesbezüglich wupperis Skript angepasst:
Gruß
hoep
Code: Alles auswählen
<?
// Version 1.0 Poolserver Installationsscript
//Config !! URL MUSS angepasst werden-----------------------------------------------------------------------------------------------------------------------------------------
//Nicht vergessen für die Variablen die Ihr loggen möchtet in den Variablensettings
//dann das Logging aktivieren
//URL-Adresse des Solar/Pool Control zbsp. http://192.168.1.30 oder http://www.deinpoolserver.com und wenn anderer Port als 80 mit http://www.deinpoolserver.com:81
$IPPoolServerAdr="http://X.X.X.X";
//In Minuten Abfrageintervall-Aktualisierung festlegen (Default 5 Minuten)
$RescanInterval=10;
//Profi/Spezialsettings nicht nötig-------------------------------------------------------------------------------------------------------------------------------------------
set_time_limit(15); //Timeout auf 15 Sekunden für Script erhöhen, kann oder muss in seltenen Fällen erhöht werden
$debug=false;
//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//Ab hier bitte nichts mehr ändern -------------------------------------------------------------------------------------------------------------------------------------------
// Version 1.0 Poolserver Installationsscript
//Für nächste Version Vorbereitungen
$user="";
$pwd="";
//Wert 0 = 8 Relais, Wert 1 = 16 Relais
//Unterstützt wird aktuell erst nur die 8 Relais-Variante
$Rel8or16=0;
//Anzeigen der Taster Digitaleingänge
//Unterstützt wird aktuell die Anzeige der entsprechenden Taster-Digaleingänge noch nicht aufgrund CSV-Strukturfehler
$DigitInShow=true;
//Usernamen: ADC[1..5], Redox, pH, Temperatur[1..8],Relais[1..8], digital Input[1..4], Allenfalls Spezialversionen Relais 9-16 NICHT Implementierte Version
$row=0;
$IPPoolServerAdrPure = $IPPoolServerAdr;
$IPPoolServerAdr.="/GetState.csv";
//$RescanInterval=$RescanInterval*60;
if (($handle = @fopen($IPPoolServerAdr, "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
for ($col=0; $col < $num; $col++) {
$ContentRowCol[$row][$col]= $data[$col];
}
$row++;
}
fclose($handle);
}
else
{
Echo "FEHLER: Es konnte keine Verbindung hergestellt werden, prüfen Sie bitte die Settings";
IPS_SetScriptTimer($IPS_SELF,60);
}
if($debug==true)
print_r($ContentRowCol);
//print_r($ContentRowCol);
if (!isset($ContentRowCol[0][1])) goto Abbruch;
if(substr(trim($ContentRowCol[0][1]),0,3)=="1.6")
{
if(count($ContentRowCol)==6)
{//Grob Datenstruktur prüfen
$object = IPS_GetObject($IPS_SELF);
$parentID = $object['ParentID'];
//Installer
if ($IPS_SENDER == "Execute")
{
IPS_SetHidden($IPS_SELF, true);
IPS_SetName($IPS_SELF, "ReadSolarPoolControlData");
$parentObject = IPS_GetObject($parentID);
if ($parentObject['ObjectType'] !== 1)
{
$instanceID = IPS_CreateInstance("{485D0419-BE97-4548-AA9C-C083EB82E61E}");
IPS_SetParent($instanceID, $parentID);
$parentID = $instanceID;
IPS_SetParent($IPS_SELF, $parentID);
IPS_SetName($instanceID, "Pool Controller");
IPS_SetScriptTimer($IPS_SELF,10);
}
else
{
//Installation ist durch, Scripttimer auf gewünschen Intervall setzen
IPS_SetScriptTimer($IPS_SELF,$RescanInterval);
}
}
else
{
$PoolServerInstanceID = $parentID;
$poolserverurl = CreateVariableByName($parentID, "PoolServerURL", 3, $profile = "~String");
SetValueString($poolserverurl, $IPPoolServerAdrPure);
$username = CreateVariableByName($parentID, "Username", 3, $profile = "~String");
SetValueString($username, $user);
$password = CreateVariableByName($parentID, "Password", 3, $profile = "~String");
SetValueString($password, $pwd);
$countrowfix = count($ContentRowCol);
@IPS_CreateVariableProfile("PoolServer_Relais", 1);
IPS_SetVariableProfileAssociation("PoolServer_Relais", 0, "Aus (Auto)", "", -1);
IPS_SetVariableProfileAssociation("PoolServer_Relais", 1, "Ein (Auto)", "", -1);
IPS_SetVariableProfileAssociation("PoolServer_Relais", 2, "Aus (Manu)", "", -1);
IPS_SetVariableProfileAssociation("PoolServer_Relais", 3, "Ein (Manu)", "", -1);
//Row 0 hat für uns uninteressante Werte - Systeminfo etc.
for ($row=1; $row < count($ContentRowCol); $row++) {
//Beschriftung/Ueberschrift aus Row 1 draus generieren wir Variablen zu den Überschriften
if($row==1)
{
$clrestvar = CreateVariableByName($PoolServerInstanceID, "36"."_"."Cl Rest", 2, $profile = "");
$phminusrestvar = CreateVariableByName($PoolServerInstanceID, "37"."_"."pH- Rest", 2, $profile = "");
$phplusrestvar = CreateVariableByName($PoolServerInstanceID, "38"."_"."pH+ Rest", 2, $profile = "");
$clconsvar = CreateVariableByName($PoolServerInstanceID, "39"."_"."Cl Verbrauch", 2, $profile = "");
$phminusconsvar = CreateVariableByName($PoolServerInstanceID, "40"."_"."pH- Verbrauch", 2, $profile = "");
$phplusconsvar = CreateVariableByName($PoolServerInstanceID, "41"."_"."pH+ Verbrauch", 2, $profile = "");
for ($col=0; $col < count($ContentRowCol[$row])-12; $col++) {
if($col < 16)
{//Alle anderen Bezeichnungen vorher
$ContentRowCol[$countrowfix][$col]=CreateVariableByName($PoolServerInstanceID, $col."_".$ContentRowCol[$row][$col], 3, $profile = "~String");
}
else
{//Relais bezeichnung
if ($col <> 24)
$ContentRowCol[$countrowfix][$col]=CreateVariableByName($PoolServerInstanceID, $col."_".$ContentRowCol[$row][$col], 1, $profile = "PoolServer_Relais");
else $ContentRowCol[$countrowfix][$col]=CreateVariableByName($PoolServerInstanceID, $col."_".$ContentRowCol[$row][$col], 3, $profile = "~String");
}
}
}
//Massbezeichnung, Profile und Assoziationen + Suffix in IPS hieraus generieren
if($row==2)
{
for ($col=0; $col < count($ContentRowCol[$row])-12; $col++) {
if(trim($ContentRowCol[$row][$col])!="--" && trim($ContentRowCol[$row][$col])!="n.a.")
{
@IPS_CreateVariableProfile ("PoolServer_".trim($ContentRowCol[$row][$col]), 3);
@IPS_SetVariableProfileText ("PoolServer_".trim($ContentRowCol[$row][$col]),""," ".trim($ContentRowCol[$row][$col]));
CreateVariableByName($PoolServerInstanceID, $col."_".$ContentRowCol[1][$col], 3, $profile = "PoolServer_".trim($ContentRowCol[$row][$col]));
}
}
}
//OFFSET aus Row3, GAIN aus Row4 und Value aus Row5 - Verwenden wir für Berechnung und hängen Endwert an Array als neue Row an
//Achtung Werte ab Position 16 müssen nicht mehr Berechnet werden da es Relais oder ON/OFF Komponenten sind
if($row==3)
{
for ($col=0; $col < 25; $col++) {
if($col==0) //Spezialfall Zeit-Time
{
$h = $ContentRowCol[$row+2][$col];
$stunde = floor($h/256);
$minute = (int) $h - $stunde*256;
$h = sprintf("%'.02d",$stunde).":".sprintf("%'.02d",$minute);
$ContentRowCol[$countrowfix+1][$col]=$h;
}
else if ($col<16)
{
$ContentRowCol[$countrowfix+1][$col]=($ContentRowCol[$row+2][$col]*$ContentRowCol[$row+1][$col])+$ContentRowCol[$row][$col];
}
else if ($col==24)
{
$ContentRowCol[$countrowfix+1][$col]=($ContentRowCol[$row+2][$col]*$ContentRowCol[$row+1][$col])+$ContentRowCol[$row][$col];
}
if (isset($ContentRowCol[$countrowfix+1][$col])) SetValueString($ContentRowCol[$countrowfix][$col],$ContentRowCol[$countrowfix+1][$col]);
}
}
//Relais und Schalter entsprechend Automatisch, Aus, Ein, Hand setzen
if($row==5)
{
$ena=0;
$state=0;
$i=0;
SetValueFloat($clrestvar,floatval($ContentRowCol[$row][36]/10.0));
SetValueFloat($phminusrestvar,floatval($ContentRowCol[$row][37]/10.0));
SetValueFloat($phplusrestvar,floatval($ContentRowCol[$row][38]/10.0));
SetValueFloat($clconsvar,floatval($ContentRowCol[$row][39]));
SetValueFloat($phminusconsvar,floatval($ContentRowCol[$row][40]));
SetValueFloat($phplusconsvar,floatval($ContentRowCol[$row][41]));
for ($col=16; $col < count($ContentRowCol[$row])-12; $col++) {
if($ContentRowCol[$row][$col]==0)
{//Aus Automatik
$ContentRowCol[$countrowfix+1][$col]=0;
}
elseif($ContentRowCol[$row][$col]==1)
{//Ein Automatik
$ContentRowCol[$countrowfix+1][$col]=1;
}
elseif($ContentRowCol[$row][$col]==2)
{//Aus Handbetrieb
$ContentRowCol[$countrowfix+1][$col]=2;
}
elseif($ContentRowCol[$row][$col]==3)
{//Ein Handbetrieb
$ContentRowCol[$countrowfix+1][$col]=3;
}
if ($col <> 24)
SetValueInteger($ContentRowCol[$countrowfix][$col],$ContentRowCol[$countrowfix+1][$col]);
else if (isset($ContentRowCol[$countrowfix+1][$col])) SetValueString($ContentRowCol[$countrowfix][$col],$ContentRowCol[$countrowfix+1][$col]." cm/s");
$i++;
}
}
} if($debug==true)
print_r($ContentRowCol);
IPS_SetScriptTimer($IPS_SELF,$RescanInterval);
}
}
else
{
Echo "FEHLER: Die Datenstruktur stimmt nicht, handelt es sich beim Gerät um einen Solar/Pool-Control?";
IPS_SetScriptTimer($IPS_SELF,60);
}
}
else
{
Echo "FEHLER: Die Firmware entspricht nicht dem geforderten Stand mit 1.5.1";
IPS_SetScriptTimer($IPS_SELF,60);
}
Abbruch:
//Funktionsdefinitionen
function CreateVariableByName($id, $name, $type, $profile = "")
{
$vid = @IPS_GetVariableIDByName($name, $id);
if($vid === false)
{
$vid = IPS_CreateVariable($type);
IPS_SetParent($vid, $id);
IPS_SetName($vid, $name);
IPS_SetInfo($vid, "this variable was created by script #".$_IPS['SELF']);
}
else
{
}
if(strpos($name, "n.")>0)
IPS_SetHidden($vid, true);
else
IPS_SetHidden($vid, false);
if(($profile !== "") and ($profile != 'PoolServer_cm/s') and ($profile != 'PoolServer_m³/h')) { IPS_SetVariableCustomProfile($vid, $profile); }
return $vid;
}
?>Eigentlich sollte es reichen das Script einmal händisch auszuführen, dann sollten die Variablen angelegt werden (die kritische Variable - 24_XX glaube ich vorher löschen).
- 18. April 2016, 20:01
- Forum: ANBINDUNG AN EXTERNE SOFTWARE
- Thema: Anbindung Controller an IP-Symcon
- Antworten: 53
- Zugriffe: 1267
Re: Anbindung Controller an IP-Symcon
Hi wupperi,
vielen Dank für Dein script, läuft super. Hast Du auch schon in die andere Richtung probiert (Relais schalten, Parameter übergeben z.B. Start/Endzeitpunkt Filter o.ä.) ?
Beste Grüße
hoep
vielen Dank für Dein script, läuft super. Hast Du auch schon in die andere Richtung probiert (Relais schalten, Parameter übergeben z.B. Start/Endzeitpunkt Filter o.ä.) ?
Beste Grüße
hoep