Hacking the Silvercrest (Lidl/Tuya) Smart Home Gateway

From my experience, there is no more delay than any other Zigbee solution I have tried. The latency introduced by ethernet is pretty much imperceptible from something like USB in a use-case like this.

1 Like

Zigbee2MQTT is now possible on Lidl Gateway. Any ideas?

Hi,
Thank you for the clear instructions Paul! Was able to (after I finally figured out what the ESC button was) quickly follow the steps.
I have not yet been able to connect anything unfortunately. Have tested the Silvercrest Smart Motion Sensor and an Aqare Temp/Humidity sensor (no other Zigbee devices here).
I was reading up on the channel bit but for some reason when I try to run the Bellows command to try and change that, I am getting callback exceptions on _poll_write().

So effectively: Help, what can I be doing wrong? (running Python version 3.9.2 on Windows) :slight_smile:

@Simulacra, looks like that PR has now been merged into ZB2MQTT master :-). https://github.com/Koenkk/zigbee-herdsman/issues/319 is a follow on issue setup to track progress on the EZSP V8 support for ZB2MQTT.

For the hell of it, I have tested this with my Lidl gateway flashed with 6.7.8.0 manually setup for V8 and after I reset the network and cleared things down I was able to add a switch and a few other devices without issue. It works BUT it’s not yet mature, has a few rough edges and the network stability feels like it has issues (loosing the odd commands when I did some load tests). Running it previously on 6.7.8.0/V7 with ZHA directly in HA did not exhibit the same stability issues. Fixed to channel 11 and a power level of 18 in both cases.

Oh, as a side note, @Ordspilleren, your latest script (awesome by the way) seemed to have an issue with switching to the V8 API alongside the firmware updates directly from the old firmware, not sure quite what was going on (I’ll look more later). I think it was command ordering in the script when it sent over the firmware payload, but I just switched to setting it up over SSH one step at a time without issue (using your sx MIPS build).

I would also flag that I am not sure if switching back to the V7 API is totally ‘clean’ even after a reset. I ran into issues with the network but going back to a setup of 6.7.8.0/V8 seems to be working for me in ZHA as expected.

This is not my main ZigBee network (that’s a ZiGate via ZHA) so fairly happy to mess about with this.

Hi

I followed all the instructions and the very last step it giving me this error.

image

I have HA setup as a VM (used the hassos_ova-5.12.ova file).

I got my root password and I know all my files are OK.

I used WinSCP to check and can see the files are present, the serialgateway file is in the /tuya folder, the original tuya_start.sh has been renamed to tuya_start.original.sh and a new file tuya_start.sh which is only 1k in size has been created.

When I reboot the gateway I can no longer access it with the Smart Life App, so know it is not booting into the original config. After a lot of attempts nothing has worked and I keep getting the error shown above, ie Failed to Connect when I enter the IP of the gateway. I also know the IP is correct because I can connect via WinSCP.

I have also renamed the tuya_start.original.sh file back to tuya_start.sh and it boots back to the stock and I can access via the Smart Life App so I know the gateway is working.

Thanks in advance for any help!!

2 Likes

I don’t see any reason to keep compatibility with Tuya.

Hi everyone,

First of all, I would like to say thank you to @bool2 and @Ordspilleren for they great work.
My sylvercrest zigbee gateway if working like a charm in my homeassitant.

But :slight_smile: I have I little issue with my lidl remote.
I associated it with the gateway without any problem, I have an entity for the batterie. That’s fine.

I had read I should obtain some event in the dev tools panels, but I don’t see anythings.

I filtered by “zha_event” and “*” but no remote event appeared.

I try to disconnect/reassociate the remote, but nothings change in the event.

Is anyone succefully log the Lidl remote event ?

Regards,

Kikou.

Hi,

I’m trying to connect to serial console (I have NB with serial port ). At first I got no output whatsoever so I’ve switched Tx/Rx. Now I can see some output but just unreadable gibberish (nothing like <RealTek> etc). I’m using Putty with correct parameters. Do you have any idea what to try next or I must use some USB FTDI adapter?

Doing it on Windows might cause a problem because its pipes aren’t clean. (They sometimes corrupt the data going through them when they “helpfully” add byte-order marks, etc)

What commands did you use get serialgateway onto the device? You can check the serialgateway binary for corruption on the device using :

md5sum /tuya/serialgateway

and make sure it’s identical to the downloaded file.

You definitely need to use a TTL UART adapter!

A laptop serial port uses RS-232 not TTL 3V3. An RS-232 port can produce +/- 24V which would easily damage the serial port on the device which is only 3.3V so it’s possible your device’s serial port is now non-functional.

1 Like

Thanks, I’ll try to get one. I did not connect 3,3V line so I hope it’s not damaged.

UPDATE: after using USB UART adapter I’ve successfully connected t the Gateway and could continue with your great guide. Thank you again

UK Lidl discounted Gateway

1 Like

Thank you for the response Paul,
I checked the MD5 on both and they matched so “unfortunately” no windows-lets-add-some-random-chars issue. Just for the heck of it I transferred the file once more, but this time from a Linux machine and ran started it. Connect from HomeAssistant is immediately shown (Connect from host 192.168.xxx.xxx).
Unfortunately still no other response from bellows from Windows than the Exception. HOWEVER… I also ran bellows now from the Linux machine and that worked like a charm. Guess I can start changing e.g. channels now. :+1: :+1:

=> Update, after changing the channel to 11 everything started to come together and both sensors are now linked and returning information. Happy camper here! :grinning:

1 Like

I don’t understand? What do you mean by “compatibility with Tuya”, thanks

Hi

Further to my post number 84 above I have done a bit more investigation on the gateway.

I have followed all the instructions and cannot connect to the gateway via Home Assistant.

I get the following error:

image

When I check for open ports on the gateway I see that only port 2333 is open and not port 8888, so this maybe explains why it is not connecting.

Any suggestions what I have missed? The following files are present on the gateway in /tuya/ after doing the hack so I think I have done everything correctly:

tuya_start.sh
tuya_start.original.sh
serialgateway

Also I am doing all this form windows if that makes a difference?

PS I know the IP addresses in both pictures are different, I tried it on a different hub but still the same problem.

Thanks

ssh into the gateway and run serialgateway manually (/tuya/serialgateway) to see what happens.

If that works (Ctrl-C to stop the serialgateway process), start the start script manually:
sh /tuya/tuya_start.sh

2 Likes

I did it through putty:

image

Hey DJKalz,

Can you run

md5sum /tuya/serialgateway

on the device and check its the same as the file you downloaded. There were some problems with Windows users getting corrupt files after transferring it to the device.

Then, on the device, do “ps aux” and check it’s running in the list.

1 Like

There you go, the executable is broken. Make sure the program you’re using to transfer all the files (WinSCP?) doesn’t do any sort of “smart” modifications like converting line breaks or adding BOM markers.

Hey Paul

First I should thank you for your amazing contribution to this project and how much it is appreciated.

You are right, windows is corrupting the files.

The file I downloaded shows:

056b37c63254d398e0d8a6be5fc4e80a

And the one on the gateway is:

832d42b9c2f9c1dab49badf0780dcf2a

Can you confirm the one I downloaded should be 056b37c63254d398e0d8a6be5fc4e80a and I do have the correct file and it’s not been modified by my system.

Also, I cannot use WinSCP to transfer the files to the gateway, for some reason it shows this:

image

I’m assuming the gateway has a very stripped Linux and the commands WinSCP is using aren’t supported.

So what I did was use Powershell and it seemed to transfer the file, but obviously it’s changing it, here’s the Powershell command:

cat C:\tmp\serialgateway.bin | ssh -p2333 [email protected] “cat >/tuya/serialgateway”

Any suggestions on how else I can transfer the file via windows as only this worked, CMD also failed.

Thanks