smarthomej / addons

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

NX-4651 Switch comes online and goes immediately offline #448

Closed HDMatGIT closed 1 year ago

HDMatGIT commented 1 year ago

First of all THANKS A LOT FOR YOUR GREAT WORK! With your binding it was very easy to add many wlan wall plugs with switches (ZX-2820, Luminea from Pearl), all works great! I also got a wall switch and I have trouble to get it to work. It works fine in the Tuya Smart App, discovery works fine and identical to the wall plugs. To me the code of the items looks fine too, quite the same like for the wall plugs. I also can add channels and configure it, as well items. The only issue is, that the switch obviously come online and goes offline immediately. i tried to change the protocol, no change. The only difference for the wall plugs and the switch I can see in the logfile is that line: For the ZX-2820 it looks like: "bf3baae43329cdbcedclik/192.168.8.177:6668: Sending HEART_BEAT, payload {devId=bf3baae43329cdbcedclik, uid=bf3baae43329cdbcedclik, t=1673947211, dps=, gwId=bf3baae43329cdbcedclik}" and for the NX_4651 it looks like: "bfebe21c49e2e9fdf1f5vi/192.168.8.180:6668: Sending DP_QUERY, payload {devId=bfebe21c49e2e9fdf1f5vi, uid=bfebe21c49e2e9fdf1f5vi, t=1673947211, dps=null, gwId=bfebe21c49e2e9fdf1f5vi}"

The NX-4651 has the IP address 192.xxx.x.180. All the other IP addresses are the other plugs.

Any idea what goes wrong?

I'll attach the according log and the code of the thing...

Thank You!

Code of the Thing


UID: tuya:tuyaDevice:bfebe21c49e2e9fdf1f5vi label: FuSw_XMAS_Wozi_Stern thingTypeUID: tuya:tuyaDevice configuration: pollingInterval: 0 protocol: "3.3" productId: zug8ga3xtqlrdvy1 deviceId: bfebe21c49e2e9fdf1f5vi ip: 192.168.8.180 localKey: 0451c52cc7f3e1b1 channels:

according log:


10:20:06.557 [DEBUG] [a.internal.local.handlers.TuyaEncoder] - bf2fa2a0c7cc39d8fdaoql/192.168.8.166:6668: Sending HEART_BEAT, payload {devId=bf2fa2a0c7cc39d8fdaoql, uid=bf2fa2a0c7cc39d8fdaoql, t=1673947206, dps=, gwId=bf2fa2a0c7cc39d8fdaoql} 10:20:06.560 [TRACE] [a.internal.local.handlers.TuyaDecoder] - bf9afcd323e7959dd6mcb8//192.168.8.164:6668: Decoded raw payload: 10:20:06.562 [TRACE] [a.internal.local.handlers.TuyaEncoder] - bf2fa2a0c7cc39d8fdaoql/192.168.8.166:6668: Sending encoded '000055AA00007DCF0000000900000097332E33000000000000000000000000109CAC4C1E5CCF85720B7AC7F2E0FF5CC99ADF2CDE251FAE8BD963DF22F23A2C51431F4B1E46C4A1E498136DC116EE0A68EAD4972C3E24C6F9D073069E84CCD67BF2467371A106B19E9F3AAD43D6D4F22AC4B9AF0289E99AD02AB77D996B8C7DDABDAB93C31A5BAF3A145FDDB2CD82BF611CB1065800F1CC8AD33ECB380E98E020A8553B0000AA55' 10:20:06.564 [DEBUG] [a.internal.local.handlers.TuyaDecoder] - bf9afcd323e7959dd6mcb8//192.168.8.164:6668: Received MessageWrapper{commandType=HEART_BEAT, content=''} 10:20:06.568 [TRACE] [ernal.local.handlers.HeartbeatHandler] - bf9afcd323e7959dd6mcb8/192.168.8.164:6668: Received pong 10:20:06.572 [TRACE] [a.internal.local.handlers.TuyaDecoder] - bf2fa2a0c7cc39d8fdaoql/192.168.8.166:6668: Received encoded '000055AA00000000000000090000000C00000000B051AB030000AA55' 10:20:06.576 [TRACE] [a.internal.local.handlers.TuyaDecoder] - bf2fa2a0c7cc39d8fdaoql//192.168.8.166:6668: Decoded raw payload: 10:20:06.579 [DEBUG] [a.internal.local.handlers.TuyaDecoder] - bf2fa2a0c7cc39d8fdaoql//192.168.8.166:6668: Received MessageWrapper{commandType=HEART_BEAT, content=''} 10:20:06.582 [TRACE] [ernal.local.handlers.HeartbeatHandler] - bf2fa2a0c7cc39d8fdaoql/192.168.8.166:6668: Received pong 10:20:06.670 [TRACE] [ernal.local.handlers.HeartbeatHandler] - bf8454f32253cc5187otha/192.168.8.188:6668: Sending ping 10:20:06.673 [DEBUG] [a.internal.local.handlers.TuyaEncoder] - bf8454f32253cc5187otha/192.168.8.188:6668: Sending HEART_BEAT, payload {devId=bf8454f32253cc5187otha, uid=bf8454f32253cc5187otha, t=1673947206, dps=, gwId=bf8454f32253cc5187otha} 10:20:06.676 [TRACE] [a.internal.local.handlers.TuyaEncoder] - bf8454f32253cc5187otha/192.168.8.188:6668: Sending encoded '000055AA000000B70000000900000097332E33000000000000000000000000638DB98920D985DA51464ECA8667756B5CDCD4F6E6FE625532C1B8F1A0FE8C509EDEA01EFEB6846344BF62847C030CB886D5D7AB6937CEC2F80F557F1B6CDBD9B272181755727119EFD6F3CA9FE80742167902912E1685B7192E9DF34381704C97E67B6BC22A3656982EE2B06CEF26B98779278A2F10F8445F843F8517CF08B4BA144E9F0000AA55' 10:20:06.687 [TRACE] [a.internal.local.handlers.TuyaDecoder] - bf8454f32253cc5187otha/192.168.8.188:6668: Received encoded '000055AA00000000000000090000000C00000000B051AB030000AA55' 10:20:06.690 [TRACE] [a.internal.local.handlers.TuyaDecoder] - bf8454f32253cc5187otha//192.168.8.188:6668: Decoded raw payload: 10:20:06.693 [DEBUG] [a.internal.local.handlers.TuyaDecoder] - bf8454f32253cc5187otha//192.168.8.188:6668: Received MessageWrapper{commandType=HEART_BEAT, content=''} 10:20:06.695 [TRACE] [ernal.local.handlers.HeartbeatHandler] - bf8454f32253cc5187otha/192.168.8.188:6668: Received pong 10:20:06.915 [DEBUG] [inding.tuya.internal.local.TuyaDevice] - bf8e4aed7e9bdd1ac8wry9: Failed to connect: connection timed out: /192.168.8.184:6668 10:20:07.641 [TRACE] [a.internal.local.handlers.TuyaDecoder] - udpListener: Received encoded '000055AA000000000000000000000098000000007B226970223A223139322E3136382E382E313539222C2267774964223A2262663966353830636661306262643430666562617A6A222C22616374697665223A322C2261626C696C7479223A302C22656E6372797074223A747275652C2270726F647563744B6579223A22746F747534626E667764676C77743833222C2276657273696F6E223A22332E32227D8A607D8D0000AA55' 10:20:07.647 [DEBUG] [a.internal.local.handlers.TuyaDecoder] - udpListener/: Received MessageWrapper{commandType=UDP, content='DiscoveryMessage{ip='192.168.8.159', deviceId='bf9f580cfa0bbd40febazj', active=2, ability=0, mode=0, encrypt=true, productKey='totu4bnfwdglwt83', version='3.2'}'} 10:20:08.668 [DEBUG] [inding.tuya.internal.local.TuyaDevice] - bf383719ef9a84f442ndqa: Failed to connect: connection timed out: /192.168.8.178:6668 10:20:10.081 [TRACE] [ernal.local.handlers.HeartbeatHandler] - bfde7ed7f70def036aj9ut/192.168.8.186:6668: Sending ping 10:20:10.087 [DEBUG] [a.internal.local.handlers.TuyaEncoder] - bfde7ed7f70def036aj9ut/192.168.8.186:6668: Sending HEART_BEAT, payload {devId=bfde7ed7f70def036aj9ut, uid=bfde7ed7f70def036aj9ut, t=1673947210, dps=, gwId=bfde7ed7f70def036aj9ut} 10:20:10.092 [TRACE] [a.internal.local.handlers.TuyaEncoder] - bfde7ed7f70def036aj9ut/192.168.8.186:6668: Sending encoded '000055AA000014990000000900000097332E3300000000000000000000000062A13CA96254E4CB6B50F0A4704E240D454B7C49DA6AB044013346644BE79EBBD172A4F4E58B95EFBEBA2A5B0DE2433C76F9B2D4B73FC0AC66F7E58865A970B3CD4C22C3C63FE7317CD738C4C29E565CCE5F59E2A68064C604A52F0F2B8CD91C485A4F02FCD231FD91FFB0A07AA88F1B35CDFB4FC3E8635015B6880E7A4350067505E43E0000AA55' 10:20:10.107 [TRACE] [a.internal.local.handlers.TuyaDecoder] - bfde7ed7f70def036aj9ut/192.168.8.186:6668: Received encoded '000055AA00000000000000090000000C00000000B051AB030000AA55' 10:20:10.112 [TRACE] [a.internal.local.handlers.TuyaDecoder] - bfde7ed7f70def036aj9ut//192.168.8.186:6668: Decoded raw payload: 10:20:10.116 [DEBUG] [a.internal.local.handlers.TuyaDecoder] - bfde7ed7f70def036aj9ut//192.168.8.186:6668: Received MessageWrapper{commandType=HEART_BEAT, content=''} 10:20:10.119 [TRACE] [ernal.local.handlers.HeartbeatHandler] - bfde7ed7f70def036aj9ut/192.168.8.186:6668: Received pong 10:20:10.608 [DEBUG] [inding.tuya.internal.local.TuyaDevice] - bfcb18a49b167f4a89jdh7: Failed to connect: connection timed out: /192.168.8.181:6668 10:20:11.464 [DEBUG] [a.internal.local.handlers.TuyaEncoder] - bfebe21c49e2e9fdf1f5vi/192.168.8.180:6668: Sending DP_QUERY, payload {devId=bfebe21c49e2e9fdf1f5vi, uid=bfebe21c49e2e9fdf1f5vi, t=1673947211, dps=null, gwId=bfebe21c49e2e9fdf1f5vi} 10:20:11.469 [TRACE] [a.internal.local.handlers.TuyaEncoder] - bfebe21c49e2e9fdf1f5vi/192.168.8.180:6668: Sending encoded '000055AA000000010000000A000000880B985B9BAF2FAC9915420ED0916F5542DE138539E44C7916DAD1539E00EDA2BB4CA4BAA86B939E3AB4480850B93CE516DA723D4B5FB7ACAF368BAB1680267C52380DC6ECE41B4A240E52691D234030A2B90BC5333BBD2E9F97143B6080002471207BA6EB4F135F1925A603957315ABCABA0605F556B82FF064177D80CA0A90293738D83E0000AA55' 10:20:11.475 [DEBUG] [nal.local.handlers.TuyaMessageHandler] - bfebe21c49e2e9fdf1f5vi/192.168.8.180:6668: Connection established. 10:20:11.638 [TRACE] [ernal.local.handlers.HeartbeatHandler] - bfb50fbe2ea1c27a6atsyz/192.168.8.169:6668: Sending ping 10:20:11.643 [DEBUG] [a.internal.local.handlers.TuyaEncoder] - bfb50fbe2ea1c27a6atsyz/192.168.8.169:6668: Sending HEART_BEAT, payload {devId=bfb50fbe2ea1c27a6atsyz, uid=bfb50fbe2ea1c27a6atsyz, t=1673947211, dps=, gwId=bfb50fbe2ea1c27a6atsyz} 10:20:11.649 [TRACE] [a.internal.local.handlers.TuyaEncoder] - bfb50fbe2ea1c27a6atsyz/192.168.8.169:6668: Sending encoded '000055AA00001C4B0000000900000097332E330000000000000000000000002B3B9B794FC48119A96476EC82B945950EB8A9B5956D2FFB6DCF9505E2427EEC81D011A284718BF9C95B1A50AF66B42B1C84B557F568612C41F39EDED029FA1011B5A99F6AB55C54DA6EDD2B330EE5F7CEEFD72888DEAE5EB838D1EA012C65DFF2663FC77C8BFA2F158E9D0FB397E1E0469979575099EA04ECEE23ACC7EB18ADE12A7EDA0000AA55' 10:20:11.663 [TRACE] [a.internal.local.handlers.TuyaDecoder] - bfb50fbe2ea1c27a6atsyz/192.168.8.169:6668: Received encoded '000055AA00000000000000090000000C00000000B051AB030000AA55' 10:20:11.668 [TRACE] [a.internal.local.handlers.TuyaDecoder] - bfb50fbe2ea1c27a6atsyz//192.168.8.169:6668: Decoded raw payload: 10:20:11.670 [DEBUG] [nal.local.handlers.TuyaMessageHandler] - bfebe21c49e2e9fdf1f5vi/192.168.8.180:6668: Connection terminated. 10:20:11.674 [DEBUG] [a.internal.local.handlers.TuyaDecoder] - bfb50fbe2ea1c27a6atsyz//192.168.8.169:6668: Received MessageWrapper{commandType=HEART_BEAT, content=''} 10:20:11.678 [TRACE] [ernal.local.handlers.HeartbeatHandler] - bfb50fbe2ea1c27a6atsyz/192.168.8.169:6668: Received pong 10:20:11.680 [TRACE] [ernal.local.handlers.HeartbeatHandler] - bff7ca86f71921426266y4/192.168.8.170:6668: Sending ping 10:20:11.688 [DEBUG] [a.internal.local.handlers.TuyaEncoder] - bff7ca86f71921426266y4/192.168.8.170:6668: Sending HEART_BEAT, payload {devId=bff7ca86f71921426266y4, uid=bff7ca86f71921426266y4, t=1673947211, dps=, gwId=bff7ca86f71921426266y4} 10:20:11.694 [TRACE] [a.internal.local.handlers.TuyaEncoder] - bff7ca86f71921426266y4/192.168.8.170:6668: Sending encoded '000055AA00007DCE0000000900000097332E33000000000000000000000000CF7A20578C6ADABC76F947212724D0E65E35ED66E284F374B5371BDBF19CF844A9455AC8F7910F9BBECE484F037F4756107E7DCC98D90A1CFAAB70050E9E490D719505FCE4C0EC0DA812476489078454D91480B931D0EB8406D297287ADE5B3BA479125C09055880870D724CE6DB1907A191F5D7586B0073661B99A69E55FAC868A8087C0000AA55' 10:20:11.703 [TRACE] [ernal.local.handlers.HeartbeatHandler] - bfbfbda8c93ac34c88t5zx/192.168.8.189:6668: Sending ping 10:20:11.706 [TRACE] [a.internal.local.handlers.TuyaDecoder] - bff7ca86f71921426266y4/192.168.8.170:6668: Received encoded '000055AA00000000000000090000000C00000000B051AB030000AA55' 10:20:11.708 [DEBUG] [a.internal.local.handlers.TuyaEncoder] - bfbfbda8c93ac34c88t5zx/192.168.8.189:6668: Sending HEART_BEAT, payload {devId=bfbfbda8c93ac34c88t5zx, uid=bfbfbda8c93ac34c88t5zx, t=1673947211, dps=, gwId=bfbfbda8c93ac34c88t5zx} 10:20:11.713 [TRACE] [a.internal.local.handlers.TuyaDecoder] - bff7ca86f71921426266y4//192.168.8.170:6668: Decoded raw payload: 10:20:11.712 [TRACE] [ernal.local.handlers.HeartbeatHandler] - bf3baae43329cdbcedclik/192.168.8.177:6668: Sending ping 10:20:11.717 [DEBUG] [a.internal.local.handlers.TuyaDecoder] - bff7ca86f71921426266y4//192.168.8.170:6668: Received MessageWrapper{commandType=HEART_BEAT, content=''} 10:20:11.715 [TRACE] [a.internal.local.handlers.TuyaEncoder] - bfbfbda8c93ac34c88t5zx/192.168.8.189:6668: Sending encoded '000055AA000000A40000000900000097332E33000000000000000000000000853C8FEEB2DDFFCE27D44AB1A44EED952C45D0AFAE45C43DCEB320D75959FF9E0F9C1AF99CCF09AFE3064B45F791886565799BE8155791CC664F99239639D9A3CE8748304B955C054627BB1D061912D7EFA920729378B34AE50ACAA5C002FAA3309098237996F336877BFCA99063D4886CF1739D43FB3956BE940886BB203AB652C830340000AA55' 10:20:11.720 [TRACE] [ernal.local.handlers.HeartbeatHandler] - bff7ca86f71921426266y4/192.168.8.170:6668: Received pong 10:20:11.719 [DEBUG] [a.internal.local.handlers.TuyaEncoder] - bf3baae43329cdbcedclik/192.168.8.177:6668: Sending HEART_BEAT, payload {devId=bf3baae43329cdbcedclik, uid=bf3baae43329cdbcedclik, t=1673947211, dps=, gwId=bf3baae43329cdbcedclik} 10:20:11.726 [TRACE] [a.internal.local.handlers.TuyaEncoder] - bf3baae43329cdbcedclik/192.168.8.177:6668: Sending encoded '000055AA00007DC80000000900000097332E330000000000000000000000003FE107EA2395E3F5E6CCCAB66F96F78D2BBFAF4A5413E8591C466059EEE06C9724C3355BE690581D09B249F69CFD2575FF12203AC7E7076EF268BA7FEEBDBCF1C4A6F2E20BA51B7D927C219030ACAF38E0FBE1C5070524844BFBDE3D0DA56A683475F07B84CC59A7344A3738BE5CD704605E9CA52DB3A26FB57B51D424C98E276132BF500000AA55' 10:20:11.728 [TRACE] [a.internal.local.handlers.TuyaDecoder] - bfbfbda8c93ac34c88t5zx/192.168.8.189:6668: Received encoded '000055AA00000000000000090000000C00000000B051AB030000AA55' 10:20:11.733 [TRACE] [a.internal.local.handlers.TuyaDecoder] - bfbfbda8c93ac34c88t5zx//192.168.8.189:6668: Decoded raw payload: 10:20:11.736 [DEBUG] [a.internal.local.handlers.TuyaDecoder] - bfbfbda8c93ac34c88t5zx//192.168.8.189:6668: Received MessageWrapper{commandType=HEART_BEAT, content=''} 10:20:11.738 [TRACE] [a.internal.local.handlers.TuyaDecoder] - bf3baae43329cdbcedclik/192.168.8.177:6668: Received encoded '000055AA00000000000000090000000C00000000B051AB030000AA55' 10:20:11.739 [TRACE] [ernal.local.handlers.HeartbeatHandler] - bfbfbda8c93ac34c88t5zx/192.168.8.189:6668: Received pong 10:20:11.742 [TRACE] [a.internal.local.handlers.TuyaDecoder] - bf3baae43329cdbcedclik//192.168.8.177:6668: Decoded raw payload: 10:20:11.746 [DEBUG] [a.internal.local.handlers.TuyaDecoder] - bf3baae43329cdbcedclik//192.168.8.177:6668: Received MessageWrapper{commandType=HEART_BEAT, content=''} 10:20:11.749 [TRACE] [ernal.local.handlers.HeartbeatHandler] - bf3baae43329cdbcedclik/192.168.8.177:6668: Received pong 10:20:11.907 [DEBUG] [inding.tuya.internal.local.TuyaDevice] - bf53abbdaedd7b684bjpjx: Failed to connect: connection timed out: /192.168.8.185:6668 10:20:12.641 [TRACE] [a.internal.local.handlers.TuyaDecoder] - udpListener: Received encoded '000055AA000000000000000000000098000000007B226970223A223139322E3136382E382E313539222C2267774964223A2262663966353830636661306262643430666562617A6A222C22616374697665223A322C2261626C696C7479223A302C22656E6372797074223A747275652C2270726F647563744B6579223A22746F747534626E667764676C77743833222C2276657273696F6E223A22332E32227D8A607D8D0000AA55' 10:20:12.647 [DEBUG] [a.internal.local.handlers.TuyaDecoder] - udpListener/: Received MessageWrapper{commandType=UDP, content='DiscoveryMessage{ip='192.168.8.159', deviceId='bf9f580cfa0bbd40febazj', active=2, ability=0, mode=0, encrypt=true, productKey='totu4bnfwdglwt83', version='3.2'}'} ^C~

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

J-N-K commented 1 year ago

3.2 Protocol required. Will investigate

J-N-K commented 1 year ago

Sorry, I didn't read closely enough, the device with 3.2 is .159, not .180. Can you please try to get a log where the UDP discovery message

10:20:12.647 [DEBUG] [a.internal.local.handlers.TuyaDecoder] - udpListener/: Received MessageWrapper{commandType=UDP, content='DiscoveryMessage{ip='192.168.8.159', deviceId='bf9f580cfa0bbd40febazj', active=2, ability=0, mode=0, encrypt=true, productKey='totu4bnfwdglwt83', version='3.2'}'}

for the .180 device is included?

HDMatGIT commented 1 year ago

Thank you for your reply and sorry for my deleay here. I needed first to reestablish my test equipment. Unfortunately there is no udpListener for the .180 in my Logfiles. If I remove the thing from openhab and switch the device on it's immediately in the inbox and the behaviour is the same like described above. Here is the log I get:

2023-03-27 16:58:09.814 [DEBUG] [.internal.local.handlers.TuyaEncoder] - bfebe21c49e2e9fdf1f5vi/192.168.8.180:6668: Sending DP_QUERY, payload {devId=bfebe21c49e2e9fdf1f5vi, uid=bfebe21c49e2e9fdf1f5vi, t=1679929089, dps=null, gwId=bfebe2> 2023-03-27 16:58:09.821 [DEBUG] [al.local.handlers.TuyaMessageHandler] - bfebe21c49e2e9fdf1f5vi/192.168.8.180:6668: Connection established. 2023-03-27 16:58:09.923 [DEBUG] [al.local.handlers.TuyaMessageHandler] - bfebe21c49e2e9fdf1f5vi/192.168.8.180:6668: Connection terminated. 2023-03-27 16:58:10.638 [DEBUG] [.internal.local.handlers.TuyaEncoder] - bf3e8600d8808e661dv7yl/192.168.8.180:6668: Sending DP_QUERY, payload {devId=bf3e8600d8808e661dv7yl, uid=bf3e8600d8808e661dv7yl, t=1679929090, dps=null, gwId=bf3e86> 2023-03-27 16:58:10.644 [DEBUG] [al.local.handlers.TuyaMessageHandler] - bf3e8600d8808e661dv7yl/192.168.8.180:6668: Connection established. 2023-03-27 16:58:10.680 [DEBUG] [nding.tuya.internal.local.TuyaDevice] - bf8e4aed7e9bdd1ac8wry9: Failed to connect: connection timed out: /192.168.8.184:6668 2023-03-27 16:58:10.723 [DEBUG] [.internal.local.handlers.TuyaEncoder] - bf0269926bf8b98fc6nzqa/192.168.8.175:6668: Sending HEART_BEAT, payload {devId=bf0269926bf8b98fc6nzqa, uid=bf0269926bf8b98fc6nzqa, t=1679929090, dps=, gwId=bf026992> 2023-03-27 16:58:10.735 [DEBUG] [.internal.local.handlers.TuyaDecoder] - bf0269926bf8b98fc6nzqa//192.168.8.175:6668: Received MessageWrapper{commandType=HEART_BEAT, content=''} 2023-03-27 16:58:10.844 [DEBUG] [al.local.handlers.TuyaMessageHandler] - bf3e8600d8808e661dv7yl/192.168.8.180:6668: Connection terminated. 2

J-N-K commented 1 year ago

If there is no udpListener message from the device something is wrong. You can try changing the protocol to 3.4 or 3.1, but I doubt we'll find out how to support that.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.