Thanks for the pr. I’ll take a look as soon as I have some time. I can’t remember what keys were returned with my devices, so I need to check that my test devices don’t also return the keys you have used. It may take a few days, but I will get to it asap.
Thanks for the contribution, if you have any other ideas for improvement i’d be happy to include them.
Cool!
Let me know if there is anything that you see that you think should be changed.
It would be nice if there was a better way of knowing those indices from the data returned; however, I wasn’t able to think of one that would be accurate yet.
I’ll play around with it a bit more in the following days and may open up another pr if I can think of any meaningful changes!
VirtualID is DeviceID, DeviceKey must be exported as a “localKey” from the app itself (rooted device, older version of the app) or via communication (sniffing SSL packets of the app).
It looks like you are connecting to the device but it’s returning a payload that is encoded. That’s to be expected but the python package should be decoding it. So, that means one of 3 things:
The wrong key is being used
The wrong api version is being used
You have a device that is using a different api version all together
Thank you, this is amazing! Feel like I’m so close…but keep getting socket errors. I’ve confirmed
Three devices I’m working with are on 3.1.
CloudMQTT is working as devices from Ring are coming in without issue
Server credentials are correct
Crontab file includes three lines in format:
pythonlocation tuya2mqttlocation “deviceID” “IPAddress” “” “3.1”
Using CloudMQTT, see the requests coming in but continue to get the following:
2020-01-10 06:37:03: Received PUBLISH from vm (d0, q0, r0, m0, ‘devices/tuya/plug/’, … (146 bytes))
2020-01-10 06:37:03: Socket error on client vm, disconnecting.
The key and id are unique to every device. Are you using the same details in bluestacks to get those dps values shown in the image I referred to in the previous posts?
If you hit the device too often it will typically start to refuse your connections for a period of time. Likewise if you have the device open in the app, the device will refuse to connect.