public function setDevice($id, $action) { if ($id == "timer") { $_SESSION["BPS"]->setProperty("mFhemTimer", "FhemValue", $action); return; } $F = new Fhem($id); $S = new FhemServer($F->A("FhemServerID")); switch ($S->A("FhemServerType")) { case "0": try { $T = new Telnet($S->A("FhemServerIP"), $S->A("FhemServerPort")); } catch (NoServerConnectionException $e) { die("error:'The connection to the server with IP-address " . $S->getA()->FhemServerIP . " could not be established!'"); } $T->fireAndForget("set " . $F->A("FhemName") . " {$action}"); $T->disconnect(); break; case "1": $S->setDevice($F->getID(), $action); #$url = $S->A("FhemServerURL")."?device=".$F->A("FhemName")."&value=".$action; #echo "opening URL $url..."; #fopen($url, "r"); break; } }
public static function DGParser($w) { $S = new FhemServer($w); $S->loadMe(); return $S->getA()->FhemServerName; }