jasonacox / tinytuya

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

Cannot find a new chinese thermostat T9W 2.0 R9BW 2.0 #399

Open kellerman opened 10 months ago

kellerman commented 10 months ago

Hello. I already posted in tuya-local github about the issue. But it feels this relates to tinytuya library more than tuya-local. So I am tinkering with these chinese IoT devices for a while and I can find all my devices with different protocol versions with tinytuya. I leave the Tuya phone app closed, tried blocking DNS to Tuya's servers, tried powering the device with USB power instead of battery, restarting multiple times, repairing multiple times, nothing. I can ping the device only. When repairing the device to Tuya app I get some UDP traffic on port 7000 which comes from my phone. Nothing from the device. Well the guys at tuya-local claim, that the T9W is supported with protocol 3.5, but maybe the 2.0 version I recently bought is somewhat not yet supported, some new protocol or something. Can you maybe guide me more to debugging and possibly even getting to understand how the device talks over network. I have the credentials from Tuya's developer website. Here is my device info from iot.tuya.com { "result": [ { "active_time": 1692484071, "category": "wk", "create_time": 1692484071, "custom_name": "", "icon": "smart/icon/ay1547209623516pqlXf/7a9d8dfea8b9b93aa706696ef9549e01.png", "id": "bffc7a40ae1b2eb4aabyms", "ip": "212.93.115.xxx", "is_online": true, "lat": "56.xxx", "local_key": "&7S#*0XK=349[mbs", "lon": "25.xxx", "model": "T9W 2.0, R9BW 2.0", "name": "Floor Heating", "product_id": "eaacu1av8nz9qdva", "product_name": "采暖温控v2", "sub": false, "time_zone": "+03:00", "update_time": 1692484073, "uuid": "f8dcec28886dac9d" } ], "success": true, "t": 1692485265757, "tid": "6a0490e33ee211ee9a70760d0d3c40d3" }

uzlonewolf commented 10 months ago

Battery-powered devices only connect to the WiFi briefly, just long enough to transmit the data they want to send, and then disconnect. Although your device can use both batteries and USB power, the software may be written to always act like it's battery powered.

Try running a super-long-duration scan (python3 -m tinytuya scan 9999) and while that's running, reboot the thermostat.

kellerman commented 10 months ago

Battery-powered devices only connect to the WiFi briefly, just long enough to transmit the data they want to send, and then disconnect. Although your device can use both batteries and USB power, the software may be written to always act like it's battery powered.

Try running a super-long-duration scan (python3 -m tinytuya scan 9999) and while that's running, reboot the thermostat.

Thanks for reply. I now started the long scan. I restarted both the thermostat and the RF reciever part, and attached the USB power supply to the thermostat. The device seems to be connected to WiFi all the time and it responds to ICMP ping fine. The official Tuya app I have now force stopped, there is no interaction to the official services from my side (which otherwise works fine). I tried different port scanning with nmap, but couldn't see anything else than working ping and the devices MAC address.

Edit The long search didn't show the thermostat