}
        ?>
	[
		{
			"type":"heading",
			"value":"Pluginseite auswählen"
		},{
			"type":"list",
			"value":<?php 
        echo json_encode($name);
        ?>
,
			"click":<?php 
        echo json_encode($click);
        ?>
		}
	]
	<?php 
    } else {
        if (!empty($pluginManager->getCommand(0)) && !empty($pluginManager->getCommand(1)) && !empty($pluginManager->getCommand(2))) {
            $device = $pluginManager->getCommand(0);
            $action = new ActionNotification();
            $action->setActionOpenPlugin($pluginManager->getCommand(1), $pluginManager->getCommand(2));
            $action->setMaxTimestamp(time() + 60);
            $action->setAdressed($device);
            $notificationManager = $pluginManager->getNotificationManager();
            $notificationManager->addAction($action, $loginManager->getId());
            echo '{"redirect":["' . $pluginManager->getPluginName() . '", "device", "' . $device . '"]}';
        }
    }
}
<?php

require_once $pluginManager->getController('tools');
$command = $pluginManager->getCommand(0);
$command1 = $pluginManager->getCommand(1);
if (!empty($command) && empty($command1)) {
    $jUI->add(new JUI\Heading('Gerät auswählen'));
    $authtokens = $loginManager->getAuthtokens();
    $list = new JUI\ListView();
    if (!empty($authtokens) && is_array($authtokens)) {
        foreach ($authtokens as $authtoken) {
            if (!empty($authtoken['name'])) {
                $name = $authtoken['name'];
            } else {
                $name = "kein Name - " . $authtoken['authtoken'];
            }
            $click = new JUI\Click(JUI\Click::openPlugin, $pluginManager, 'remote', $authtoken['id'] . '/' . $command);
            $list->addItem($name, $click);
        }
    }
    $jUI->add($list);
} else {
    if (!empty($command) && is_numeric($command) && !empty($command1)) {
        $authtoken = $loginManager->getAuthtokenInfoById($command);
        $action = new ActionNotification("openMedia('music', '" . decode($command1) . "')", time() + 30);
        $action->setAdressed($authtoken['authtoken']);
        $pluginManager->getNotificationManager()->addAction($action, $loginManager->getId());
        $pluginManager->redirect($pluginManager);
    }
}