Bonjour,
J'ai fait un petit Script PHP pour commander un ampli Onkyo avec eedomus.
Le Script doit être placé sur un serveur apache avec PHP (Un petit raspberry par exemple ou NAS).
Le script ne fonctionne pas en le plaçant sur la box eedomus.
Ensuite avec une simple requête http en GET, on commande l'ampli Onkyo (testé avec TX-RZ800)
Exemple :Volume a 42%http://192.168.1.240/onkyo.php?command=MVL¶ms=42
Passage Radio Internet 1http://192.168.1.240/onkyo.php?command=NPR¶ms=01
Passage en entrée NET :http://192.168.1.240/onkyo.php?command=SLI¶ms=2B
Allumage :http://192.168.1.240/onkyo.php?command=PWR¶ms=01
Liste des commandes :PWR => Power
MVL=> Volume
...
192.168.1.240 => adresse de mon Raspberry Apache
Dans le script $hostname = '192.168.1.15'; => Adresse IP
« fixe » de l'ampli
Documentions constructeur ISCP ici ci-joint:http://redirect.onkyousa.com/redirect.c ... R_133.xlsx- Code : Tout sélectionner
<?php
$command = $_GET['command'];
$params = $_GET['params'];
$hostname = '192.168.1.15';
$port = 60128;
switch ($command)
{
case 'PWR':
$message = '!1' . $command . $params;
break;
case 'NSV':
$message = '!1' . $command . $params;
break;
case 'TUN':
case 'NPR':
if ($params > 28)
exit(1);
$message = '!1' . $command . strtoupper(str_pad(dechex($params), 2, '0', STR_PAD_LEFT));
break;
case 'SLI':
$message = '!1' . $command . $params;
break;
case 'MVL':
if ($params > 60)
exit(1);
$message = '!1' . $command . strtoupper(str_pad(dechex($params), 2, '0', STR_PAD_LEFT));
break;
default:
exit(1);
}
print $message;
$fp = pfsockopen($hostname, $port);
$packet = "ISCP\x00\x00\x00\x10\x00\x00\x00" . chr(strlen($message) + 1) . "\x01\x00\x00\x00" . $message . "\x0D";
fwrite($fp, $packet);
fclose($fp);
?>
Source :
https://www.domoticz.com/wiki/Onkyo