NEWS
[geloest] Gembird, Energenie Lan-Steckdosen
-
Ich habe die CURL mit Chrome Dev-Inspector ausgelesen und in ein shellskript gepackt. Dieses starte ich nun per skript aus iobroker. Damit funktioniert es super…
so sieht der CURL vom Socket01 aus, aufgeteilt in Login, Delay 2 Sekunden, An oder aus, Delay 2 Sekunden, Logout
#!/bin/bash curl 'http://192.168.1.9/login.html' -H 'Origin: http://192.168.1.9' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8,de;q=0.6' -H 'Upgrade-Insecure-Requests: 1' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Cache-Control: max-age=0' -H 'Referer: http://192.168.1.9/' -H 'Connection: keep-alive' --data 'pw=1' --compressed sleep 2 curl 'http://192.168.1.9/' -H 'Origin: http://192.168.1.9' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8,de;q=0.6' -H 'Upgrade-Insecure-Requests: 1' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Cache-Control: max-age=0' -H 'Referer: http://192.168.1.9/login.html' -H 'Connection: keep-alive' --data 'cte1=0&cte2=&cte3=&cte4=' --compressed sleep 2 curl 'http://192.168.1.9/login.html' -H 'Accept-Encoding: gzip, deflate, sdch' -H 'Accept-Language: en-US,en;q=0.8,de;q=0.6' -H 'Upgrade-Insecure-Requests: 1' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Referer: http://192.168.1.9/' -H 'Connection: keep-alive' --compressedUnd so das Script was aus iobroker gestartet wird. Hier werden jeweils der An oder Aus Befehl getriggert in abhaengigkeit zum Status.
on({id: "javascript.0.scriptEnabled.common.HardShutdown.LeftSocket-1_Dummy"/*scriptEnabled.common.HardShutdown.LeftSocket-1_Dummy*/, change: "ne"}, function (obj) { var value = obj.state.val; var oldValue = obj.oldState.val; if (getState("javascript.0.scriptEnabled.common.HardShutdown.LeftSocket-1_Dummy").val == true) { exec('bash /home/pi/GembirdPowerSocket/LeftSocket1-on.sh'); console.log("exec: " + 'bash /home/pi/GembirdPowerSocket/LeftSocket1-on.sh'); } else if (getState("javascript.0.scriptEnabled.common.HardShutdown.LeftSocket-1_Dummy").val == false) { exec('bash /home/pi/GembirdPowerSocket/LeftSocket1-off.sh'); console.log("exec: " + 'bash /home/pi/GembirdPowerSocket/LeftSocket1-off.sh'); } }); -
Hat jemand eine Lösung für die Gembird Steckdose gefunden um sie in iob zu integrieren?
-
Hallo,
Ich wuerde gerne meine LAN Steckdosen (http://energenie.com/item.aspx?id=7416) in iobroker implementieren.
Einfache Befehle wie Ein oder Aus wuerden schonmal reichen. Ich habe im Netz nicht viel gefunden was mich weiter bringt.
FHEM oder OpenHab haben das schon implementiert. Soweit so gut, es soll gehen und die Befehle sehen wohl wie folgt aus.
1. Befehl: http://Deine-IP/login.html
Dann einen POST Befehl –> pw=1 (Dein Passwort um dich auf die Seite zu loggen)
2. Befehl: http://192.168.1.90/status.html
Dann einen POST Befehl –> cte1=0 (cteX steht fuer die jeweilige Steckdose, 0 oder 1 fuer Aus oder An)
Auf der Seite gibt es mehr Infos. http://forum.micasaverde.com/index.php/ … ek8u6jn3m0
Ich bin auf eure Hilfe angewiesen - Komme bei diesem einfachen Tasks nicht mehr weiter.
Vielen Dank
@mickyboys Hast du das irgendwie hinbekommen die Steckdose in iob zu integrieren bzw zu steuern da dein Post als gelöst markiert wurde. Ich habe es nun mehrmals mit meiner Steckdose probiert und bekomme es einfach nicht hin.
-
Ich habe die CURL mit Chrome Dev-Inspector ausgelesen und in ein shellskript gepackt. Dieses starte ich nun per skript aus iobroker. Damit funktioniert es super…
so sieht der CURL vom Socket01 aus, aufgeteilt in Login, Delay 2 Sekunden, An oder aus, Delay 2 Sekunden, Logout
#!/bin/bash curl 'http://192.168.1.9/login.html' -H 'Origin: http://192.168.1.9' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8,de;q=0.6' -H 'Upgrade-Insecure-Requests: 1' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Cache-Control: max-age=0' -H 'Referer: http://192.168.1.9/' -H 'Connection: keep-alive' --data 'pw=1' --compressed sleep 2 curl 'http://192.168.1.9/' -H 'Origin: http://192.168.1.9' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8,de;q=0.6' -H 'Upgrade-Insecure-Requests: 1' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Cache-Control: max-age=0' -H 'Referer: http://192.168.1.9/login.html' -H 'Connection: keep-alive' --data 'cte1=0&cte2=&cte3=&cte4=' --compressed sleep 2 curl 'http://192.168.1.9/login.html' -H 'Accept-Encoding: gzip, deflate, sdch' -H 'Accept-Language: en-US,en;q=0.8,de;q=0.6' -H 'Upgrade-Insecure-Requests: 1' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Referer: http://192.168.1.9/' -H 'Connection: keep-alive' --compressedUnd so das Script was aus iobroker gestartet wird. Hier werden jeweils der An oder Aus Befehl getriggert in abhaengigkeit zum Status.
on({id: "javascript.0.scriptEnabled.common.HardShutdown.LeftSocket-1_Dummy"/*scriptEnabled.common.HardShutdown.LeftSocket-1_Dummy*/, change: "ne"}, function (obj) { var value = obj.state.val; var oldValue = obj.oldState.val; if (getState("javascript.0.scriptEnabled.common.HardShutdown.LeftSocket-1_Dummy").val == true) { exec('bash /home/pi/GembirdPowerSocket/LeftSocket1-on.sh'); console.log("exec: " + 'bash /home/pi/GembirdPowerSocket/LeftSocket1-on.sh'); } else if (getState("javascript.0.scriptEnabled.common.HardShutdown.LeftSocket-1_Dummy").val == false) { exec('bash /home/pi/GembirdPowerSocket/LeftSocket1-off.sh'); console.log("exec: " + 'bash /home/pi/GembirdPowerSocket/LeftSocket1-off.sh'); } });@mickyboys Denkst du da man das Script auch direkt per iobroker auslösen kann. Ich weiß der Beitrag ist schon alt aber vielleicht hast du es ja in der zwischen Zeit laufen?