function Entertainment_SetGroupControlVisibility($GroupSwitchId, $Value) { $RoomConfig = get_RoomConfiguration(); $RoomName = IPS_GetName(IPS_GetParent($GroupSwitchId)); $ControlName = IPS_GetName($GroupSwitchId); $WFRoomName = $RoomConfig[$RoomName][c_Property_Name]; $WFRoomId = IPS_GetCategoryIDByName($WFRoomName, c_ID_WebFrontRoomes); $WFGroupId = IPS_GetInstanceIDByName($ControlName, $WFRoomId); IPS_SetHidden($WFGroupId, !$Value); SetValue($GroupSwitchId, $Value); }
public function SomfyCreateInstance(string $InstName, string $AIOSomfyAdresse, string $SomfyType, string $CategoryID) { //Prüfen ob Instanz schon existiert $InstanzID = @IPS_GetInstanceIDByName($InstName, $CategoryID); if ($InstanzID === false) { //echo "Instanz nicht gefunden!"; //Neue Instanz anlegen $InsID = IPS_CreateInstance("{0F83D875-4737-4244-8234-4CF08E6F2626}"); IPS_SetName($InsID, $InstName); // Instanz benennen IPS_SetParent($InsID, $CategoryID); // Instanz einsortieren unter dem Objekt mit der ID "$CategoryID" IPS_SetProperty($InsID, "Adresse", $AIOSomfyAdresse); //Adresse setzten. IPS_ApplyChanges($InsID); //Neue Konfiguration übernehmen IPS_LogMessage("Instanz erstellt:", "Name: " . $InstName); return $InsID; } else { //echo "Die Instanz-ID lautet: ". $InstanzID; return $InstanzID; } }