Help! Silvercrest wi-fi Plug

Hey,

can i configure this device (http://docs.openhab.org/addons/bindings/silvercrestwifisocket/readme.html) in hassio? if I can, could anyone show me how?

1 Like

Hi I also want to solve this. Did you found some solution? Can you share please? Thx Jan

No news regarding this topic? I was the creator of the binding for openhab, but i dont have knowledge on Python and homeassistant architecture to immediately develop this integration. I can help giving knowledge how this binding works on openhab from scratch.

I know it’s an old thread, but it’s the only Home Assistant thread I’ve found for these old Wi-Fi sockets.

The code to make this work (from your configuration.yaml) is below - it’s built as a linux command so you might need to install some tools (sed, xargs, netcat).

The first command echo’s the ‘switch on / off’ command and is the most complicated bit - you need to put in your switch’s MAC address here

 echo '0142{Your SWS-A1 MAC Address Here}104CF75F5A28A181574AC1B563CD51A78D' 

Then sed converts the string from hex to bin

 sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' $1 

Next xargs sorts out the output so it’s something we can use

 xargs printf 

Finally netcat sends the command to the SWS-A1

 nc -u {Your SWS-A1 IP Address} 8530 -w1 

So putting the whole lot together into Home Assistant’s config :

# Add Lidl SWS-A1 Switch Control
switch:
  - platform: command_line
    switches:
      sws_a1:
        command_on: echo '0142ACCF2334ABCD104CF75F5A28A181574AC1B563CD51A78D' | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' $1 | xargs printf | nc -u 192.168.1.100 8530 -w1
        command_off: echo '0142ACCF2334ABCD10F7B4E74B970D96F3CA2BB5D3CD1C19D0' | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' $1 | xargs printf | nc -u 192.168.1.100 8530 -w1
        friendly_name: SWS-A1 Socket

Hope this helps someone and keeps these old switches out of the bin :slightly_smiling_face:

Ric