smarthomej / addons

SmartHome/J addons for openHAB
Eclipse Public License 2.0
59 stars 24 forks source link

Ledkia DC Fan motor driver comes online but drop offline immediately #482

Closed marioschouten closed 1 year ago

marioschouten commented 1 year ago

Hi, Hope you can assist to make the only DC Ceiling fan motor driver that I have been able to find work on OpenHAB. Currently using 433MHz with a Sonoff bridge but is unreliable at best.

Running OpenHAB 3.4.3 on a Proxmox VM using Unifi with approx. 2600 items and 650 things using 18 bindings and heavy on Modbus traffic. The DC Fan controller is produced by ledkia dot com from Spain (website only works when VPN into Europe) and features a dimmable LED output with warm/cold colour adjust and a 6 speed DC fan output.

Fan controller in same subnet and can be pinged. Followed your instructions and setup went smooth with no supprises.

UID: tuya:tuyaDevice:eb0fa214c6ba81c3a7kylw
label: Tuya Fan Master Bathroom
thingTypeUID: tuya:tuyaDevice
configuration:
  pollingInterval: 0
  protocol: "3.3"
  productId: u5ovvhurbvynvspv
  deviceId: eb0fa214c6ba81c3a7kylw
  ip: 192.168.40.199
  localKey: xxxxxxxxxxxxxxxxxxxxxx
channels:
  - id: led_type_1
    channelTypeUID: tuya:string
    label: led_type_1
    description: null
    configuration:
      dp: 59
      range: led,incandescent,halogen
  - id: brightness_min_1
    channelTypeUID: tuya:number
    label: brightness_min_1
    description: null
    configuration:
      dp: 58
      max: 1000
      min: 10
  - id: fan_speed
    channelTypeUID: tuya:number
    label: fan_speed
    description: null
    configuration:
      dp: 62
      max: 6
      min: 1
  - id: countdown_left_fan
    channelTypeUID: tuya:number
    label: countdown_left_fan
    description: null
    configuration:
      dp: 64
      max: 540
      min: 0
  - id: colour_data
    channelTypeUID: tuya:color
    label: colour_data
    description: null
    configuration:
      dp: 24
      dp2: 20
  - id: fan_direction
    channelTypeUID: tuya:string
    label: fan_direction
    description: null
    configuration:
      dp: 63
      range: forward,reverse
  - id: bright_value
    channelTypeUID: tuya:dimmer
    label: bright_value
    description: null
    configuration:
      min: 10
      dp: 22
      max: 1000
      dp2: 20
  - id: temp_value
    channelTypeUID: tuya:dimmer
    label: temp_value
    description: null
    configuration:
      dp: 23
      max: 1000
      min: 0
  - id: work_mode
    channelTypeUID: tuya:string
    label: work_mode
    description: null
    configuration:
      dp: 21
      range: white,colour,scene,music
  - id: fan_switch
    channelTypeUID: tuya:switch
    label: fan_switch
    description: null
    configuration:
      dp: 60

The following is my trace log to add the thing, then specify the IP as that is not found and test on 3.3 and 3.1 protocol.

2023-04-27 18:12:49.536 [TRACE] [ding.tuya.internal.cloud.TuyaOpenAPI] - Sending to 'https://openapi.tuyaus.com/v1.0/users/az1682315181418eFE7r/devices?from=&page_no=1&page_size=100': Method = {GET}, Headers = {Accept-Encoding: gzip, User-Agent: Jetty/9.4.46.v20220331, sign: E70429BE09C8AB995D66F507D24054DFBA07F2D77EE2B5294B0838434F03863F, access_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx, sign_method: HMAC-SHA256, Signature-Headers: client_id, t: 1682593969535, client_id: xxxxxxxxxxxxxxxxxxxxxxxxxx}, Content = {null}
2023-04-27 18:12:50.388 [TRACE] [a.internal.cloud.TuyaContentListener] - Received from 'https://openapi.tuyaus.com/v1.0/users/az1682315181418eFE7r/devices?from=&page_no=1&page_size=100': Code = {200}, Headers = {Content-Type: application/json;charset=UTF-8, Content-Length: 1050, Connection: keep-alive, Date: Thu, 27 Apr 2023 11:12:50 GMT, Access-Control-Allow-Credentials: true, Access-Control-Allow-Headers: , Access-Control-Allow-Headers: access_token,Content-Type, Access-Control-Allow-Methods: POST, Access-Control-Allow-Methods: OPTIONS, Access-Control-Allow-Methods: GET, Access-Control-Allow-Methods: DELETE, Access-Control-Allow-Methods: PUT, Access-Control-Allow-Origin: https://iot.tuya.com, Gateway-Info: highway, Server: Tuya-Sec, Strict-Transport-Security: max-age=31536000}, Content = {{"result":[{"active_time":1682502362,"biz_type":18,"category":"fsd","create_time":1682501881,"icon":"smart/icon/ay1564458733639x1LBu/7e84ea311049e256d357d89d74276448.png","id":"eb0fa214c6ba81c3a7kylw","ip":"124.122.59.111","lat":"12.4700","local_key":"8084a2942db4f0ae","lon":"99.9600","model":"101","name":"Light+Fan-new product","online":true,"owner_id":"153888672","product_id":"u5ovvhurbvynvspv","product_name":"","status":[{"code":"switch_led","value":true},{"code":"work_mode","value":"white"},{"code":"bright_value","value":900},{"code":"temp_value","value":0},{"code":"colour_data","value":""},{"code":"scene_data","value":""},{"code":"brightness_min_1","value":10},{"code":"led_type_1","value":"led"},{"code":"fan_switch","value":false},{"code":"fan_speed","value":6},{"code":"fan_direction","value":"forward"},{"code":"countdown_left_fan","value":0}],"sub":false,"time_zone":"+07:00","uid":"az1682315181418eFE7r","update_time":1682502362,"uuid":"ba650599f2a1ec46"}],"success":true,"t":1682593970257,"tid":"726ca493e4ec11edb9dff29889e0185e"}}
2023-04-27 18:12:50.388 [TRACE] [ding.tuya.internal.cloud.TuyaOpenAPI] - Sending to 'https://openapi.tuyaus.com/v1.0/iot-03/devices/factory-infos?device_ids=eb0fa214c6ba81c3a7kylw': Method = {GET}, Headers = {Accept-Encoding: gzip, User-Agent: Jetty/9.4.46.v20220331, sign: 86B50F6596F205AE07B0D4E413534DE66F3A3A57297239D54C871E7033CD29F8, access_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx, sign_method: HMAC-SHA256, Signature-Headers: client_id, t: 1682593970388, client_id: xxxxxxxxxxxxxxxxxxxxxxxxxx}, Content = {null}
2023-04-27 18:12:50.692 [TRACE] [a.internal.cloud.TuyaContentListener] - Received from 'https://openapi.tuyaus.com/v1.0/iot-03/devices/factory-infos?device_ids=eb0fa214c6ba81c3a7kylw': Code = {200}, Headers = {Content-Type: application/json;charset=UTF-8, Content-Length: 187, Connection: keep-alive, Date: Thu, 27 Apr 2023 11:12:50 GMT, Access-Control-Allow-Credentials: true, Access-Control-Allow-Headers: , Access-Control-Allow-Headers: access_token,Content-Type, Access-Control-Allow-Methods: POST, Access-Control-Allow-Methods: OPTIONS, Access-Control-Allow-Methods: GET, Access-Control-Allow-Methods: DELETE, Access-Control-Allow-Methods: PUT, Access-Control-Allow-Origin: https://iot.tuya.com, Gateway-Info: highway, Server: Tuya-Sec, Strict-Transport-Security: max-age=31536000}, Content = {{"result":[{"id":"eb0fa214c6ba81c3a7kylw","mac":"1c90ff71135f","sn":"1000949210040D","uuid":"ba650599f2a1ec46"}],"success":true,"t":1682593970561,"tid":"72a2b32be4ec11edb9dff29889e0185e"}}
2023-04-27 18:12:50.692 [TRACE] [ding.tuya.internal.cloud.TuyaOpenAPI] - Sending to 'https://openapi.tuyaus.com/v1.1/devices/eb0fa214c6ba81c3a7kylw/specifications': Method = {GET}, Headers = {Accept-Encoding: gzip, User-Agent: Jetty/9.4.46.v20220331, sign: F0A5EDD55C321DD0FE46E653EB39FBD5F74004595D53809C07F807241BE3BA3F, access_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx, sign_method: HMAC-SHA256, Signature-Headers: client_id, t: 1682593970692, client_id: xxxxxxxxxxxxxxxxxxxxxxxxxx}, Content = {null}
2023-04-27 18:12:50.697 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'tuya:tuyaDevice:eb0fa214c6ba81c3a7kylw' to inbox.
2023-04-27 18:12:50.976 [TRACE] [a.internal.cloud.TuyaContentListener] - Received from 'https://openapi.tuyaus.com/v1.1/devices/eb0fa214c6ba81c3a7kylw/specifications': Code = {200}, Headers = {Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, Date: Thu, 27 Apr 2023 11:12:50 GMT, Access-Control-Allow-Credentials: true, Access-Control-Allow-Headers: , Access-Control-Allow-Headers: access_token,Content-Type, Access-Control-Allow-Methods: POST, Access-Control-Allow-Methods: OPTIONS, Access-Control-Allow-Methods: GET, Access-Control-Allow-Methods: DELETE, Access-Control-Allow-Methods: PUT, Access-Control-Allow-Origin: https://iot.tuya.com, Gateway-Info: highway, Server: Tuya-Sec, Strict-Transport-Security: max-age=31536000}, Content = {{"result":{"category":"fsd","functions":[{"code":"switch_led","dp_id":20,"type":"Boolean","values":"null"},{"code":"work_mode","dp_id":21,"type":"Enum","values":"{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}"},{"code":"bright_value","dp_id":22,"type":"Integer","values":"{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}"},{"code":"temp_value","dp_id":23,"type":"Integer","values":"{\"min\":0,\"max\":1000,\"scale\":0,\"step\":1}"},{"code":"colour_data","dp_id":24,"type":"Json","values":"null"},{"code":"scene_data","dp_id":25,"type":"String","values":"{\"maxlen\":255}"},{"code":"control_data","dp_id":28,"type":"String","values":"{\"maxlen\":255}"},{"code":"brightness_min_1","dp_id":58,"type":"Integer","values":"{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}"},{"code":"led_type_1","dp_id":59,"type":"Enum","values":"{\"range\":[\"led\",\"incandescent\",\"halogen\"]}"},{"code":"fan_switch","dp_id":60,"type":"Boolean","values":"{}"},{"code":"fan_speed","dp_id":62,"type":"Integer","values":"{\"unit\":\"\",\"min\":1,\"max\":6,\"scale\":0,\"step\":1}"},{"code":"fan_direction","dp_id":63,"type":"Enum","values":"{\"range\":[\"forward\",\"reverse\"]}"},{"code":"countdown_left_fan","dp_id":64,"type":"Integer","values":"{\"unit\":\"min\",\"min\":0,\"max\":540,\"scale\":0,\"step\":1}"}],"status":[{"code":"switch_led","dp_id":20,"type":"Boolean","values":"{}"},{"code":"work_mode","dp_id":21,"type":"Enum","values":"{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}"},{"code":"bright_value","dp_id":22,"type":"Integer","values":"{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}"},{"code":"temp_value","dp_id":23,"type":"Integer","values":"{\"min\":0,\"max\":1000,\"scale\":0,\"step\":1}"},{"code":"colour_data","dp_id":24,"type":"Json","values":"{}"},{"code":"scene_data","dp_id":25,"type":"String","values":"{\"maxlen\":255}"},{"code":"brightness_min_1","dp_id":58,"type":"Integer","values":"{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}"},{"code":"led_type_1","dp_id":59,"type":"Enum","values":"{\"range\":[\"led\",\"incandescent\",\"halogen\"]}"},{"code":"fan_switch","dp_id":60,"type":"Boolean","values":"{}"},{"code":"fan_speed","dp_id":62,"type":"Integer","values":"{\"unit\":\"\",\"min\":1,\"max\":6,\"scale\":0,\"step\":1}"},{"code":"fan_direction","dp_id":63,"type":"Enum","values":"{\"range\":[\"forward\",\"reverse\"]}"},{"code":"countdown_left_fan","dp_id":64,"type":"Integer","values":"{\"unit\":\"min\",\"min\":0,\"max\":540,\"scale\":0,\"step\":1}"}]},"success":true,"t":1682593970844,"tid":"72d0f772e4ec11ed9df2160ff6ce5e91"}}

2023-04-27 18:13:58.745 [TRACE] [ding.tuya.internal.cloud.TuyaOpenAPI] - Sending to 'https://openapi.tuyaus.com/v1.0/users/az1682315181418eFE7r/devices?from=&page_no=1&page_size=100': Method = {GET}, Headers = {Accept-Encoding: gzip, User-Agent: Jetty/9.4.46.v20220331, sign: C25F86356B7E6B9504686A440BB04ADBDCE43087141BA01DF638F27954AB1702, access_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx, sign_method: HMAC-SHA256, Signature-Headers: client_id, t: 1682594038745, client_id: xxxxxxxxxxxxxxxxxxxxxxxxxx}, Content = {null}
2023-04-27 18:13:59.045 [TRACE] [a.internal.cloud.TuyaContentListener] - Received from 'https://openapi.tuyaus.com/v1.0/users/az1682315181418eFE7r/devices?from=&page_no=1&page_size=100': Code = {200}, Headers = {Content-Type: application/json;charset=UTF-8, Content-Length: 1050, Connection: keep-alive, Date: Thu, 27 Apr 2023 11:13:58 GMT, Access-Control-Allow-Credentials: true, Access-Control-Allow-Headers: , Access-Control-Allow-Headers: access_token,Content-Type, Access-Control-Allow-Methods: POST, Access-Control-Allow-Methods: OPTIONS, Access-Control-Allow-Methods: GET, Access-Control-Allow-Methods: DELETE, Access-Control-Allow-Methods: PUT, Access-Control-Allow-Origin: https://iot.tuya.com, Gateway-Info: highway, Server: Tuya-Sec, Strict-Transport-Security: max-age=31536000}, Content = {{"result":[{"active_time":1682502362,"biz_type":18,"category":"fsd","create_time":1682501881,"icon":"smart/icon/ay1564458733639x1LBu/7e84ea311049e256d357d89d74276448.png","id":"eb0fa214c6ba81c3a7kylw","ip":"124.122.59.111","lat":"12.4700","local_key":"8084a2942db4f0ae","lon":"99.9600","model":"101","name":"Light+Fan-new product","online":true,"owner_id":"153888672","product_id":"u5ovvhurbvynvspv","product_name":"","status":[{"code":"switch_led","value":true},{"code":"work_mode","value":"white"},{"code":"bright_value","value":900},{"code":"temp_value","value":0},{"code":"colour_data","value":""},{"code":"scene_data","value":""},{"code":"brightness_min_1","value":10},{"code":"led_type_1","value":"led"},{"code":"fan_switch","value":false},{"code":"fan_speed","value":6},{"code":"fan_direction","value":"forward"},{"code":"countdown_left_fan","value":0}],"sub":false,"time_zone":"+07:00","uid":"az1682315181418eFE7r","update_time":1682502362,"uuid":"ba650599f2a1ec46"}],"success":true,"t":1682594038911,"tid":"9b612c71e4ec11edb9dff29889e0185e"}}
2023-04-27 18:13:59.045 [TRACE] [ding.tuya.internal.cloud.TuyaOpenAPI] - Sending to 'https://openapi.tuyaus.com/v1.0/iot-03/devices/factory-infos?device_ids=eb0fa214c6ba81c3a7kylw': Method = {GET}, Headers = {Accept-Encoding: gzip, User-Agent: Jetty/9.4.46.v20220331, sign: 8933AD42CF256F14BC2858E30A2004706BAE1F5ADB9FE4A39821FC98BAE1B179, access_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx, sign_method: HMAC-SHA256, Signature-Headers: client_id, t: 1682594039045, client_id: xxxxxxxxxxxxxxxxxxxxxxxxxx}, Content = {null}
2023-04-27 18:13:59.324 [TRACE] [a.internal.cloud.TuyaContentListener] - Received from 'https://openapi.tuyaus.com/v1.0/iot-03/devices/factory-infos?device_ids=eb0fa214c6ba81c3a7kylw': Code = {200}, Headers = {Content-Type: application/json;charset=UTF-8, Content-Length: 187, Connection: keep-alive, Date: Thu, 27 Apr 2023 11:13:59 GMT, Access-Control-Allow-Credentials: true, Access-Control-Allow-Headers: , Access-Control-Allow-Headers: access_token,Content-Type, Access-Control-Allow-Methods: POST, Access-Control-Allow-Methods: OPTIONS, Access-Control-Allow-Methods: GET, Access-Control-Allow-Methods: DELETE, Access-Control-Allow-Methods: PUT, Access-Control-Allow-Origin: https://iot.tuya.com, Gateway-Info: highway, Server: Tuya-Sec, Strict-Transport-Security: max-age=31536000}, Content = {{"result":[{"id":"eb0fa214c6ba81c3a7kylw","mac":"1c90ff71135f","sn":"1000949210040D","uuid":"ba650599f2a1ec46"}],"success":true,"t":1682594039183,"tid":"9b8ee21ee4ec11edb9dff29889e0185e"}}
2023-04-27 18:13:59.325 [TRACE] [ding.tuya.internal.cloud.TuyaOpenAPI] - Sending to 'https://openapi.tuyaus.com/v1.1/devices/eb0fa214c6ba81c3a7kylw/specifications': Method = {GET}, Headers = {Accept-Encoding: gzip, User-Agent: Jetty/9.4.46.v20220331, sign: 097BD2EEFA6A9BD548B628B73223B0325D056BB2F67D5177242272B1924D6B3E, access_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx, sign_method: HMAC-SHA256, Signature-Headers: client_id, t: 1682594039325, client_id: xxxxxxxxxxxxxxxxxxxxxxxxxx}, Content = {null}
2023-04-27 18:13:59.598 [TRACE] [a.internal.cloud.TuyaContentListener] - Received from 'https://openapi.tuyaus.com/v1.1/devices/eb0fa214c6ba81c3a7kylw/specifications': Code = {200}, Headers = {Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, Date: Thu, 27 Apr 2023 11:13:59 GMT, Access-Control-Allow-Credentials: true, Access-Control-Allow-Headers: , Access-Control-Allow-Headers: access_token,Content-Type, Access-Control-Allow-Methods: POST, Access-Control-Allow-Methods: OPTIONS, Access-Control-Allow-Methods: GET, Access-Control-Allow-Methods: DELETE, Access-Control-Allow-Methods: PUT, Access-Control-Allow-Origin: https://iot.tuya.com, Gateway-Info: highway, Server: Tuya-Sec, Strict-Transport-Security: max-age=31536000}, Content = {{"result":{"category":"fsd","functions":[{"code":"switch_led","dp_id":20,"type":"Boolean","values":"null"},{"code":"work_mode","dp_id":21,"type":"Enum","values":"{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}"},{"code":"bright_value","dp_id":22,"type":"Integer","values":"{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}"},{"code":"temp_value","dp_id":23,"type":"Integer","values":"{\"min\":0,\"max\":1000,\"scale\":0,\"step\":1}"},{"code":"colour_data","dp_id":24,"type":"Json","values":"null"},{"code":"scene_data","dp_id":25,"type":"String","values":"{\"maxlen\":255}"},{"code":"control_data","dp_id":28,"type":"String","values":"{\"maxlen\":255}"},{"code":"brightness_min_1","dp_id":58,"type":"Integer","values":"{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}"},{"code":"led_type_1","dp_id":59,"type":"Enum","values":"{\"range\":[\"led\",\"incandescent\",\"halogen\"]}"},{"code":"fan_switch","dp_id":60,"type":"Boolean","values":"{}"},{"code":"fan_speed","dp_id":62,"type":"Integer","values":"{\"unit\":\"\",\"min\":1,\"max\":6,\"scale\":0,\"step\":1}"},{"code":"fan_direction","dp_id":63,"type":"Enum","values":"{\"range\":[\"forward\",\"reverse\"]}"},{"code":"countdown_left_fan","dp_id":64,"type":"Integer","values":"{\"unit\":\"min\",\"min\":0,\"max\":540,\"scale\":0,\"step\":1}"}],"status":[{"code":"switch_led","dp_id":20,"type":"Boolean","values":"{}"},{"code":"work_mode","dp_id":21,"type":"Enum","values":"{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}"},{"code":"bright_value","dp_id":22,"type":"Integer","values":"{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}"},{"code":"temp_value","dp_id":23,"type":"Integer","values":"{\"min\":0,\"max\":1000,\"scale\":0,\"step\":1}"},{"code":"colour_data","dp_id":24,"type":"Json","values":"{}"},{"code":"scene_data","dp_id":25,"type":"String","values":"{\"maxlen\":255}"},{"code":"brightness_min_1","dp_id":58,"type":"Integer","values":"{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}"},{"code":"led_type_1","dp_id":59,"type":"Enum","values":"{\"range\":[\"led\",\"incandescent\",\"halogen\"]}"},{"code":"fan_switch","dp_id":60,"type":"Boolean","values":"{}"},{"code":"fan_speed","dp_id":62,"type":"Integer","values":"{\"unit\":\"\",\"min\":1,\"max\":6,\"scale\":0,\"step\":1}"},{"code":"fan_direction","dp_id":63,"type":"Enum","values":"{\"range\":[\"forward\",\"reverse\"]}"},{"code":"countdown_left_fan","dp_id":64,"type":"Integer","values":"{\"unit\":\"min\",\"min\":0,\"max\":540,\"scale\":0,\"step\":1}"}]},"success":true,"t":1682594039463,"tid":"9bb9dd34e4ec11ed9e189607f7cda52d"}}

2023-04-27 18:14:17.646 [INFO ] [a.internal.handler.TuyaDeviceHandler] - Configuring IP address 'DeviceInfo{ip='192.168.40.199', version='3.3'}' for thing 'tuya:tuyaDevice:eb0fa214c6ba81c3a7kylw'.
2023-04-27 18:14:17.655 [DEBUG] [.internal.local.handlers.TuyaEncoder] - eb0fa214c6ba81c3a7kylw/192.168.40.199:6668: Sending DP_QUERY, payload {devId=eb0fa214c6ba81c3a7kylw, uid=eb0fa214c6ba81c3a7kylw, t=1682594057, dps=null, gwId=eb0fa214c6ba81c3a7kylw}
2023-04-27 18:14:17.655 [TRACE] [.internal.local.handlers.TuyaEncoder] - eb0fa214c6ba81c3a7kylw/192.168.40.199:6668: Sending encoded '000055AA000000010000000A00000088803DE63CAEAA91EA841F6873CE4571398A953B792A037BA7BC1ADCB143E73970D8359E46F11E3C187465B2A9520B84BE560C977D5BCB1945A03BCA2C50B218831A535FD833F945277FF18C82C5A9E764AF0F6CFBB2FA74805DF8CD30A17A2B12BD862A431A0D6F74FFD803A1AB2C887D990254CED4BF104C6165A8DE2C8DF3E527DB04AC0000AA55'
2023-04-27 18:14:17.656 [DEBUG] [al.local.handlers.TuyaMessageHandler] - eb0fa214c6ba81c3a7kylw/192.168.40.199:6668: Connection established.
2023-04-27 18:14:17.668 [DEBUG] [rnal.local.handlers.UserEventHandler] - eb0fa214c6ba81c3a7kylw/192.168.40.199:6668: IOException caught, closing channel.
java.io.IOException: Connection reset by peer
    at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[?:?]
    at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) ~[?:?]
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276) ~[?:?]
    at sun.nio.ch.IOUtil.read(IOUtil.java:233) ~[?:?]
    at sun.nio.ch.IOUtil.read(IOUtil.java:223) ~[?:?]
    at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:356) ~[?:?]
    at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253) ~[bundleFile:4.1.72.Final]
    at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132) ~[bundleFile:4.1.72.Final]
    at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350) ~[bundleFile:4.1.72.Final]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151) [bundleFile:4.1.72.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) [bundleFile:4.1.72.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) [bundleFile:4.1.72.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) [bundleFile:4.1.72.Final]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) [bundleFile:4.1.72.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) [bundleFile:4.1.72.Final]
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [bundleFile:4.1.72.Final]
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.72.Final]
    at java.lang.Thread.run(Thread.java:829) [?:?]
2023-04-27 18:14:17.669 [DEBUG] [rnal.local.handlers.UserEventHandler] - IOException caught: 
java.io.IOException: Connection reset by peer
    at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[?:?]
    at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) ~[?:?]
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276) ~[?:?]
    at sun.nio.ch.IOUtil.read(IOUtil.java:233) ~[?:?]
    at sun.nio.ch.IOUtil.read(IOUtil.java:223) ~[?:?]
    at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:356) ~[?:?]
    at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253) ~[bundleFile:4.1.72.Final]
    at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132) ~[bundleFile:4.1.72.Final]
    at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350) ~[bundleFile:4.1.72.Final]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151) [bundleFile:4.1.72.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) [bundleFile:4.1.72.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) [bundleFile:4.1.72.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) [bundleFile:4.1.72.Final]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) [bundleFile:4.1.72.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) [bundleFile:4.1.72.Final]
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [bundleFile:4.1.72.Final]
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.72.Final]
    at java.lang.Thread.run(Thread.java:829) [?:?]
2023-04-27 18:14:17.669 [DEBUG] [al.local.handlers.TuyaMessageHandler] - eb0fa214c6ba81c3a7kylw/192.168.40.199:6668: Connection terminated.

2023-04-27 18:14:32.299 [INFO ] [a.internal.handler.TuyaDeviceHandler] - Configuring IP address 'DeviceInfo{ip='192.168.40.199', version='3.1'}' for thing 'tuya:tuyaDevice:eb0fa214c6ba81c3a7kylw'.
2023-04-27 18:14:32.306 [DEBUG] [.internal.local.handlers.TuyaEncoder] - eb0fa214c6ba81c3a7kylw/192.168.40.199:6668: Sending DP_QUERY, payload {devId=eb0fa214c6ba81c3a7kylw, uid=eb0fa214c6ba81c3a7kylw, t=1682594072, dps=null, gwId=eb0fa214c6ba81c3a7kylw}
2023-04-27 18:14:32.307 [TRACE] [.internal.local.handlers.TuyaEncoder] - eb0fa214c6ba81c3a7kylw/192.168.40.199:6668: Sending encoded '000055AA000000010000000A000000817B226465764964223A226562306661323134633662613831633361376B796C77222C22756964223A226562306661323134633662613831633361376B796C77222C2274223A313638323539343037322C22647073223A7B7D2C2267774964223A226562306661323134633662613831633361376B796C77227D948C90A70000AA55'
2023-04-27 18:14:32.307 [DEBUG] [al.local.handlers.TuyaMessageHandler] - eb0fa214c6ba81c3a7kylw/192.168.40.199:6668: Connection established.
2023-04-27 18:14:32.315 [DEBUG] [rnal.local.handlers.UserEventHandler] - eb0fa214c6ba81c3a7kylw/192.168.40.199:6668: IOException caught, closing channel.
java.io.IOException: Connection reset by peer
    at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[?:?]
    at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) ~[?:?]
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276) ~[?:?]
    at sun.nio.ch.IOUtil.read(IOUtil.java:233) ~[?:?]
    at sun.nio.ch.IOUtil.read(IOUtil.java:223) ~[?:?]
    at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:356) ~[?:?]
    at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253) ~[bundleFile:4.1.72.Final]
    at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132) ~[bundleFile:4.1.72.Final]
    at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350) ~[bundleFile:4.1.72.Final]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151) [bundleFile:4.1.72.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) [bundleFile:4.1.72.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) [bundleFile:4.1.72.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) [bundleFile:4.1.72.Final]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) [bundleFile:4.1.72.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) [bundleFile:4.1.72.Final]
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [bundleFile:4.1.72.Final]
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.72.Final]
    at java.lang.Thread.run(Thread.java:829) [?:?]
2023-04-27 18:14:32.316 [DEBUG] [rnal.local.handlers.UserEventHandler] - IOException caught: 
java.io.IOException: Connection reset by peer
    at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[?:?]
    at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) ~[?:?]
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276) ~[?:?]
    at sun.nio.ch.IOUtil.read(IOUtil.java:233) ~[?:?]
    at sun.nio.ch.IOUtil.read(IOUtil.java:223) ~[?:?]
    at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:356) ~[?:?]
    at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253) ~[bundleFile:4.1.72.Final]
    at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132) ~[bundleFile:4.1.72.Final]
    at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350) ~[bundleFile:4.1.72.Final]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151) [bundleFile:4.1.72.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) [bundleFile:4.1.72.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) [bundleFile:4.1.72.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) [bundleFile:4.1.72.Final]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) [bundleFile:4.1.72.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) [bundleFile:4.1.72.Final]
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [bundleFile:4.1.72.Final]
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.72.Final]
    at java.lang.Thread.run(Thread.java:829) [?:?]
2023-04-27 18:14:32.317 [DEBUG] [al.local.handlers.TuyaMessageHandler] - eb0fa214c6ba81c3a7kylw/192.168.40.199:6668: Connection terminated.

Please let me know if there is any additional info that I can supply or any tests you would like me to perform.

Thanks, Mario

marioschouten commented 1 year ago

Hi, Tested today on OpenHAB 3.4.4 and Smarthome/J Tuya Binding version 3.2.17 and it works, latency is practically none. The Generic Tuya Device fields IP Address and Protocol Version are empty but the scan found the device on the local network. Happy, thanks for the great work on this binding. Regards, Mario