Hi Leute!
Ich schalte mit Hilfe von einem Windwos HTPC, Eventghost und Amazon Echo Bridge meine DECT200 welche wiederrum meinen Beamer einschaltet. "Alexa schalte den Beamer ein" und die DECT200 Steckdose geht an.
Wenn hier noch Interesse besteht, versuche ich ein tutorial zu schreiben. Besteht Interesse?
EDIT: Um das ganze zu verkürzen: Ich habe hier 2 php scripts um deine DECT200 Steckdose ein bzw auszuschalten (vorsicht:wahnsinnig unsauberer code!):
Steckdose an:
Code: Alles auswählen
<?php
$fritz_url = 'fritz.box';
$fritz_pwd = 'DEINFRITZBOXPASSWORT';
//$ch = curl_init();
// Get Challenge-String
$l = simplexml_load_string(file_get_contents(sprintf('http://%s/login_sid.lua', $fritz_url)));
$c = $l->Challenge;
// Get SID
$c_str = sprintf("%s-%s", $c, $fritz_pwd);
$md_str = md5(iconv("UTF-8", "UTF-16LE", $c_str));
$l = simplexml_load_string(file_get_contents(sprintf('http://%s/login_sid.lua?user=&response=%s', $fritz_url, $c.'-'.$md_str)));
$sid = $l->SID;
$doc = file_get_contents('http://fritz.box/webservices/homeautoswitch.lua?ain=HIERDIEAINEINFÜGEN&switchcmd=setswitchon&sid='.$sid);
return $doc;
Steckdose aus:
Code: Alles auswählen
<?php
$fritz_url = 'fritz.box';
$fritz_pwd = 'DEINFRITZBOXPASSWORT';
//$ch = curl_init();
// Get Challenge-String
$l = simplexml_load_string(file_get_contents(sprintf('http://%s/login_sid.lua', $fritz_url)));
$c = $l->Challenge;
// Get SID
$c_str = sprintf("%s-%s", $c, $fritz_pwd);
$md_str = md5(iconv("UTF-8", "UTF-16LE", $c_str));
$l = simplexml_load_string(file_get_contents(sprintf('http://%s/login_sid.lua?user=&response=%s', $fritz_url, $c.'-'.$md_str)));
$sid = $l->SID;
$doc = file_get_contents('http://fritz.box/webservices/homeautoswitch.lua?ain=HIERDIEAINEINFÜGEN&switchcmd=setswitchoff&sid='.$sid);
return $doc;
?>
Die AIN bekommst du in deiner Fritzbox unter Smarthome (siehe Screenshot):
