-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to control Universal IR Device #225
Comments
@ClusterM since you added this support, can you help with this? |
This might be one of the new devices mentioned in #74. After sending a command with the app, what do the device debug logs show? What DPS are they using? These can be found in the Tuya developer portal (instructions for getting them can be found at https://www.zigbee2mqtt.io/advanced/support-new-devices/03_find_tuya_data_points.html#_7-find-your-devices ) |
Hi @uzlonewolf those are shown after sending a command with the app. |
Thanks for that. What happens if you run: import tinytuya
tinytuya.set_debug(toggle=True, color=False)
ir = tinytuya.Device("35217541c45bbef5a1f1", version=3.3, persist=True)
ir.set_value(3, "1IyOvEToCZQI5AkoCOgJNAjYCTwI4AlACNQJMAjkCTQI2ApsGSwKZBkkClwZMAp8GLALLBhgC0wYRAtMGEwLRBhMCbgIdAmkCGwLKBhsCagIaAsoGGgJzAhACbwIWAnICFAJvAh0CxgYdAmoCFwLMBhoCcAIUAtAGFALRBhQC0QYUAtAGFQKXnBgjCAkXAiDL")
ir.set_value(1, "send_ir") |
|
Did that work? If not, how about: import tinytuya
tinytuya.set_debug(toggle=True, color=False)
ir = tinytuya.Device("35217541c45bbef5a1f1", version=3.3, persist=True)
ir.set_value(4, "01%^002001FE50AF@&%*@(")
ir.set_value(3, "020ed8000000000008001600160042015600ac05f3005807b8")
ir.set_value(1, "send_ir") |
nothing happening on the device. (no led blink too) 😟 |
@uzlonewolf here. |
Thanks for that. Try these: import tinytuya
tinytuya.set_debug(toggle=True, color=False)
ir = tinytuya.Device("35217541c45bbef5a1f1", version=3.3, persist=True)
ir.set_value(4, "01%^002001FE50AF@&%*@(")
ir.set_value(3, "020ed8000000000008001600160042015600ac05f3005807b8")
ir.set_value(13, 0)
ir.set_value(10, 300)
ir.set_value(1, "send_ir") or import tinytuya
tinytuya.set_debug(toggle=True, color=False)
ir = tinytuya.Device("35217541c45bbef5a1f1", version=3.3, persist=True)
ir.set_value(4, "01%^002001FE50AF@&%*@(")
ir.set_value(3, "020ed8000000000008001600160042015600ac05f3005807b8")
ir.set_value(13, 0)
ir.set_value(10, 300)
ir.set_value(1, "send") If neither of those work then it's going to have to wait until I have one to poke at, hopefully late tomorrow. |
still not work 😟 |
is there a way to sniff the packages the app sends? |
Yes, however it's not exactly easy unless you've done it before. You basically need to keep your phone connected to the WiFi but block all internet access (both cellular and via WiFi), sniff the WiFi packets to the device, and then decrypt them with the local key. It's not too bad if you have an environment set up to do it, but the first time will take a while to get everything set up. Amazon says mine will be delivered later today, so expect a patch later tonight. |
Well that was a lot harder than it should have been. Turns out, unlike pretty much every other device I have, IR blasters cannot be used in offline-local mode, so I was not able to sniff the traffic. They also do not send async status reports when another device tells it to transmit IR. So, I ended up taking mine to bits and plugging into the exposed headers to capture debug information in an attempt to glean something useful. (As a side note, it turns out these things use a ESP8266 chip, so Tasmota is an option if you want to go that route.) At first the logs didn't look too useful, just notes about updating DPS 1, 3, and 4:
But then I noticed that "remain size" line. That sure looks like a buffer for the DPS JSON, but why is it so large? Unless... import tinytuya
tinytuya.set_debug(toggle=True, color=False)
ir = tinytuya.Device("35217541c45bbef5a1f1", version=3.3, persist=True)
payload = ir.generate_payload(tinytuya.CONTROL, {"1": "send_ir", "3":"020ed8000000000008001600160042015600ac05f3005807b8", "4":"01%^002001FE50AF@&%*@(", "10":3000, "13":0})
print( ir._send_receive(payload, getresponse=True) ) Bingo! It transmits! Quite obvious in hindsight actually. Raw sequences are similar: import tinytuya
ir = tinytuya.Device("35217541c45bbef5a1f1", version=3.3, persist=True)
payload = ir.generate_payload(tinytuya.CONTROL, {"1": "study_key", "7":"liGiETMCqQYwAqcGOQKhBjYCSgIsAkwCNgJGAi8CTQIyAkoCLwKmBjYCowYyAqsGLwJlAhsCZQIQAmYCFQJsAg8CaAIRAmsCEQLIBhICzQYQAmYCEQJqAhECbAIQAmoCFwJmAhACxwYUAmcCEwJrAhECxgYTAskGEALHBhMCxgYSAsgGFwIgyw=="})
print( ir._send_receive(payload, getresponse=True) ) Hopefully I can get a patch submitted tomorrow. |
Hi. just bought a Smart IR Remote Control Hub unable to control it with tinytuya
I can control the device with Tuya App. the led on the device blinks when sending any button with the app.
But there is no response from the device nor the led blinks when trying to control it with tinytuya
python -m tinytuya scan
My Code:
The text was updated successfully, but these errors were encountered: