Bezüglich Reboot:
Code
function sendReboot(host, port) {
Shelly.call(
"HTTP.Request",
{
method: "POST",
url: "http://" + host + ":" + port.toString() + "/upnp/control/deviceconfig",
headers: {
"Content-Type": 'text/xml; charset="utf-8"',
SoapAction: "urn:dslforum-org:service:DeviceConfig:1#Reboot",
},
body: [
'<?xml version="1.0" encoding="utf-8"?>',
'<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">',
" <s:Body>",
' <u:Reboot xmlns:u="urn:dslforum-org:service:DeviceConfig:1"/>',
" </s:Body>",
"</s:Envelope>",
].join(""),
},
function (response, error_code, error_message) {
if (error_code !== 0) {
print("Call failed with error " + error_code + " (" + error_message + "). ");
} else if (response.code !== 200) {
print("Fritzbox responded with HTTP code " + response.code + " (" + response.message + "). ");
} else {
print("Fritzbox response: " + response.body);
}
},
);
}
sendReconnect("192.168.1.1", 49000);
Alles anzeigen
Fritzbox responded with HTTP code 401 (Unauthorized).
Wenn man da noch die Authentifizierung reinbekommt, dann wäre das Script für Reboot auch fertig