jasonacox / tinytuya

Python API for Tuya WiFi smart devices using a direct local area network (LAN) connection or the cloud (TuyaCloud API).
MIT License
923 stars 165 forks source link

Unresponsive Avatto 20A socket #279

Closed Oglaf closed 1 year ago

Oglaf commented 1 year ago

Hello again, new device, new errors. This time is an Avatto 20A socket. Looks like a protocol 3.5 error.

Snapshot:

Polling local devices...
    [Bedroom light            ] 192.168.1.203      - [Off] - DPS: {'20': False, '21': 'white', '22': 18, '23': 0, '24': '001002a80012', '25': '000e0d0000000000000000c80000', '26': 0, '34': False}
    [Cleaner Robot            ] 192.168.1.202      - [On]  - DPS: {'1': True, '11': 0, '14': 51, '25': False, '26': 'foward', '27': 'standby', '28': 'charging', '30': 'high', '31': True, '32': 41, '33': 59, '34': '05904100832', '102': '1499,1,0,0,4,113,  0,  2,  3,  3,0,0, 152, 111, 0, 0,1,  0,  601'}
    [Computer socket          ] 192.168.1.207      - [On]  - DPS: {'1': True, '9': 0, '17': 51, '18': 809, '19': 952, '20': 1255, '21': 1, '22': 617, '23': 31090, '24': 17649, '25': 1180, '26': 0}
    [Electric blanket socket  ] 192.168.1.201      - [Off] - DPS: {'1': False, '9': 0, '17': 1, '18': 0, '19': 0, '20': 1253, '21': 1, '22': 564, '23': 29000, '24': 15795, '25': 2640, '26': 0, '38': 'memory', '41': '', '42': '', '46': True}
    [Fan socket               ] 192.168.1.206      - [Off] - DPS: {'1': False, '9': 0, '17': 6, '18': 0, '19': 0, '20': 1252, '21': 1, '22': 625, '23': 31468, '24': 18126, '25': 1148, '26': 0}
    [Living room light        ] 192.168.1.204      - [On]  - DPS: {'20': True, '21': 'white', '22': 903, '23': 0, '24': '00f003e80054', '25': '000e0d0000000000000000c80000', '26': 0, '34': False}
    [Oven socket              ] 192.168.1.244      - No Response
    [Pet feeder               ] 192.168.1.200      - DPS: {'4': 'standby', '14': 0, '15': 1}
    [Temperature Sensor       ] Error: No IP found
    [Washing Machine Socket   ] 192.168.1.145      - No Response

Devices:

{
        "name": "Oven socket",
        "id": "eb860d52d52d7d56172s3b",
        "key": "14e2fe4c41020a58",
        "mac": "fc:67:1f:f1:d4:c7",
        "category": "cz",
        "product_name": "Smart Socket",
        "product_id": "grpvptbrpkissnd8",
        "biz_type": 18,
        "model": "",
        "sub": false,
        "icon": "https://images.tuyaus.com/smart/icon/ay1547110530245tcZgC/77971bbb812f5f43189be29347129d88.png",
        "uuid": "68372927fa72d307"
    },
    {
        "name": "Washing Machine Socket",
        "id": "eba8ad303d30bd1163sbju",
        "key": "e7eab2afe4765e27",
        "mac": "fc:67:1f:f1:cc:70",
        "category": "cz",
        "product_name": "Smart Socket",
        "product_id": "grpvptbrpkissnd8",
        "biz_type": 18,
        "model": "",
        "sub": false,
        "icon": "https://images.tuyaus.com/smart/icon/ay1547110530245tcZgC/77971bbb812f5f43189be29347129d88.png",
        "uuid": "ed4ca9b41da11b64"
    },

Scan:

TinyTuya (Tuya device scanner) [1.10.1]
[Loaded devices.json - 11 devices]

Scanning on UDP ports 6666 and 6667 and 7000 for devices for 18 seconds...

Cleaner Robot   Product ID = wexaeucvbdawkkpo  [Valid Broadcast]:
    Address = 192.168.1.202   Device ID = eb1f0804f3145f2189grsj (len:22)  Local Key = 707bbed1ba120c27  Version = 3.3  Type = default, MAC = 70:89:76:1b:67:f1
    Status: {'1': True, '11': 0, '14': 50, '25': False, '26': 'foward', '27': 'standby', '28': 'charging', '30': 'high', '31': True, '32': 41, '33': 59, '34': '05904100832', '102': '1497,1,0,0,4,113,  0,  2,  3,  3,0,0, 149, 111, 0, 0,1,  0,  601'}
Fan socket   Product ID = keydnqmh87c8ajv4  [Valid Broadcast]:
    Address = 192.168.1.206   Device ID = eb099f68fc98defbd6vqcs (len:22)  Local Key = dfd4cb0ca6a36d8a  Version = 3.3  Type = default, MAC = d8:1f:12:d2:57:71
    Status: {'1': False, '9': 0, '17': 6, '18': 0, '19': 0, '20': 1252, '21': 1, '22': 625, '23': 31468, '24': 18126, '25': 1148, '26': 0}
Electric blanket socket   Product ID = keym9qkuywghyrvs  [Valid Broadcast]:
    Address = 192.168.1.201   Device ID = eb06b9ad96cc645217ruup (len:22)  Local Key = 5cd62b469b6d961e  Version = 3.3  Type = default, MAC = 7c:f6:66:86:bf:06
    Status: {'1': False, '9': 0, '17': 1, '18': 0, '19': 0, '20': 1249, '21': 1, '22': 564, '23': 29000, '24': 15795, '25': 2640, '26': 0, '38': 'memory', '41': '', '42': '', '46': True}
Pet feeder   Product ID = 5xierbs16mkdnkpk  [Valid Broadcast]:
    Address = 192.168.1.200   Device ID = eb629cf13d51f2d0d5gv7t (len:22)  Local Key = 99af400dccb3a41b  Version = 3.3  Type = default, MAC = 7c:f6:66:22:b7:b0
    Status: {'4': 'standby', '14': 0, '15': 1}
Bedroom light   Product ID = keytg5kq8gvkv9dh  [Valid Broadcast]:
    Address = 192.168.1.203   Device ID = eb3dcc68131b35ae344alc (len:22)  Local Key = d9bb19e75b0aa051  Version = 3.3  Type = default, MAC = d8:1f:12:c9:54:c4
    Status: {'20': False, '21': 'white', '22': 18, '23': 0, '24': '001002a80012', '25': '000e0d0000000000000000c80000', '26': 0, '34': False}
Office light   Product ID = key8u54q9dtru5jw  [Valid Broadcast]:
    Address = 192.168.1.205   Device ID = eb68e355da1be4ae69ok5o (len:22)  Local Key = 6434389541e96704  Version = 3.5  Type = default, MAC = 38:1f:8d:4f:66:f6
    Status: {'20': True, '21': 'white', '22': 930, '23': 3, '24': '014a03e803a9', '25': '04464602007803e803e800000000464602007803e8000a00000000', '26': 0, '34': False}
Computer socket   Product ID = keydnqmh87c8ajv4  [Valid Broadcast]:
    Address = 192.168.1.207   Device ID = eb597c0e524d178a80caat (len:22)  Local Key = bdf5b78fccf86c7b  Version = 3.3  Type = default, MAC = d8:1f:12:d2:55:d1
    Status: {'1': True, '9': 0, '17': 51, '18': 788, '19': 950, '20': 1255, '21': 1, '22': 617, '23': 31090, '24': 17649, '25': 1180, '26': 0}
Living room light   Product ID = keytg5kq8gvkv9dh  [Valid Broadcast]:
    Address = 192.168.1.204   Device ID = ebd1b02d382049733dnq0u (len:22)  Local Key = c383f271346743c0  Version = 3.3  Type = default, MAC = d8:1f:12:c9:54:66
    Status: {'20': True, '21': 'white', '22': 930, '23': 0, '24': '00f003e80054', '25': '000e0d0000000000000000c80000', '26': 0, '34': False}
Oven socket   Product ID = keyjup78v54myhan  [Valid Broadcast]:
    Address = 192.168.1.244   Device ID = eb860d52d52d7d56172s3b (len:22)  Local Key = 14e2fe4c41020a58  Version = 3.3  Type = default, MAC = fc:67:1f:f1:d4:c7
    Polling 192.168.1.244 Failed:
Washing Machine Socket   Product ID = keyjup78v54myhan  [Valid Broadcast]:
    Address = 192.168.1.145   Device ID = eba8ad303d30bd1163sbju (len:22)  Local Key = e7eab2afe4765e27  Version = 3.3  Type = default, MAC = fc:67:1f:f1:cc:70
    Polling 192.168.1.145 Failed:
Scan completed in 18.0831 seconds

debug:

DEBUG:TinyTuya [1.10.1]

DEBUG:loaded=devices.json [11 devices]

TinyTuya (Tuya device scanner) [1.10.1]

[Loaded devices.json - 11 devices]

Scanning on UDP ports 6666 and 6667 and 7000 for devices for 18 seconds...

DEBUG:Listening for Tuya devices on UDP 6666 and 6667 and 7000
DEBUG:Received valid UDP packet: {'ip': '192.168.1.200', 'gwId': 'eb629cf13d51f2d0d5gv7t', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': '5xierbs16mkdnkpk', 'version': '3.3'}
DEBUG:building command 10 payload=b'{"gwId":"eb629cf13d51f2d0d5gv7t","devId":"eb629cf13d51f2d0d5gv7t","uid":"eb629cf13d51f2d0d5gv7t","t":"1675894989"}'
DEBUG:payload encrypted=b'000055aa000000010000000a0000008854f69e139e34719bd6a58465f68154c3f0be41a501d50ded9a5952d23e7cb2fff75dc63d516f68ba63f3eee73b1e66d5121ab4251b5d0a727bbb350d14b37cb8c421d7dfbf63c3f8f4d462f1593447e1f0be41a501d50ded9a5952d23e7cb2ff31ce9b3e8b0e86551a8e08f523163f532051719b55b0b6ece8c06379e421d21540798d510000aa55'
DEBUG:Received valid UDP packet: {'ip': '192.168.1.203', 'gwId': 'eb3dcc68131b35ae344alc', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.145', 'gwId': 'eba8ad303d30bd1163sbju', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keyjup78v54myhan', 'version': '3.3'}
DEBUG:PollDevice: raw unpacked message = TuyaMessage(seqno=1, cmd=10, retcode=0, payload=b'[\n\x1f\x99j\x15N\x9a\x95\xc2\xa9r*\xa6_\xccb\xed\xaa~\xba\x90C\x13NFi\t.\xec]*\xe7\x82\x8f9\xf3Yi)7\x8fbB\x98":)', crc=1440328528, crc_good=True, prefix=21930, iv=None)
DEBUG:decode payload=b'[\n\x1f\x99j\x15N\x9a\x95\xc2\xa9r*\xa6_\xccb\xed\xaa~\xba\x90C\x13NFi\t.\xec]*\xe7\x82\x8f9\xf3Yi)7\x8fbB\x98":)'
DEBUG:decrypting=b'[\n\x1f\x99j\x15N\x9a\x95\xc2\xa9r*\xa6_\xccb\xed\xaa~\xba\x90C\x13NFi\t.\xec]*\xe7\x82\x8f9\xf3Yi)7\x8fbB\x98":)'
DEBUG:decrypted 3.x payload='{"dps":{"4":"standby","14":0,"15":1}}'
DEBUG:payload type = <class 'str'>
DEBUG:decoded results='{"dps":{"4":"standby","14":0,"15":1}}'
Pet feeder   Product ID = 5xierbs16mkdnkpk  [Valid Broadcast]:
    Address = 192.168.1.200   Device ID = eb629cf13d51f2d0d5gv7t (len:22)  Local Key = 99af400dccb3a41b  Version = 3.3  Type = default, MAC = 7c:f6:66:22:b7:b0
    Status: {'4': 'standby', '14': 0, '15': 1}
DEBUG:building command 10 payload=b'{"gwId":"eb3dcc68131b35ae344alc","devId":"eb3dcc68131b35ae344alc","uid":"eb3dcc68131b35ae344alc","t":"1675894989"}'
DEBUG:payload encrypted=b'000055aa000000010000000a000000884aa176a65a996620a88c47436da6a3197dfe03150d2654b343d42e8fb8264e6bd71e49240b16e6f941d88d52d40bac4f668cb8d4d93bb3b5fb8948c809ca94010daa32f0aee7d457a4bae303ef5eac0d7dfe03150d2654b343d42e8fb8264e6b704ce9d294c99227c2ad5debe89bee658a98eff3014875bdf1186180c935c73514c3380f0000aa55'
DEBUG:PollDevice: raw unpacked message = TuyaMessage(seqno=1, cmd=10, retcode=0, payload=b"\x02R~\x04Q\xb7}l\xca\xfd\x86[SeK\xae'\xb6\xc3:\x10]@\xee\xbcq\xf0\xd9\xe6'\x89+S\xb9Y\x9e\xe2X\x10sr5S\x17}?\x11O\x0c\x10Mi\r\x91=\xb6\xda\x11\x9e\x8fb\xaa\x14\xb1\xe5<\x01\xa9\x00l\xd1\x9a\x10\xfaV\xe84\xa7\xbaN2f%\xd6\xb1\x97\xa3\x02\x19\x83\x06\x1fk\x11v\x1bc.\xb4\x03\xad\x13\xac@L\x19bIa#\xa8\x86\x98\x06\x1a7\xbc&\xbbf\xbb\xe6\xca\xc40w\xb5\x8e", crc=1428571986, crc_good=True, prefix=21930, iv=None)
DEBUG:decode payload=b"\x02R~\x04Q\xb7}l\xca\xfd\x86[SeK\xae'\xb6\xc3:\x10]@\xee\xbcq\xf0\xd9\xe6'\x89+S\xb9Y\x9e\xe2X\x10sr5S\x17}?\x11O\x0c\x10Mi\r\x91=\xb6\xda\x11\x9e\x8fb\xaa\x14\xb1\xe5<\x01\xa9\x00l\xd1\x9a\x10\xfaV\xe84\xa7\xbaN2f%\xd6\xb1\x97\xa3\x02\x19\x83\x06\x1fk\x11v\x1bc.\xb4\x03\xad\x13\xac@L\x19bIa#\xa8\x86\x98\x06\x1a7\xbc&\xbbf\xbb\xe6\xca\xc40w\xb5\x8e"
DEBUG:decrypting=b"\x02R~\x04Q\xb7}l\xca\xfd\x86[SeK\xae'\xb6\xc3:\x10]@\xee\xbcq\xf0\xd9\xe6'\x89+S\xb9Y\x9e\xe2X\x10sr5S\x17}?\x11O\x0c\x10Mi\r\x91=\xb6\xda\x11\x9e\x8fb\xaa\x14\xb1\xe5<\x01\xa9\x00l\xd1\x9a\x10\xfaV\xe84\xa7\xbaN2f%\xd6\xb1\x97\xa3\x02\x19\x83\x06\x1fk\x11v\x1bc.\xb4\x03\xad\x13\xac@L\x19bIa#\xa8\x86\x98\x06\x1a7\xbc&\xbbf\xbb\xe6\xca\xc40w\xb5\x8e"
DEBUG:decrypted 3.x payload='{"dps":{"20":false,"21":"white","22":18,"23":0,"24":"001002a80012","25":"000e0d0000000000000000c80000","26":0,"34":false}}'
DEBUG:payload type = <class 'str'>
DEBUG:decoded results='{"dps":{"20":false,"21":"white","22":18,"23":0,"24":"001002a80012","25":"000e0d0000000000000000c80000","26":0,"34":false}}'
Bedroom light   Product ID = keytg5kq8gvkv9dh  [Valid Broadcast]:
    Address = 192.168.1.203   Device ID = eb3dcc68131b35ae344alc (len:22)  Local Key = d9bb19e75b0aa051  Version = 3.3  Type = default, MAC = d8:1f:12:c9:54:c4
    Status: {'20': False, '21': 'white', '22': 18, '23': 0, '24': '001002a80012', '25': '000e0d0000000000000000c80000', '26': 0, '34': False}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.205', 'gwId': 'eb68e355da1be4ae69ok5o', 'uuid': '8b05ecd80b3d2553', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'key8u54q9dtru5jw', 'version': '3.5', 'token': True, 'wf_cfg': True, 'clientLink': 3}
DEBUG:final payload: b'0123456789abcdef'
DEBUG:payload encrypted=b'00006699000000000001000000030000002c303132333435363738396162fa1db77c815910d4a75e2e68620021f83b0110ca0e24401f6f7dba2947a9ec9000009966'
DEBUG:decrypted session key negotiation step 2 payload=b'b4f06bf9ec67d7da\xa2jN\xbf?\x07H\xc3\x1f37\xe4\x97\xc2\xae\x07\x8d\x92\xe1\x9a\xb4N\x95\x89\xd5h\x84\xf5\xfc~\xe1\x9c'
DEBUG:payload type = <class 'bytes'> len = 48
DEBUG:session local nonce: b'0123456789abcdef' remote nonce: b'b4f06bf9ec67d7da'
DEBUG:final payload: b'P\x88\x92\x9aI\xef\xbc\xd0\xd7\xb7\x12IV\xee-\x9b\x10\xa2\xb0\xeb<h\x8aGs\xe1\xb5\xe5g\x95(L'
DEBUG:payload encrypted=b'00006699000000000002000000050000003c3031323334353637383961629aa417d5fc839a3348d05d43578a6905d26bcab398fe1ba1a4c1877a673c492cbee84e88899d4cb5c67e1a679931282800009966'
DEBUG:Session nonce XOR'd: b'R\x05T\x03\x02WP\x0e]ZWU\x07S\x01\x07'
DEBUG:Session IV: b'0123456789ab'
DEBUG:Session key negotiate success! session key: b'\x98)\xd1L\xb7;v\xed\xc2=\x18_\x067E\x99'
DEBUG:building command 10 payload=b'{"gwId":"eb68e355da1be4ae69ok5o","devId":"eb68e355da1be4ae69ok5o","uid":"eb68e355da1be4ae69ok5o","t":"1675894990"}'
DEBUG:final payload: b'{"gwId":"eb68e355da1be4ae69ok5o","devId":"eb68e355da1be4ae69ok5o","uid":"eb68e355da1be4ae69ok5o","t":"1675894990"}'
DEBUG:payload encrypted=b'00006699000000000003000000100000008e3031323334353637383961620cf66e16d1a485981f7bf2ef938c8f5ca70f6d55fd99bea8ce248b1743516270f74c44c17f6e8580e0b82dd9261f930c3d52d3ab51439ec146e7745d0bd2c4581607363c5fb566e889e19da51f17773744f4459533f570fb0433abfc22c0a1ab831b948d0bc709c8fb1f5e120dd36dd9f72e05a085b6afc02885de98887532951ee900009966'
DEBUG:Received valid UDP packet: {'ip': '192.168.1.207', 'gwId': 'eb597c0e524d178a80caat', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keydnqmh87c8ajv4', 'version': '3.3'}
DEBUG:PollDevice: raw unpacked message = TuyaMessage(seqno=54717, cmd=16, retcode=0, payload=b'{"dps":{"20":true,"21":"white","22":903,"23":3,"24":"014a03e803a9","25":"04464602007803e803e800000000464602007803e8000a00000000","26":0,"34":false}}', crc=b'\xbfJ\xdd\xc3\x14\x9e\xb5\xc7\x82\xa3\xc0G\x03\x00\x81\x01', crc_good=True, prefix=26265, iv=b'y\xaf\x8bp\x95\x81\xd4\xeb\xde\xa7k\x9b')
DEBUG:decode payload=b'{"dps":{"20":true,"21":"white","22":903,"23":3,"24":"014a03e803a9","25":"04464602007803e803e800000000464602007803e8000a00000000","26":0,"34":false}}'
DEBUG:decoded results='{"dps":{"20":true,"21":"white","22":903,"23":3,"24":"014a03e803a9","25":"04464602007803e803e800000000464602007803e8000a00000000","26":0,"34":false}}'
Office light   Product ID = key8u54q9dtru5jw  [Valid Broadcast]:
    Address = 192.168.1.205   Device ID = eb68e355da1be4ae69ok5o (len:22)  Local Key = 6434389541e96704  Version = 3.5  Type = default, MAC = 38:1f:8d:4f:66:f6
    Status: {'20': True, '21': 'white', '22': 903, '23': 3, '24': '014a03e803a9', '25': '04464602007803e803e800000000464602007803e8000a00000000', '26': 0, '34': False}
DEBUG:building command 10 payload=b'{"gwId":"eb597c0e524d178a80caat","devId":"eb597c0e524d178a80caat","uid":"eb597c0e524d178a80caat","t":"1675894990"}'
DEBUG:payload encrypted=b'000055aa000000010000000a00000088c06cdd1414d7dfae99780b501e2deadd9cad8483a9af03d5b62ea745d000ba28f6931b9c03fe14181b254666e0671a1d0d20c9fe80d9c8d5285d9134b27607c76c5bddf25ffe131901f4d9fce05b59789cad8483a9af03d5b62ea745d000ba281ddec01ca82baf3e382738597e695e5ca6fd6b6a5fce3c15408b3176c2594fb0466cfd5c0000aa55'
DEBUG:Received valid UDP packet: {'ip': '192.168.1.204', 'gwId': 'ebd1b02d382049733dnq0u', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
DEBUG:PollDevice: raw unpacked message = TuyaMessage(seqno=1, cmd=10, retcode=0, payload=b'\xecU\xf0Me\xca\x01 \xa3\xe7\xab$\xd9?\xfc\x80\x8aH\xd3\xe4\xc6\x13\x988\xfd\n\x13\x88%y2\xaf\x85T\x9aBYJW\x88Q\x93\xdd\x90\xb5\x7f)\x0f\x93>\x8d\xf6\x04\xcc\xe5P\xdd\xa4\x96f\x06EM\xd13\x0fL[\x16\xe7\x0e\xffY4zY/\xa2\xf7rh%<S\xfc8\x92<\x1f#\xb887\xe1+\x92S\xedP2[i \xd26^\xe5\xeb\xdf\xd5\xc5\x920:\xf5\xc5{\x93\x81L\xf1O\x01\xd5\xed\xf0\x8bx', crc=2499861847, crc_good=True, prefix=21930, iv=None)
DEBUG:decode payload=b'\xecU\xf0Me\xca\x01 \xa3\xe7\xab$\xd9?\xfc\x80\x8aH\xd3\xe4\xc6\x13\x988\xfd\n\x13\x88%y2\xaf\x85T\x9aBYJW\x88Q\x93\xdd\x90\xb5\x7f)\x0f\x93>\x8d\xf6\x04\xcc\xe5P\xdd\xa4\x96f\x06EM\xd13\x0fL[\x16\xe7\x0e\xffY4zY/\xa2\xf7rh%<S\xfc8\x92<\x1f#\xb887\xe1+\x92S\xedP2[i \xd26^\xe5\xeb\xdf\xd5\xc5\x920:\xf5\xc5{\x93\x81L\xf1O\x01\xd5\xed\xf0\x8bx'
DEBUG:decrypting=b'\xecU\xf0Me\xca\x01 \xa3\xe7\xab$\xd9?\xfc\x80\x8aH\xd3\xe4\xc6\x13\x988\xfd\n\x13\x88%y2\xaf\x85T\x9aBYJW\x88Q\x93\xdd\x90\xb5\x7f)\x0f\x93>\x8d\xf6\x04\xcc\xe5P\xdd\xa4\x96f\x06EM\xd13\x0fL[\x16\xe7\x0e\xffY4zY/\xa2\xf7rh%<S\xfc8\x92<\x1f#\xb887\xe1+\x92S\xedP2[i \xd26^\xe5\xeb\xdf\xd5\xc5\x920:\xf5\xc5{\x93\x81L\xf1O\x01\xd5\xed\xf0\x8bx'
DEBUG:decrypted 3.x payload='{"dps":{"1":true,"9":0,"17":51,"18":798,"19":926,"20":1255,"21":1,"22":617,"23":31090,"24":17649,"25":1180,"26":0}}'
DEBUG:payload type = <class 'str'>
DEBUG:decoded results='{"dps":{"1":true,"9":0,"17":51,"18":798,"19":926,"20":1255,"21":1,"22":617,"23":31090,"24":17649,"25":1180,"26":0}}'
Computer socket   Product ID = keydnqmh87c8ajv4  [Valid Broadcast]:
    Address = 192.168.1.207   Device ID = eb597c0e524d178a80caat (len:22)  Local Key = bdf5b78fccf86c7b  Version = 3.3  Type = default, MAC = d8:1f:12:d2:55:d1
    Status: {'1': True, '9': 0, '17': 51, '18': 798, '19': 926, '20': 1255, '21': 1, '22': 617, '23': 31090, '24': 17649, '25': 1180, '26': 0}
DEBUG:building command 10 payload=b'{"gwId":"ebd1b02d382049733dnq0u","devId":"ebd1b02d382049733dnq0u","uid":"ebd1b02d382049733dnq0u","t":"1675894991"}'
DEBUG:payload encrypted=b'000055aa000000010000000a00000088d5459e27005f4b841c784ed7c61a2ee10ea7ff9a6141d3a94ec36b1b05193db736b00f5fe8b0a0a53e29a63f6757553a1fce67a2f3e3efd7aec7cc38e69492bf2cfc37f38d01ab1c2beb5040cb9ae1fb0ea7ff9a6141d3a94ec36b1b05193db78882565aaa135b6e8d789bbc30661d1cae136db03ed32bc559c1eb409e35e3907bbd77ff0000aa55'
DEBUG:PollDevice: raw unpacked message = TuyaMessage(seqno=1, cmd=10, retcode=0, payload=b'|S\xbb\xd6G2\xaa\x02\x19g2\xd4z32\xac\xc3\xc3\x00\x9d\x1a\xa1X":\x1f\xeb\x9aLeb\xd8\x1a#\x93\x7f}\x17m\xfb\x01fD\x99\xafNs\xf4\xdbi\x92\xaf\x16r\xd4\xec\xb3I\x1a\xd9\x8e\xf1.\x91c/\tO\xf4\x05\x1f\xb4\x84\xa0q\xab\xad\x95\xb4\xd96\xea\xec\xcb\xd0\xcbO\x0b\x1b\xb1n\xa8\xff\xca\xc7~\x08qa\xf5\x87G\xc8\xa74f\x8e\x12\xb6\xee\xfe)nNq\x03\xd6\xf9\xf4\xcc\xacVU\xc7\x047\xc6&', crc=58757811, crc_good=True, prefix=21930, iv=None)
DEBUG:decode payload=b'|S\xbb\xd6G2\xaa\x02\x19g2\xd4z32\xac\xc3\xc3\x00\x9d\x1a\xa1X":\x1f\xeb\x9aLeb\xd8\x1a#\x93\x7f}\x17m\xfb\x01fD\x99\xafNs\xf4\xdbi\x92\xaf\x16r\xd4\xec\xb3I\x1a\xd9\x8e\xf1.\x91c/\tO\xf4\x05\x1f\xb4\x84\xa0q\xab\xad\x95\xb4\xd96\xea\xec\xcb\xd0\xcbO\x0b\x1b\xb1n\xa8\xff\xca\xc7~\x08qa\xf5\x87G\xc8\xa74f\x8e\x12\xb6\xee\xfe)nNq\x03\xd6\xf9\xf4\xcc\xacVU\xc7\x047\xc6&'
DEBUG:decrypting=b'|S\xbb\xd6G2\xaa\x02\x19g2\xd4z32\xac\xc3\xc3\x00\x9d\x1a\xa1X":\x1f\xeb\x9aLeb\xd8\x1a#\x93\x7f}\x17m\xfb\x01fD\x99\xafNs\xf4\xdbi\x92\xaf\x16r\xd4\xec\xb3I\x1a\xd9\x8e\xf1.\x91c/\tO\xf4\x05\x1f\xb4\x84\xa0q\xab\xad\x95\xb4\xd96\xea\xec\xcb\xd0\xcbO\x0b\x1b\xb1n\xa8\xff\xca\xc7~\x08qa\xf5\x87G\xc8\xa74f\x8e\x12\xb6\xee\xfe)nNq\x03\xd6\xf9\xf4\xcc\xacVU\xc7\x047\xc6&'
DEBUG:decrypted 3.x payload='{"dps":{"20":true,"21":"white","22":903,"23":0,"24":"00f003e80054","25":"000e0d0000000000000000c80000","26":0,"34":false}}'
DEBUG:payload type = <class 'str'>
DEBUG:decoded results='{"dps":{"20":true,"21":"white","22":903,"23":0,"24":"00f003e80054","25":"000e0d0000000000000000c80000","26":0,"34":false}}'
Living room light   Product ID = keytg5kq8gvkv9dh  [Valid Broadcast]:
    Address = 192.168.1.204   Device ID = ebd1b02d382049733dnq0u (len:22)  Local Key = c383f271346743c0  Version = 3.3  Type = default, MAC = d8:1f:12:c9:54:66
    Status: {'20': True, '21': 'white', '22': 903, '23': 0, '24': '00f003e80054', '25': '000e0d0000000000000000c80000', '26': 0, '34': False}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.244', 'gwId': 'eb860d52d52d7d56172s3b', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keyjup78v54myhan', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.202', 'gwId': 'eb1f0804f3145f2189grsj', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'wexaeucvbdawkkpo', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.206', 'gwId': 'eb099f68fc98defbd6vqcs', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keydnqmh87c8ajv4', 'version': '3.3'}
DEBUG:building command 10 payload=b'{"gwId":"eb1f0804f3145f2189grsj","devId":"eb1f0804f3145f2189grsj","uid":"eb1f0804f3145f2189grsj","t":"1675894991"}'
DEBUG:payload encrypted=b'000055aa000000010000000a0000008872935960d08e6332af038ac3bf28d01454fe9cadd96a1188e1f67cfe81070335078f77c7ff318982d663e43f3e0e4a4fd16ac9835d7bad6aa431ed2edd87284ce291587d2f47787947ef37e8421caf1b54fe9cadd96a1188e1f67cfe81070335e7a8b80c8243b38a06d0dbd5cfd7ffb13e79dd562a3b870d740ee7467a8608802fb88fb50000aa55'
DEBUG:building command 10 payload=b'{"gwId":"eb099f68fc98defbd6vqcs","devId":"eb099f68fc98defbd6vqcs","uid":"eb099f68fc98defbd6vqcs","t":"1675894991"}'
DEBUG:payload encrypted=b'000055aa000000010000000a00000088ffebc3b29bc1ab9c8c81488fc89d9b8bdb74addecadbeaf134758fc0fb1c0e3012940b0e76f0a5fd2dcb5fc712e79be0f85dcbca9041c8b72362f0375bebca1ef46375e9d48894e4bb315a0c2f7aaf4ddb74addecadbeaf134758fc0fb1c0e30b3781f271a627065933cf2f63e20c52f12f968231e9111ff723beed482e9f48c869afd700000aa55'
DEBUG:PollDevice: raw unpacked message = TuyaMessage(seqno=1, cmd=10, retcode=0, payload=b'\x00\xe90\xa4\x14\xd9<\xea\x12Y\x8a"\xc1S\x9bhA\xd4\t$z\x0f\xaf(\xc4\xffK\x83\x03SQ\xd4\x8c>@\xa6D\xc6\xad\xb3gZ\xd4X\xa9\x1f*\'LX\x12\xcbm\x18(\x88.R@U&\xd0\xf4\xf4\x80z<\xc9\x80\x806xrp\\\xc9>\x9d\x93\xd9\xe2b\x87\xd0\x90\xf4\x02X\xdc\xd7\xdd\xa4p\xfc\x06N,\xf4\x83\xe5\x81s\x17\x95\x12B\x01:a\x08\x9c\xfb\x13k\xa0U\\\xf4m\x1e?.\x95\xa2AX6\xf0\xe1\'\xa33\x8e\xd9^(9\x88\xf8.\xf2\x8c\xcb\xa3\xe3=\xeb\x10l\x7f\x07\reE\xf4\xb8_\xa6N\xc3\x17-E\x89\x19\x81\xb3\x15&#\xba\xc3\xe7\x9a\x91*0;\xc9`\xa1\x01\x8c\x10U\x93\xbe\xca\xfcX\x97\xc5\x03\\\xa0\xa9\xf0m\x8db4\x80\x9e\xb1x\xba}\x84G\xb5\x1a\xcf\xa0\xca\x0c0\xb9\xb4\xe0\xcb\x06d\x80\xcc', crc=1962359137, crc_good=True, prefix=21930, iv=None)
DEBUG:decode payload=b'\x00\xe90\xa4\x14\xd9<\xea\x12Y\x8a"\xc1S\x9bhA\xd4\t$z\x0f\xaf(\xc4\xffK\x83\x03SQ\xd4\x8c>@\xa6D\xc6\xad\xb3gZ\xd4X\xa9\x1f*\'LX\x12\xcbm\x18(\x88.R@U&\xd0\xf4\xf4\x80z<\xc9\x80\x806xrp\\\xc9>\x9d\x93\xd9\xe2b\x87\xd0\x90\xf4\x02X\xdc\xd7\xdd\xa4p\xfc\x06N,\xf4\x83\xe5\x81s\x17\x95\x12B\x01:a\x08\x9c\xfb\x13k\xa0U\\\xf4m\x1e?.\x95\xa2AX6\xf0\xe1\'\xa33\x8e\xd9^(9\x88\xf8.\xf2\x8c\xcb\xa3\xe3=\xeb\x10l\x7f\x07\reE\xf4\xb8_\xa6N\xc3\x17-E\x89\x19\x81\xb3\x15&#\xba\xc3\xe7\x9a\x91*0;\xc9`\xa1\x01\x8c\x10U\x93\xbe\xca\xfcX\x97\xc5\x03\\\xa0\xa9\xf0m\x8db4\x80\x9e\xb1x\xba}\x84G\xb5\x1a\xcf\xa0\xca\x0c0\xb9\xb4\xe0\xcb\x06d\x80\xcc'
DEBUG:decrypting=b'\x00\xe90\xa4\x14\xd9<\xea\x12Y\x8a"\xc1S\x9bhA\xd4\t$z\x0f\xaf(\xc4\xffK\x83\x03SQ\xd4\x8c>@\xa6D\xc6\xad\xb3gZ\xd4X\xa9\x1f*\'LX\x12\xcbm\x18(\x88.R@U&\xd0\xf4\xf4\x80z<\xc9\x80\x806xrp\\\xc9>\x9d\x93\xd9\xe2b\x87\xd0\x90\xf4\x02X\xdc\xd7\xdd\xa4p\xfc\x06N,\xf4\x83\xe5\x81s\x17\x95\x12B\x01:a\x08\x9c\xfb\x13k\xa0U\\\xf4m\x1e?.\x95\xa2AX6\xf0\xe1\'\xa33\x8e\xd9^(9\x88\xf8.\xf2\x8c\xcb\xa3\xe3=\xeb\x10l\x7f\x07\reE\xf4\xb8_\xa6N\xc3\x17-E\x89\x19\x81\xb3\x15&#\xba\xc3\xe7\x9a\x91*0;\xc9`\xa1\x01\x8c\x10U\x93\xbe\xca\xfcX\x97\xc5\x03\\\xa0\xa9\xf0m\x8db4\x80\x9e\xb1x\xba}\x84G\xb5\x1a\xcf\xa0\xca\x0c0\xb9\xb4\xe0\xcb\x06d\x80\xcc'
DEBUG:decrypted 3.x payload='{"dps":{"1":true,"11":0,"14":51,"25":false,"26":"foward","27":"standby","28":"charging","30":"high","31":true,"32":41,"33":59,"34":"05904100832","102":"1500,1,0,0,4,113,  0,  2,  2,  3,0,0, 153, 111, 0, 0,1,  0,  597"}}'
DEBUG:payload type = <class 'str'>
DEBUG:decoded results='{"dps":{"1":true,"11":0,"14":51,"25":false,"26":"foward","27":"standby","28":"charging","30":"high","31":true,"32":41,"33":59,"34":"05904100832","102":"1500,1,0,0,4,113,  0,  2,  2,  3,0,0, 153, 111, 0, 0,1,  0,  597"}}'
Cleaner Robot   Product ID = wexaeucvbdawkkpo  [Valid Broadcast]:
    Address = 192.168.1.202   Device ID = eb1f0804f3145f2189grsj (len:22)  Local Key = 707bbed1ba120c27  Version = 3.3  Type = default, MAC = 70:89:76:1b:67:f1
    Status: {'1': True, '11': 0, '14': 51, '25': False, '26': 'foward', '27': 'standby', '28': 'charging', '30': 'high', '31': True, '32': 41, '33': 59, '34': '05904100832', '102': '1500,1,0,0,4,113,  0,  2,  2,  3,0,0, 153, 111, 0, 0,1,  0,  597'}
DEBUG:PollDevice: raw unpacked message = TuyaMessage(seqno=1, cmd=10, retcode=0, payload=b'\xb6\xcdp\x9d\x8e}\x0b\xcc\xaaE\x99\xe8\x14!]\x9bd\xac\x9cp\xf4mV\xe9r\xfb\xcbW\xa3i@\xc4\x8b\xb7g(\xce\x9c[\x0f&\x1f\x01\xd3\xfd\x870/x\x1a\xa6\xbd\xb5\xc2\xaf\x8b\x19\xfdC\xce\xfe\xf7\xca\x01\xfd\x94\x02\xc8^iV\xe8\xdd\x8c\xab\xd6\xa7\x02\xed1<\x8f&>"\x15\x03\xf6V\x0f!\x1cd\xa3a\xb7\xf9;\xf3\xd4\xbd+\x97\x03\x07\xc5\x12\'\xa1Y\xb6\xbf', crc=3608824574, crc_good=True, prefix=21930, iv=None)
DEBUG:decode payload=b'\xb6\xcdp\x9d\x8e}\x0b\xcc\xaaE\x99\xe8\x14!]\x9bd\xac\x9cp\xf4mV\xe9r\xfb\xcbW\xa3i@\xc4\x8b\xb7g(\xce\x9c[\x0f&\x1f\x01\xd3\xfd\x870/x\x1a\xa6\xbd\xb5\xc2\xaf\x8b\x19\xfdC\xce\xfe\xf7\xca\x01\xfd\x94\x02\xc8^iV\xe8\xdd\x8c\xab\xd6\xa7\x02\xed1<\x8f&>"\x15\x03\xf6V\x0f!\x1cd\xa3a\xb7\xf9;\xf3\xd4\xbd+\x97\x03\x07\xc5\x12\'\xa1Y\xb6\xbf'
DEBUG:decrypting=b'\xb6\xcdp\x9d\x8e}\x0b\xcc\xaaE\x99\xe8\x14!]\x9bd\xac\x9cp\xf4mV\xe9r\xfb\xcbW\xa3i@\xc4\x8b\xb7g(\xce\x9c[\x0f&\x1f\x01\xd3\xfd\x870/x\x1a\xa6\xbd\xb5\xc2\xaf\x8b\x19\xfdC\xce\xfe\xf7\xca\x01\xfd\x94\x02\xc8^iV\xe8\xdd\x8c\xab\xd6\xa7\x02\xed1<\x8f&>"\x15\x03\xf6V\x0f!\x1cd\xa3a\xb7\xf9;\xf3\xd4\xbd+\x97\x03\x07\xc5\x12\'\xa1Y\xb6\xbf'
DEBUG:decrypted 3.x payload='{"dps":{"1":false,"9":0,"17":6,"18":0,"19":0,"20":1252,"21":1,"22":625,"23":31468,"24":18126,"25":1148,"26":0}}'
DEBUG:payload type = <class 'str'>
DEBUG:decoded results='{"dps":{"1":false,"9":0,"17":6,"18":0,"19":0,"20":1252,"21":1,"22":625,"23":31468,"24":18126,"25":1148,"26":0}}'
Fan socket   Product ID = keydnqmh87c8ajv4  [Valid Broadcast]:
    Address = 192.168.1.206   Device ID = eb099f68fc98defbd6vqcs (len:22)  Local Key = dfd4cb0ca6a36d8a  Version = 3.3  Type = default, MAC = d8:1f:12:d2:57:71
    Status: {'1': False, '9': 0, '17': 6, '18': 0, '19': 0, '20': 1252, '21': 1, '22': 625, '23': 31468, '24': 18126, '25': 1148, '26': 0}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.201', 'gwId': 'eb06b9ad96cc645217ruup', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keym9qkuywghyrvs', 'version': '3.3'}
DEBUG:building command 10 payload=b'{"gwId":"eb06b9ad96cc645217ruup","devId":"eb06b9ad96cc645217ruup","uid":"eb06b9ad96cc645217ruup","t":"1675894993"}'
DEBUG:payload encrypted=b'000055aa000000010000000a00000088ae824cd3c5ce254c02e5cef871d618279aedaf373afba7789d8b182f0261e0f7691d76f63f57f487fddb35cec93cb7c97d60147af2e50dd8636c8c771e9193508d2a62ec5ea47c98c9ce3b7eeb74aabe9aedaf373afba7789d8b182f0261e0f7a6e52a726558a14e54dc4175849365d4dd71e6d3ade89a41a05b7908b8eb2308d7ef63e00000aa55'
DEBUG:PollDevice: raw unpacked message = TuyaMessage(seqno=1, cmd=10, retcode=0, payload=b'\xea\xa3O3\xfe\xd4\xf6\xde-\x0f\xc7/\x7f\x1f\x06\xff.\xe9Z\x98\xf1a\xa1\xe3<}C\xecs\x06\xdaP\x0c\x81\xdd~\xf0\xdeCZ\xc5l\xf2\xbb\x1ac2\xb4\xa1k\xee\x84],\xc5\x0f\xbbM@\x83\nX\xd7N\x1a\xf1\x93p\xe6\xaf\x92\x13L+\x0b0\xeb@\xad\xe0\xfbE\x7f\x8bt 7\xfd\rE|\nLW$\xa4\xd8\x0b\x06\xaf"\xa3\x14\xbe\xee\x7f\x19\xcf\xfc\x8a\xbfbB>-5\x9f\x00\x01hx4\xdde4G3N,w\xc9\'\x1f\xaav2\xa6\xbeZ\x1al\xebF\xb2T\x12c\x07\x0b\xb54\xd8\x94`\xfcK\xdd\xf1\xceH', crc=809019920, crc_good=True, prefix=21930, iv=None)
DEBUG:decode payload=b'\xea\xa3O3\xfe\xd4\xf6\xde-\x0f\xc7/\x7f\x1f\x06\xff.\xe9Z\x98\xf1a\xa1\xe3<}C\xecs\x06\xdaP\x0c\x81\xdd~\xf0\xdeCZ\xc5l\xf2\xbb\x1ac2\xb4\xa1k\xee\x84],\xc5\x0f\xbbM@\x83\nX\xd7N\x1a\xf1\x93p\xe6\xaf\x92\x13L+\x0b0\xeb@\xad\xe0\xfbE\x7f\x8bt 7\xfd\rE|\nLW$\xa4\xd8\x0b\x06\xaf"\xa3\x14\xbe\xee\x7f\x19\xcf\xfc\x8a\xbfbB>-5\x9f\x00\x01hx4\xdde4G3N,w\xc9\'\x1f\xaav2\xa6\xbeZ\x1al\xebF\xb2T\x12c\x07\x0b\xb54\xd8\x94`\xfcK\xdd\xf1\xceH'
DEBUG:decrypting=b'\xea\xa3O3\xfe\xd4\xf6\xde-\x0f\xc7/\x7f\x1f\x06\xff.\xe9Z\x98\xf1a\xa1\xe3<}C\xecs\x06\xdaP\x0c\x81\xdd~\xf0\xdeCZ\xc5l\xf2\xbb\x1ac2\xb4\xa1k\xee\x84],\xc5\x0f\xbbM@\x83\nX\xd7N\x1a\xf1\x93p\xe6\xaf\x92\x13L+\x0b0\xeb@\xad\xe0\xfbE\x7f\x8bt 7\xfd\rE|\nLW$\xa4\xd8\x0b\x06\xaf"\xa3\x14\xbe\xee\x7f\x19\xcf\xfc\x8a\xbfbB>-5\x9f\x00\x01hx4\xdde4G3N,w\xc9\'\x1f\xaav2\xa6\xbeZ\x1al\xebF\xb2T\x12c\x07\x0b\xb54\xd8\x94`\xfcK\xdd\xf1\xceH'
DEBUG:decrypted 3.x payload='{"dps":{"1":false,"9":0,"17":1,"18":0,"19":0,"20":1253,"21":1,"22":564,"23":29000,"24":15795,"25":2640,"26":0,"38":"memory","41":"","42":"","46":true}}'
DEBUG:payload type = <class 'str'>
DEBUG:decoded results='{"dps":{"1":false,"9":0,"17":1,"18":0,"19":0,"20":1253,"21":1,"22":564,"23":29000,"24":15795,"25":2640,"26":0,"38":"memory","41":"","42":"","46":true}}'
Electric blanket socket   Product ID = keym9qkuywghyrvs  [Valid Broadcast]:
    Address = 192.168.1.201   Device ID = eb06b9ad96cc645217ruup (len:22)  Local Key = 5cd62b469b6d961e  Version = 3.3  Type = default, MAC = 7c:f6:66:86:bf:06
    Status: {'1': False, '9': 0, '17': 1, '18': 0, '19': 0, '20': 1253, '21': 1, '22': 564, '23': 29000, '24': 15795, '25': 2640, '26': 0, '38': 'memory', '41': '', '42': '', '46': True}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.200', 'gwId': 'eb629cf13d51f2d0d5gv7t', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': '5xierbs16mkdnkpk', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.145', 'gwId': 'eba8ad303d30bd1163sbju', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keyjup78v54myhan', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.203', 'gwId': 'eb3dcc68131b35ae344alc', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.205', 'gwId': 'eb68e355da1be4ae69ok5o', 'uuid': '8b05ecd80b3d2553', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'key8u54q9dtru5jw', 'version': '3.5', 'token': True, 'wf_cfg': True, 'clientLink': 3}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.207', 'gwId': 'eb597c0e524d178a80caat', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keydnqmh87c8ajv4', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.204', 'gwId': 'ebd1b02d382049733dnq0u', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.244', 'gwId': 'eb860d52d52d7d56172s3b', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keyjup78v54myhan', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.202', 'gwId': 'eb1f0804f3145f2189grsj', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'wexaeucvbdawkkpo', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.206', 'gwId': 'eb099f68fc98defbd6vqcs', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keydnqmh87c8ajv4', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.201', 'gwId': 'eb06b9ad96cc645217ruup', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keym9qkuywghyrvs', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.200', 'gwId': 'eb629cf13d51f2d0d5gv7t', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': '5xierbs16mkdnkpk', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.203', 'gwId': 'eb3dcc68131b35ae344alc', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.145', 'gwId': 'eba8ad303d30bd1163sbju', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keyjup78v54myhan', 'version': '3.3'}
Washing Machine Socket   Product ID = keyjup78v54myhan  [Valid Broadcast]:
    Address = 192.168.1.145   Device ID = eba8ad303d30bd1163sbju (len:22)  Local Key = e7eab2afe4765e27  Version = 3.3  Type = default, MAC = fc:67:1f:f1:cc:70
    Polling 192.168.1.145 Failed: 
DEBUG:Received valid UDP packet: {'ip': '192.168.1.205', 'gwId': 'eb68e355da1be4ae69ok5o', 'uuid': '8b05ecd80b3d2553', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'key8u54q9dtru5jw', 'version': '3.5', 'token': True, 'wf_cfg': True, 'clientLink': 3}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.207', 'gwId': 'eb597c0e524d178a80caat', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keydnqmh87c8ajv4', 'version': '3.3'}
Oven socket   Product ID = keyjup78v54myhan  [Valid Broadcast]:
    Address = 192.168.1.244   Device ID = eb860d52d52d7d56172s3b (len:22)  Local Key = 14e2fe4c41020a58  Version = 3.3  Type = default, MAC = fc:67:1f:f1:d4:c7
    Polling 192.168.1.244 Failed: 
DEBUG:Received valid UDP packet: {'ip': '192.168.1.204', 'gwId': 'ebd1b02d382049733dnq0u', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.244', 'gwId': 'eb860d52d52d7d56172s3b', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keyjup78v54myhan', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.202', 'gwId': 'eb1f0804f3145f2189grsj', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'wexaeucvbdawkkpo', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.206', 'gwId': 'eb099f68fc98defbd6vqcs', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keydnqmh87c8ajv4', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.201', 'gwId': 'eb06b9ad96cc645217ruup', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keym9qkuywghyrvs', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.200', 'gwId': 'eb629cf13d51f2d0d5gv7t', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': '5xierbs16mkdnkpk', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.145', 'gwId': 'eba8ad303d30bd1163sbju', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keyjup78v54myhan', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.203', 'gwId': 'eb3dcc68131b35ae344alc', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.205', 'gwId': 'eb68e355da1be4ae69ok5o', 'uuid': '8b05ecd80b3d2553', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'key8u54q9dtru5jw', 'version': '3.5', 'token': True, 'wf_cfg': True, 'clientLink': 3}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.207', 'gwId': 'eb597c0e524d178a80caat', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keydnqmh87c8ajv4', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.204', 'gwId': 'ebd1b02d382049733dnq0u', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keytg5kq8gvkv9dh', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.244', 'gwId': 'eb860d52d52d7d56172s3b', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keyjup78v54myhan', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.202', 'gwId': 'eb1f0804f3145f2189grsj', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'wexaeucvbdawkkpo', 'version': '3.3'}
DEBUG:Received valid UDP packet: {'ip': '192.168.1.206', 'gwId': 'eb099f68fc98defbd6vqcs', 'active': 2, 'ablilty': 0, 'encrypt': True, 'productKey': 'keydnqmh87c8ajv4', 'version': '3.3'}
Scan completed in 18.0418 seconds

Scan Complete!  Found 10 devices.
Broadcasted: 10
Versions: 3.3: 9, 3.5: 1
uzlonewolf commented 1 year ago

Why do you think this is a v3.5 problem? The only v3.5 device I'm seeing in those logs is "Office light" and it appears to be working fine. As for those 2 unresponsive v3.3 devices, I would check: 1) They may be in a partially-hung state and need to be rebooted 2) Double-check that the local key is correct 3) See if you can poll it using the "device22" quirk mode (i.e. d = tinytuya.OutletDevice('eb860d52d52d7d56172s3b', '192.168.1.244', '14e2fe4c41020a58', dev_type='device22', version=3.3) then print(d.status()))

Oglaf commented 1 year ago

Why do you think this is a v3.5 problem? The only v3.5 device I'm seeing in those logs is "Office light" and it appears to be working fine. As for those 2 unresponsive v3.3 devices, I would check:

  1. They may be in a partially-hung state and need to be rebooted
  2. Double-check that the local key is correct
  3. See if you can poll it using the "device22" quirk mode (i.e. d = tinytuya.OutletDevice('eb860d52d52d7d56172s3b', '192.168.1.244', '14e2fe4c41020a58', dev_type='device22', version=3.3) then print(d.status()))

You are right, I have mistaken the device IDs when I was doing other tests before and quickly blamed the protocol. I will change the title to avoid confusion. I have done steps 1 and 2, will try step 3.

uzlonewolf commented 1 year ago

I found another thread where someone has a device with the same keyjup78v54myhan Product ID but is reporting protocol v3.4. I wonder if your devices are an in-between version where they're still reporting v3.3 but actually using v3.4 similar to how "device22" devices are between v3.2 and v3.3. If the 'device22' thing in my last post doesn't work then d = tinytuya.OutletDevice('eb860d52d52d7d56172s3b', '192.168.1.244', '14e2fe4c41020a58', version=3.4).status() + print(d.status()) would be the next thing to try.

Oglaf commented 1 year ago

Thank you @uzlonewolf , yesterday I started testing tuya local and after reading the "Smart Switch Gotchas" I decided let it rest overnight and try again today.

I was surprised that leaving it unplugged overnight worked! But sometimes it still becomes unavailable if it spends too much time idle, the same behavior as my chromecast that becomes unavailable in home assistant after spending some time turned off but it comes back to life after I turn it on through google home. But in this case I have to unplug and plug it again.

Both codes throws an exception, it returns something (it's not a timeout) but it has no Status() attribute. 'NoneType' object has no attribute 'status'

I wonder if it has something to do with Overcharge Switch turned on? I noticed my other plugs doesn't have this feature. I will disable it and keep an eye on it.

jasonacox commented 1 year ago

You might try turning on debug to see how it responds:

import tinytuya
tinytuya.set_debug(True)

d = tinytuya.OutletDevice('eb860d52d52d7d56172s3b', 
     '192.168.1.244', '14e2fe4c41020a58', version=3.4)
print(d.status())
Oglaf commented 1 year ago

Spent the whole day yesterday doing periodic health checks and I can confirm after a few hours being Idle both plugs will stop responding to my local network. Of course, it's still works on Smart Life app.

DEBUG:TinyTuya [1.10.1]

DEBUG:status() entry (dev_type is default)
DEBUG:building command 10 payload=b'{"gwId":"eb860d52d52d7d56172s3b","devId":"eb860d52d52d7d56172s3b","uid":"eb860d52d52d7d56172s3b","t":"1676127964"}'
DEBUG:socket unable to connect (timeout) - retry 1/5
DEBUG:socket unable to connect (timeout) - retry 2/5
DEBUG:socket unable to connect (timeout) - retry 3/5
DEBUG:socket unable to connect (timeout) - retry 4/5
DEBUG:socket unable to connect (timeout) - retry 5/5
DEBUG:ERROR Network Error: Device Unreachable - 905 - payload: null
DEBUG:status() received data={'Error': 'Network Error: Device Unreachable', 'Err': '905', 'Payload': None}

Seems like a firmware "feature"? I will try to ping it for the whole day and see if I keep it "awake".

jasonacox commented 1 year ago

Seems like a firmware "feature"?

Haha! Well said. I have two older 3.1 devices that will suddenly stop responding locally but may or may not still connect to cloud (Smart Life app). I wish there was a way to send a "reboot" to the firmware. I haven't discovered it and didn't spend a lot of time on it since they were older. I don't know if this specific to the firmware or not.

I notice this device is called "Oven socket". I had an issue with a 3.3 device that would stop working after a while. It was an energy monitoring plug for a dryer. Eventually the plug stopped altogether. It turned out that while it was rated at 15A, it was not able to handle anything even near 10A and the startup of the dryer was spiking the limit. My theory is that when the spike happened and voltage dropped or became erratic, the firmware code or WiFi controller entered an unhandled state that effectively disabled TCP port listening. I was able to correlate it to power usage on the dryer.

Oglaf commented 1 year ago

After 3 days of further testing, I will close this issue. I have tested if spiking was causing this problem but doesn't seen like it. Tinytuya and Localtuya gets unresponsive but somehow it still works on tuya-local, which is fine for me.

I will take it as "It is what it is", and stay away from Avatto because I have seen many similar posts like that and it's too much coincidence to not think that Avatto customized Tuya's firmware to act like that.

The only solution I see in the far future is to switch my Tuya devices to Tasmota.

jasonacox commented 1 year ago

Hi @Oglaf - thanks for the update and for originally opening the issue. This helps us understand any tweaks we need to make or to help others with similar devices.

somehow it still works on tuya-local

I should have asked this earlier, what do you mean by tuya-local? I would love to understand the difference to see if there is something we can do for our library to better support these devices.

Thanks again!

Oglaf commented 1 year ago

Hi Jason, tuya-local is a "new" integration for home assistant which got popular recently after some content creators made a video about it as an alternative solution to localtuya. I know they use tinytuya's for discovery but I haven't check how communication is made after that.

jasonacox commented 1 year ago

Ah! That's @make-all project! Jason is brilliant. He has a great project and is doing a good job trying to convince us to move TinyTuya to native async. :) Regardless, I'm recommending all HA users check out his project! 😁

It just occurs to me... you are probably running multiple tools against this plug. These Tuya devices don't handle multiple connections very well at all. Since tuya-local is using the persistence setting in TinyTuya (keeping the connection open) there is a real possibility that the issue is that tuya-local in HA has the device open so you can't use your own script (or would get the timeout errors). You may likely see the same thing if you used the Smart Life app while trying to run your script.

make-all commented 1 year ago

tuya-local is using tinytuya underneath (for everything except discovery, actually, as I haven't yet gotten around to adding support for that), so if that works, then tinytuya works. As Jason says, the problem is more likely to come from the device not handling multiple connections than from tinytuya itself.