Hi Andreas,
anbei der Workflow. Danke!!!
<?php
/* =====================================================================================================
*
* IPSWorkflow Script
*
* Dieses Skript wurde von einem Workflow des IPSStudio erzeugt, bitte nehmen Sie keine Änderungen
* an dem Skript vor, da dieses beim nächsten Speichervorgang ansonsten wieder überschrieben werden.
*
* Generiert
* at: 07.11.2018 00:19:53
* von: IPSStudio
* ID: 23110 /*[Jens_Workflow]*/
*
* Benutzte Objekte:
* 12385 /*[Geräte\Popup_KameraEingang\Remote_Popup]*/ - Geräte.Popup_KameraEingang.Remote_Popup
*
* Generierte Ereignisse:
* 38580 /*[Jens_Workflow\Bei Aktualisierung M1]*/ - Jens_Workflow.Bei Aktualisierung M1
* 34352 /*[Jens_Workflow\Bei Aktualisierung M5]*/ - Jens_Workflow.Bei Aktualisierung M5
* 37981 /*[Jens_Workflow\Einmaliger Timer M8]*/ - Jens_Workflow.Einmaliger Timer M8
*
* ===================================================================================================== */
$executionID = round(microtime(true)*1000)-(IPS_GetKernelStartTime()*1000);
SendDebug($_IPS['SELF'], 'S||||'.$executionID, '', 0);
$M1 = new IPSEntityModuleOnUpdate($_IPS, 38580 /*[Jens_Workflow\Bei Aktualisierung M1]*/);
$M2 = new IPSEntityInstance($_IPS, 26625 /*[Geräte\Diele_EG\Klingelsensor]*/);
$M3 = new IPSEntityModuleIfValue($_IPS);
$M4 = new IPSEntityModuleOr($_IPS, true,true,false,false,false,false,false,false);
$M5 = new IPSEntityModuleOnUpdate($_IPS, 34352 /*[Jens_Workflow\Bei Aktualisierung M5]*/);
$M6 = new IPSEntityVariable($_IPS, 12385 /*[Geräte\Popup_KameraEingang\Remote_Popup]*/);
$M7 = new IPSEntityModuleIfValue($_IPS);
$M8 = new IPSEntityModuleTimerOnce($_IPS, 37981 /*[Jens_Workflow\Einmaliger Timer M8]*/);
SendDebug($_IPS['SELF'], 'C1|Value|M3|SetValue|'.$executionID,'Popup_KameraEingang',0);
$M3->SetValue('Popup_KameraEingang');
SendDebug($_IPS['SELF'], 'C2|Value|M7|SetValue|'.$executionID,' ""',0);
$M7->SetValue(' ""');
SendDebug($_IPS['SELF'], 'C3|Value|M8|SetTime|'.$executionID,'10',0);
$M8->SetTime('10');
if ($M2->Evaluate()) {
SendDebug($_IPS['SELF'], 'M2|PRESS_CONT|M1|SetValue|'.$executionID,$M2->GetValue('PRESS_CONT'),0);
$M1->SetValue($M2->GetValue('PRESS_CONT'));
SendDebug($_IPS['SELF'], 'M2|PRESS_SHORT|M5|SetValue|'.$executionID,$M2->GetValue('PRESS_SHORT'),0);
$M5->SetValue($M2->GetValue('PRESS_SHORT'));
}
if ($M1->Evaluate()) {
SendDebug($_IPS['SELF'], 'M1|GetFired|M4|SetValue1|'.$executionID,$M1->GetFired(),0);
$M4->SetValue1($M1->GetFired());
}
if ($M5->Evaluate()) {
SendDebug($_IPS['SELF'], 'M5|GetFired|M4|SetValue2|'.$executionID,$M5->GetFired(),0);
$M4->SetValue2($M5->GetFired());
}
if ($M4->Evaluate()) {
SendDebug($_IPS['SELF'], 'M4|GetResult|M8|SetActive|'.$executionID,$M4->GetResult(),0);
$M8->SetActive($M4->GetResult());
SendDebug($_IPS['SELF'], 'M4|GetResult|M3|SetCondition|'.$executionID,$M4->GetResult(),0);
$M3->SetCondition($M4->GetResult());
}
if ($M3->Evaluate()) {
SendDebug($_IPS['SELF'], 'M3|GetValue|M6|SetValue|'.$executionID,$M3->GetValue(),0);
$M6->SetValue($M3->GetValue());
}
if ($M8->Evaluate()) {
SendDebug($_IPS['SELF'], 'M8|GetFired|M7|SetCondition|'.$executionID,$M8->GetFired(),0);
$M7->SetCondition($M8->GetFired());
}
if ($M7->Evaluate()) {
SendDebug($_IPS['SELF'], 'M7|GetValue|M6|SetValue|'.$executionID,$M7->GetValue(),0);
$M6->SetValue($M7->GetValue());
}
$M6->Evaluate();
/* -----------------------------------------------------------------------*/
function SendDebug($id, $message, $data, $format) {
if (is_numeric($data)) {
$data = (string)round($data, 2);
}
IPS_SendDebug($id, $message, $data, $format);
}
/* -----------------------------------------------------------------------*/
function GetTypeConvertedValue($variableID, $value) {
$variableType = IPS_GetVariable($variableID)['VariableType'];
if ($variableType == 0) return (bool)$value;
else if ($variableType == 1) return (int)$value;
else if ($variableType == 2) return (float)$value;
else return $value;
}
/* -----------------------------------------------------------------------*/
class IPSEntityModuleOnUpdate {
private $ips;
private $id;
private $value;
private $isFired;
public function __construct($ips, $id) {
$this->ips = $ips;
$this->id = $id;
}
public function Evaluate() {
$this->isFired = $this->ips['SENDER'] == 'Variable' && $this->ips['EVENT'] == $this->id;
return $this->isFired;
}
public function SetValue($value) {
$this->value = $value;
}
public function GetValue() {
return $this->value;
}
public function GetFired() {
return $this->isFired;
}
public function GetNotFired() {
return !$this->isFired;
}
}
/* -----------------------------------------------------------------------*/
class IPSEntityInstance {
private $ips;
private $id;
public function __construct($ips, $id) {
$this->ips = $ips;
$this->id = $id;
}
private function GetTypeConvertedValue($ident, $value) {
return GetTypeConvertedValue(IPS_GetObjectIDByIdent($ident, $this->id), $value);
}
public function SetValue($ident, $value) {
IPS_RequestAction($this->id, $ident, $this->GetTypeConvertedValue($ident, $value));
}
public function GetValue($ident) {
return GetValue(IPS_GetObjectIDByIdent($ident, $this->id));
}
public function Evaluate() {
return true;
}
}
/* -----------------------------------------------------------------------*/
class IPSEntityModuleIfValue {
private $ips;
private $condition = false;
private $value = false;
public function __construct($ips) {
$this->ips = $ips;
}
public function SetCondition($value) {
$this->condition = $value;
}
public function SetValue($value) {
$this->value = $value;
}
public function GetValue() {
return $this->value;
}
public function Evaluate() {
return $this->condition;
}
}
/* -----------------------------------------------------------------------*/
class IPSEntityModuleOr {
private $ips;
private $result = 0;
private $evaluation = 0;
private $value = array();
private $input = array();
private $linked = array();
public function __construct($ips, $linked1, $linked2, $linked3, $linked4, $linked5, $linked6, $linked7, $linked8) {
$this->ips = $ips;
$this->linked[0] = $linked1;
$this->linked[1] = $linked2;
$this->linked[2] = $linked3;
$this->linked[3] = $linked4;
$this->linked[4] = $linked5;
$this->linked[5] = $linked6;
$this->linked[6] = $linked7;
$this->linked[7] = $linked8;
for ($idx = 0;$idx < 8;$idx++) {
$this->value[$idx] = -1;
$this->input[$idx] = false;
}
}
private function SetValue($idx, $value) {
$this->value[$idx] = $value;
$this->input[$idx] = true;
}
public function SetValue1($value) {
$this->SetValue(0, $value);
}
public function SetValue2($value) {
$this->SetValue(1, $value);
}
public function SetValue3($value) {
$this->SetValue(2, $value);
}
public function SetValue4($value) {
$this->SetValue(3, $value);
}
public function SetValue5($value) {
$this->SetValue(4, $value);
}
public function SetValue6($value) {
$this->SetValue(5, $value);
}
public function SetValue7($value) {
$this->SetValue(6, $value);
}
public function SetValue8($value) {
$this->SetValue(7, $value);
}
public function GetResult() {
return $this->result;
}
public function Evaluate() {
$value1 = $this->value[0];
$value2 = $this->value[1];
$value3 = $this->value[2];
$value4 = $this->value[3];
$value5 = $this->value[4];
$value6 = $this->value[5];
$value7 = $this->value[6];
$value8 = $this->value[7];
$this->result = false;
for ($idx = 0 ; $idx < 8 ; $idx++)
if ($this->input[$idx])
$this->result = $this->result || $this->value[$idx];
$this->evaluation = false;
for ($idx = 0 ; $idx < 8 ; $idx++)
$this->evaluation = $this->evaluation || ($this->input[$idx]==$this->linked[$idx]);
return $this->evaluation;
}
}
/* -----------------------------------------------------------------------*/
class IPSEntityVariable {
private $ips;
private $id;
private $value;
public function __construct($ips, $id) {
$this->ips = $ips;
$this->id = $id;
}
public function SetValue($value) {
SetValue($this->id, GetTypeConvertedValue($this->id, $value));
}
public function GetValue() {
return GetValue($this->id);
}
public function Evaluate() {
return true;
}
}
/* -----------------------------------------------------------------------*/
class IPSEntityModuleTimerOnce {
private $ips;
private $id;
private $seconds;
private $active = -1;
private $isEventFired;
public function __construct($ips, $id) {
$this->ips = $ips;
$this->id = $id;
}
public function Evaluate() {
$this->isEventFired =
$this->ips['SENDER'] == 'TimerEvent'
&& $this->ips['EVENT'] == $this->id;
if ($this->isEventFired) {
IPS_SetEventActive($this->id, false);
} else if ($this->active===true) {
$time = time() + $this->seconds;
IPS_SetEventCyclic($this->id, 0, 0, 0, 0, 1, $this->seconds);
IPS_SetEventCyclicTimeFrom($this->id, (int)date('H', $time), (int)date('i', $time), (int)date('s', $time));
IPS_SetEventActive($this->id, true);
} else {}
return $this->isEventFired;
}
public function SetActive($value) {
$this->active = $value;
}
public function SetTime($value) {
$this->seconds=$value;
}
public function GetFired() {
return $this->isEventFired;
}
public function GetNotFired() {
return !$this->isEventFired;
}
}
SendDebug($_IPS['SELF'], 'F||||'.$executionID, '', 0);
?>