[SOLVED] Tuya (Teckin SB50) bulb Connection Issue

Hi all,

I have Teckin SB50 blubs, trying to control through openHAB. I think I did all the setup as instructed by @HolgiHab in his great effort here

Here is my item:
Switch BedRoom_TL1 "Bed Room Table Lamp" [ "Switchable" ] {channel="mqtt:topic:ccca1435:1002"}

Here is my sitemap:
Frame label="Bed Room" { Switch item=BedRoom_TL1 label="Bed Room Table Lamp" }

I got and used the ID, keys and IP address of the device. I can do the tuya-cli get command and get a successful payload from the bulb:

[root@telegramhost tuya-mqtt]# DEBUG=* tuya-cli get --ip --id xxxxxxxxxxxxxxxxxx --key xxxxxxxxxxx --all
TuyAPI IP and ID are already both resolved. +0ms
TuyAPI Connecting to… +3ms
TuyAPI Socket connected. +79ms
TuyAPI GET Payload: +1ms
TuyAPI { gwId: ‘xxxxxxxxxxxxxxxx’, devId: ‘xxxxxxxxxxxxxxxxx’ } +0ms
TuyAPI Pinging +10s
TuyAPI Received data: 000055aa00000000000000090000000c00000000b051bb030000ab45 +34ms
TuyAPI Parsed: +0ms
TuyAPI { payload: false, leftover: false, commandByte: 9, sequenceN: 0 } +0ms
TuyAPI Pong from +1ms

However, when I run the DEBUG=* node tuya-mqtt.js and send mqtt commands whether through openHAB items from the control tab or mqtt.fx app using the manual method, it keep failing as shown in the debug below:

TuyAPI:mqtt receive settings {“topic”:“tuya/xxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxx/”,“action”:“command”,“message”:“OFF”,“options”:{“id”:“xxxxxxxxxxxxxxxxx”,“key”:“xxxxxxxxxxxxxxx”,“ip”:“”}} +23s
TuyAPI:device Search device in network +23s
TuyAPI IP and ID are already both resolved. +23s
TuyAPI:device Device found in network +1ms
TuyAPI Connecting to… +0ms
TuyAPI Socket connected. +121ms
TuyAPI:device Connected to device. undefined (, xxxxxxxxxxxxxxxxx, xxxxxxxxxxxxx) +122ms
TuyAPI:device GET Payload: +0ms
TuyAPI:device { gwId: ‘xxxxxxxxxxxxxxxxx’, devId: ‘xxxxxxxxxxxxxxxxx’ } +0ms
TuyAPI:mqtt receive command { set: false } +124ms
TuyAPI:device set: { set: false } +1ms
TuyAPI SET Payload: +2ms
TuyAPI {
TuyAPI devId: ‘xxxxxxxxxxxxxxxxx’,
TuyAPI gwId: ‘xxxxxxxxxxxxxxxxx’,
TuyAPI uid: ‘’,
TuyAPI t: 1567712880,
TuyAPI dps: { ‘1’: false }
TuyAPI } +0ms
TuyAPI Pinging +10s
TuyAPI Error event from socket. Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:201:27) {
errno: ‘ECONNRESET’,
syscall: ‘read’
} +46ms
TuyAPI:device:error Error: Error from socket
TuyAPI:device:error at Socket. (/etc/openhab2/scripts/tuya-mqtt/node_modules/tuyapi/index.js:365:30)
TuyAPI:device:error at Socket.emit (events.js:209:13)
TuyAPI:device:error at emitErrorNT (internal/streams/destroy.js:91:8)
TuyAPI:device:error at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
TuyAPI:device:error at processTicksAndRejections (internal/process/task_queues.js:80:21) +34s
TuyAPI Socket closed: +1ms
TuyAPI:device Disconnected from device. undefined (, xxxxxxxxxxxxxxxxx, xxxxxxxxxxxxxxx) +10s
TuyAPI:device delete Device undefined (, xxxxxxxxxxxxxxxxx, xxxxxxxxxxxxxxx) +0ms

Things I tried so far:

restarted openHAB
restarted the bulb
closed the Smart Life app as some other people recommend
tried to remove the light from the Smart Life app
factory reset the bulb and reconfigure it which renewed the key then I reused the new key in openHAB thing and try again.

I’m running on the following:

openHAB: 2.4.0-1
OS: Linux CentOS 7 (Linux telegramhost.localhost 3.10.0-957.27.2.el7.x86_64 #1 SMP Mon Jul 29 17:46:05 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux)
Node: v12.10.0
NPM: 6.10.3

I think I’m in a rabbit hole now. Appreciate your help here.


Solved by @Fiftiz here