Lidl WI-FI Steckdose SWS-A1 SilverCrest IAN 103043

Begonnen von ext23, 14 Juni 2015, 09:22:22

Vorheriges Thema - Nächstes Thema

SebiM

Zitat von: fhem4me am 10 Dezember 2015, 19:34:24
SEBIM,

Vielen Dank für die versuchen zu helfen.
Ja ich denke, viele Leute würden ein PHP-Version wie.

Gerne. Ich hoffe, ich habe das richtig verstanden...
Einfacher Code in PHP hier, natürlich müssen die Adressen angepasst werden:
(Die MAC findet man am einfachsten über das Web-Frontend heraus; für all jene, die -- wie ich -- eher lesefaul sind ;) )

#!/usr/bin/php
<?php
$ip 
'192.168.1.74';
$mac 'ACCF23342CD2';

$sock socket_create(AF_INETSOCK_DGRAMSOL_UDP);
$msg hex2bin('0140' $mac '104CF75F5A28A181574AC1B563CD51A78D'); // to switch 'on'
socket_sendto($sock$msgstrlen($msg), 0$ip8530);
sleep(5);
$msg hex2bin('0140' $mac '10F7B4E74B970D96F3CA2BB5D3CD1C19D0'); // to switch 'off'
socket_sendto($sock$msgstrlen($msg), 0$ip8530);
sleep(1);                                                 
socket_close($sock);


(Update: Code-Block hinzugefügt)

PeMue

So, habe mir die letzte Dose in unserer Filiale ergattert ...

Gruß PeMue
RPi3Bv1.2 rpiaddon 1.66 6.0 1xHM-CC-RT-DN 1.4 1xHM-TC-IT-WM 1.1 2xHB-UW-Sen-THPL-O 0.15 1x-I 0.14OTAU  1xCUNO2 1.67 2xEM1000WZ 2xUniroll 1xASH2200 3xHMS100T(F) 1xRFXtrx 90 1xWT440H 3xTFA30.3150 5xFA21
RPi1Bv2 LCDCSM 1.63 5.8 2xMAX HKT 1xMAX RT V200KW1 Heizung Wasser

ext23

Im zweifel kann man die auch online bestellen, ich hatte mir damals auch einige bestellt.
HM, KNX, FS20, 1-Wire, PanStamp, AVR-NET-IO, EM1000EM, PCA301, EC3000, HM-LAN, CUL868, RFXtrx433, LGW, DMX @Ubuntu-Server (Hauptsystem) & Raspberry Pi (Satellit)

PeMue

#63
Zitat von: ext23 am 10 Dezember 2015, 21:04:39
Im zweifel kann man die auch online bestellen, ich hatte mir damals auch einige bestellt.
Nein, online scheint das Ding ausverkauft, habe vorher geschaut  ;)
RPi3Bv1.2 rpiaddon 1.66 6.0 1xHM-CC-RT-DN 1.4 1xHM-TC-IT-WM 1.1 2xHB-UW-Sen-THPL-O 0.15 1x-I 0.14OTAU  1xCUNO2 1.67 2xEM1000WZ 2xUniroll 1xASH2200 3xHMS100T(F) 1xRFXtrx 90 1xWT440H 3xTFA30.3150 5xFA21
RPi1Bv2 LCDCSM 1.63 5.8 2xMAX HKT 1xMAX RT V200KW1 Heizung Wasser

ext23

HM, KNX, FS20, 1-Wire, PanStamp, AVR-NET-IO, EM1000EM, PCA301, EC3000, HM-LAN, CUL868, RFXtrx433, LGW, DMX @Ubuntu-Server (Hauptsystem) & Raspberry Pi (Satellit)

fhem4me

dank SEBIM
In Windows, sobald ich aktiviert Buchsen in der php.ini und gewährleistet die Sockets-DLL war an der richtigen Stelle es funktionierte ersten Mal.
Seltsamer meine zweite Lidl WiFi-Buchse ist nicht arbeitet derzeit mit dem Paketsender aus den Daten in der Silvercrest Crypter. Verändert die MAC- und IP, aber keine Antwort.

SebiM

Zitat von: fhem4me am 10 Dezember 2015, 21:52:53
dank SEBIM
In Windows, sobald ich aktiviert Buchsen in der php.ini und gewährleistet die Sockets-DLL war an der richtigen Stelle es funktionierte ersten Mal.
Seltsamer meine zweite Lidl WiFi-Buchse ist nicht arbeitet derzeit mit dem Paketsender aus den Daten in der Silvercrest Crypter. Verändert die MAC- und IP, aber keine Antwort.

Ich kann dazu leider nicht mehr viel sagen. Meine Dose funktioniert; zur Fehlersuche (oder Diagnose) bräuchte man eine Dose, die nicht funktioniert.
Ich kann nur mal alle Daten durchgeben (Dank an Peter für die Java-App):
Encrypted: 0140ACCF23342CD2104CF75F5A28A181574AC1B563CD51A78D ("switch on")
Decrypted: 00FFFFC1117150010000FFFF04040404

also:
Packet# FFFF
companyCode C1
deviceType 11
authCode 7150

HF-LPB100, Software V1.0.04b

Hast Du ein etwas anderes Modell? Dann hilft wohl nur, die Datenpakete mit Wireshark mitzuschneiden.

(Nebenbei, von mir aus kann ich auch auf Englisch antworten, falls das einfacher sein sollte. Ich bin nur neu hier im Forum, und weiß nicht, ob das okay wäre.)

fhem4me

I also wondered if it is possible to post in English rather than German. I'm sure there are lots of people that have these devices that would find the information very useful but they may miss it when they do a Google search.

The 2 units  I have are identical with V1.0.04b and both work with the Android app but only one with Packet Sender or PHP code.
Maybe the issue relates to having TWO devices?
Also for me the Web GUI does not permit changes from STA mode to AP mode. Maybe another username and password is required to make the changes. Does the Web GUI work for other people i.e. are the changes retained when the device is rebooted?

McCavity

Hi, fhem4me,

since this is a German board the preferred language in most of the threads is also German, I guess. There is an English Corner, however, in this board which is intended for international users. I think you can always post interesting information there (and maybe link back to the original German thread).

Kind regards,
McCavity

jmv_driver

Zitat von: SebiM am 11 Dezember 2015, 06:29:05
Ich kann dazu leider nicht mehr viel sagen. Meine Dose funktioniert; zur Fehlersuche (oder Diagnose) bräuchte man eine Dose, die nicht funktioniert.
Ich kann nur mal alle Daten durchgeben (Dank an Peter für die Java-App):
Encrypted: 0140ACCF23342CD2104CF75F5A28A181574AC1B563CD51A78D ("switch on")
Decrypted: 00FFFFC1117150010000FFFF04040404

also:
Packet# FFFF
companyCode C1
deviceType 11
authCode 7150

HF-LPB100, Software V1.0.04b

Hast Du ein etwas anderes Modell? Dann hilft wohl nur, die Datenpakete mit Wireshark mitzuschneiden.

(Nebenbei, von mir aus kann ich auch auf Englisch antworten, falls das einfacher sein sollte. Ich bin nur neu hier im Forum, und weiß nicht, ob das okay wäre.)

Hi there!
Can you post here the java app to test with my SWS-A1 SilverCrest?

Thanks a lot!

fhem4me

jmv_driver

See page 2 of this thread for the files you require.

fhem4me

I now have 2 working PHP files, one for each socket. Not sure what I was doing wrong last night.

Still can't get the Packet Sender to control the second Lidl device even though all the details seem to be the same as the corresponding PHP file.
I quite like the Packet Sender because you can save the successful packet transmissions and then it is just a single click of the corresponding 'saved button' to turn the devices on or off.
Ultimately PHP or Python is the way forward for me, to incorporate the control into a web GUI.

fhem4me

As well as the 2 working PHP files (one for each device I have) I now have 2 working Python files.

The problem I had was that the CLI for Python on the Raspberry Pi is only version 2.X. The GUI for Python on the Pi is the required version 3.X.
I also only had version 2.X on my Windows machine, now using version 3.X. The code will NOT work on version 2.X.

Working code if anyone needs it is:

#!/usr/bin/env python3

import socket
import time

mac = 'AC CF 23 34 0E 3C'
on  = '10 4C F7 5F 5A 28 A1 81 57 4A C1 B5 63 CD 51 A7 8D'
off = '10 F7 B4 E7 4B 97 0D 96 F3 CA 2B B5 D3 CD 1C 19 D0'


s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0)
s.connect(('192.168.10.135', 8530)) # (IP, Port) is a single variable passed to connect function

s.send(bytes.fromhex('01 40' + mac + on)) # to switch 'on'
time.sleep(5) # sleep for 5 seconds
s.send(bytes.fromhex('01 40' + mac + off)) # to switch 'off'


Be sure to set the correct IP and change the last 2 hexadecimal numbers for your MAC.

SebiM

Okay, was für ein Durcheinander  :)
Ich bleibe dann natürlich bei Deutsch, aber schreibe bewusst einfach.

Ich konnte mittlerweile herausfinden, wie die Verschlüsselung und Entschlüsselung mit PHP funktioniert. Dies setzt allerdings das mcrypt-Modul voraus: (Ubuntu; Debian und Raspian vermutlich dito)
apt-get install mcrypt php5-mcrypt
php5enmod mcrypt

...fragt mich jetzt bitte keiner, wie das unter Windows ausschauen würde.

Kann das Ganze irgendwer brauchen, dann hübsche ich den PHP-Code noch etwas auf und poste das hier?
Die Idee ist, dass man etwas leichter mit verschiedenen Parametern und Werten experimentieren kann, wenn man alles direkt ändern kann.

fhem4me

SebiM,

I for one would be very interested in further details of the encryption / decryption with PHP.