Yamaha RX-V771 per LAN steuern (SOAP?)

Hallo zusammen,

hat schon jemand einen Yamaha RX-V771 per LAN in IPS angebunden.

Hauptsächlich geht es mir um die Lautstärke, den Audioeingang und Stummschaltung.

Hier: [Problem] Soap-Nachrichten und Yamaha RX-V771

Hat sich schon jemand damit beschäftig, aber es gibt kein Ergebnis.

Vielleicht kann jemand helfen, habe jetzt schon Stunden gesucht…

Viele Grüße

Habe was gefunden, bekomme es nur nicht zum laufen:


function send_to_host($host,$method,$path='/',$data=''){
    $method = strtoupper($method);
    $fp = fsockopen($host, 80) or die("Unable to open socket");

/* Header is     POST /YamahaRemoteControl/ctrl HTTP/1.1
        Content-Type: text/plain
        Content-length: 152 (for this command)
        HOST: 192.168.1.25 (where your amp is)
*/
    fputs($fp, "$method $path HTTP/1.1
");
    fputs($fp, "Host: $host
");
    fputs($fp, "Content-type: text/plain
");
    if ($method == 'POST') fputs($fp, "Content-length: " . strlen($data) . "
");
    fputs($fp, "Connection: close

");

/* Body(XML) is    <?xml version="1.0" encoding="UTF-8"?>
        <YAMAHA_AV cmd="PUT">
        <Main_Zone>
        <Vol>
        <Mute>On</Mute>
        </Vol>
        </Main_Zone>
        </YAMAHA_AV>
*/
    if ($method == 'POST') fputs($fp, $data);

    while (!feof($fp))
        $buf .= fgets($fp,128);

    fclose($fp);
    return $buf;
}
$command = '<?xml version="1.0" encoding="UTF-8"?>
<YAMAHA_AV cmd="PUT">
<Main_Zone>
<Vol>
<Mute>On</Mute>
</Vol>
</Main_Zone>
</YAMAHA_AV>
';
$yamip = '192.168.1.25'; //your amp
$test = send_to_host($yamip.':80/YamahaRemoteControl/ctrl','POST','/YamahaRemoteControl/ctrl',$command);
echo $test;

Fehlermeldung/Ausgabe:
Notice: Undefined variable: buf
HTTP/1.1 400 Bad Request
Server: AV_Receiver/3.1 (RX-V771)
Content-Length: 0
Connection: close

Da er aber bei „Server“ schon den richtigen Receiver findet - also den RX-V771 kann es doch nicht mehr viel sein oder?

Wenn ich statt „$buf .= fgets($fp,128);“ nur „$buf = fgets($fp,128);“ nehme, läuft er ohne Fehlermeldung durch, aber er schaltet nichts. Kommt auch keine Rückmeldung.

Habe auch „//“ statt „/“ in den String probier.

Was mache ich noch verkehrt?

probier es mal so.

$buf = "";
while (!feof($fp))
        $buf .= fgets($fp,128);

Danke, aber tut sich auch nichts.

Habe jetzt folgendes:


$command = '<YAMAHA_AV cmd="PUT">
<Main_Zone>
<Vol>
<Mute>On</Mute>
</Vol>
</Main_Zone>
</YAMAHA_AV>
';

$yamip = '192.168.20.30'; //your amp
$test = send_to_host($yamip.':80/YamahaRemoteControl/ctrl','POST','/YamahaRemoteControl/ctrl',$command);
echo $test;



function send_to_host($host,$method,$path='/',$data=''){
    $method = strtoupper($method);
    $fp = fsockopen($host, 80) or die("Unable to open socket");

/* Header is     POST /YamahaRemoteControl/ctrl HTTP/1.1
        Content-Type: text/plain
        Content-length: 152 (for this command)
        HOST: 192.168.1.25 (where your amp is)
*/
    fputs($fp, "$method $path HTTP/1.1
");
    //echo "$method $path HTTP/1.1
";
    fputs($fp, "Host: $host
");
    fputs($fp, 'Content-type: text/xml; charset=UTF-8
');
    //fputs($fp, "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0");
    fputs($fp, "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
    fputs($fp, "Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3");
    //fputs($fp, "Referer: http://192.168.20.30/
");
    
    //echo strlen($data);
    if ($method == 'POST') fputs($fp, "Content-Length: " . strlen($data) . "
");

     fputs($fp, "Connection: close

");



    if ($method == 'POST') fputs($fp, $data);

        //$buf = "";
        while (!feof($fp)){
            echo fgets($fp, 128);
            //$buf = fgets($fp,128);
            
        }
        
    fclose($fp);
    //return $buf;
}

Es kommt keine Fehermeldung aber es tut sich auch nichts.

Lösung habe ich hier erstelt:

HowTo - Yamaha Verstärker per LAN/Netzwerk steuern - IP-Symcon Community Forum

Ich habe aufbauend auf brownson’s IPSEntertainment bereits vor einem halben Jahr eine grundlegende Integration für neuere Yamaha Receiver, welche die Steuerung über LAN erlauben (RX-Vx067, RX-Vx071, RX-Ax010), erstellt.

Im Vergleich zu der geposteten Lösung kann man dort auch die anderen Zones ansprechen und das NetRadio steuern. Insgesamt sollte es auch relativ leicht sein weitere Befehle hinzuzufügen. Ich hab soweit nur das hinzugefügt, was ich benötigte und daher nichts wirklich released.

Verwendest du IPSEntertainment?

Hallo,

@Domizei385:
Ich habe einen Yamaha RX-V771 und möchte diesen gerne in IPS-Entertainment integrieren. Leider bin ich irgendwie mit PHP auf Kriegsfuss (also absoluter Anfänger). Könntest Du Deine Lösung hier online stellen, oder beschreiben wie Du wo, was, warum ge-/verändert bzw. hinzugefügt hast??? Wäre ein prima Zug von Dir.

Gruß Proxima