Zur besten Antwort gewählt

Feb 24, 2018 - 13:39
var http = require("http");
//bei var body das was in body bei dem bild ist
var body = '<?xml version="1.0" encoding="UTF-8"?><Devices><Device><ID>EZR0121D5</ID>
;<COOLING>1</COOLING></Device></Devices>';
var postRequest = {
host: "http://192.168.1.38",
path: "/sony/IRCC",
port: 80,
method: "POST",
headers: {
'X-Auth-PSK': "0000",
'SOAPAction': "hier das einfügen von deinembild",
'Content-Type': "text/plain",
}
};
var buffer = "";
var req = http.request( postRequest, function( res ) {
console.log( res.statusCode );
var buffer = "";
res.on( "data", function( data ) { buffer = buffer + data; } );
res.on( "end", function( data ) { console.log( buffer ); } );
});
req.on('error', function(e) {
console.log('problem with request: ' + e.message);
});
req.write( body );
req.end();
Von
das script dann testen im script editor vom automation manager, mit der play taste
dann brauchst du kein php umweg, wenn es klappt
Von
es klappt!!!! Vielen Dank. Musste noch den Port, das HTTP bei HOST anpassen sowie die Notation bei SOAPAction ändern (' statt "). Hier noch der funktionierende Code, falls jemand auch eine Sony TV über IP steuern möchte:
var http = require("http");
//bei var body das was in body bei dem bild ist
var body = '<?xml version="1.0"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:X_SendIRCC xmlns:u="urn:schemas-sony-com:service:IRCC:1"><IRCCCode>AAAAAQAAAAEAAAAVAw==</IRCCCode></u:X_SendIRCC></s:Body></s:Envelope>';
var postRequest = {
host: "192.168.1.38",
path: "/sony/IRCC",
port: null,
method: "POST",
headers: {
'X-Auth-PSK': "0000",
'SOAPAction': '"urn:schemas-sony-com:service:IRCC:1#X_SendIRCC"',
'Content-Type': "text/plain",
}
};
var buffer = "";
var req = http.request( postRequest, function( res ) {
console.log( res.statusCode );
var buffer = "";
res.on( "data", function( data ) { buffer = buffer + data; } );
res.on( "end", function( data ) { console.log( buffer ); } );
});
req.on('error', function(e) {
console.log('problem with request: ' + e.message);
});
req.write( body );
req.end();
Von
das ist schön :)
trotzdem versuche das nochmal mit php
so wie wir es besprochen haben
wenn du das hinbekommst dann habe ich eine lösung mit deviceinfo.xml
dann brauchst du nicht für jedes befehl einen task
wenn es klappt mit php, dann post diesen code hier
in einer antwort mit dem codeeditor
und poste auch alle befehle für deinen tv
dann mache ich dir eine deviceinfo.xml
später kannst du in neo einfach die befehle zu den buttons wählen
Von
und jetzt noch oben unter meiner antwort, bitte den like button klicken :)
gruss!
Von
mach ich doch gerne.....vielen Dank noch einmal!!!
Neuen Kommentar hinzufügen