-
Notifications
You must be signed in to change notification settings - Fork 50
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
Tuya Garage door opener #53
Comments
therte is already a thread for garage door opener here |
Sorry, was not aware that this is the same device. |
Please give the latest The Setup Instructions have changed in case you need to obtain a fresh |
Hi, I have configured and installed the latest release for this plugin in homebridge but I am hitting the following error continuously, any advice on what I am doing so wrong would be appreciated. [TuyaAccessory] Socket had a problem and will reconnect to Garage Door (Error: ERR_PING_TIMED_OUT). This is common for v3.3 devices. |
If the device works, the ping timeout is not that important. Does it work? |
@jchristianj, my own garage door opener shows up as a garage door with Homekit's animation and everything. Having it as a switch would be so ugly. |
@AMoo-Miki , thanks for the reply. The garage door opener does not work. I've tested ping from shell and it takes 200ms first try, then drops to 10ms, so network shouldn't be an issue. The controller does work from the native Tuya app, but not via homebridge. |
The ping timeout is different from the ping you checked; it is a Tuya thing. Add `"pingTimeout": 3600 to prevent the socket from timing out. Also make sure that the Tuya app is not running on your phone as that will block the device from talking to this plugin. Do you see anything in the logs that |
2019-09-07 06:02:53,stdout,"�[37m[9/7/2019, 6:02:53 AM]�[39m �[36m[TuyaLan]�[39m Ready to handle Garage Door (GarageDoor:3.3) with signature {"7":0} I haven't had any matching logs in the last hour current time being 7:44 am (UTC). I have completely uninstalled the Tuya app from my phone after getting the ID and keys. |
This is great. Add this to your config file for this device: |
After applying changes to the config.json, and restarting the docker container, I get the following error: Spotted I'd mistyped dpAction as dpaction. Fixed and trying again. |
You are better off without the version in the config unless you know your device is indeed a 3.3. The plugin figures this out for itself. If your device is really a 3.1, having the 3.3 could explain the ping timeouts and it could prevent the plugin from communicating correctly. |
I deleted your message because it had your |
Fixed: JSON section now reads; |
Do you see the signature line? Can you open the Home app and try to open the garage door? When you do, what messages do you see in the log? |
No change. Device is now showing in HomeKit with a red Open state - and not responding to change state actions. |
Do you see any messages in the log? |
After container restart, had the following log messages: `2019-09-07 08:03:48,stdout,"�[37m[9/7/2019, 8:03:48 AM]�[39m �[36m[TuyaLan]�[39m Discovered Garage Door ( << id >> ) identified as GarageDoor (3.3) 2019-09-07 08:03:48,stdout,"�[37m[9/7/2019, 8:03:48 AM]�[39m �[36m[TuyaLan]�[39m Connected to Garage Door 2019-09-07 08:04:24,stdout,[TuyaAccessory] Socket had a problem and will reconnect to Garage Door (ECONNRESET). This is common for v3.3 devices. |
No PS, |
Nothing in the logs, this is the most recent records. Terminal only has the ECONNRESET records, nothing else is tagged [TuyaAccessories] or [TuyaLan] |
Without the Tuya app, how do you control the device? |
My HomeBridge links to HomeKit for control. |
Gotcha. When you said you uninstalled the Tuya app, I thought maybe you had a different one. Still thinking :) |
That line that says |
Discovered line: Was on homebridge-tuya-lan v1.5.0-rc.3, just updated to rc.5. Restarting now, will advise status. |
I just pushed another How are you powering the device? Can you power cycle it? |
Updated to rc6. Logs: Physically disconnecting from AC and reconnecting. Will attempt power-cycle now. |
Something odd is happening here. This device gave us the signature before and now it is refusing to give it to us. |
`[9/7/2019, 8:51:02 AM] Loaded plugin: homebridge-tuya-lan
[9/7/2019, 8:51:04 AM] Homebridge is running on port 51758. |
Can you try to re-get the |
|
Get rid of
|
|
Config is good. How does the device act? |
Device didn't react - but the logs are now showing more information on status changes from iOS logs |
:( One step forward and on back. What operating system are you on? Do you have a Mac handy? These are $50 locally :( I am tempted to order one just to test it. I have this in my cart, ready for checkout; is it the one you have? |
We're on a 2017 MacBook Pro on Catalina public beta. HomeBridge is on a Synology DiskStation inside a Docker container. |
That one looks the same. I'm about to spin up Wireshark to see what's going in/out |
Cool. That is what I was going to propose. Here is how you can tap in:
Now, I would trust me not to look at anything but Tuya on your dump but I wouldn't fault you if you don't. So either send me your PS, if you choose to send me your key, we will filter out the pcap to not have any information other than the device communication. |
I might shoot you an email, it's a bit easier, because there's a bit of background noise in the pcap I've captured. |
Just as a side note, the captures are from macOS from the native Home app there. I didn't have access to the transmissions being sent/received from the iOS app; this computer doesn't have Xcode installed at the moment. Happy to do so later on (it's 9pm in my local timezone :| |
Of course. To make sure you don't share your bank account details with me:
|
Thanks, I've just sent through the pcap file to your email now. |
@unvalider I sent you an email; your device is not there anywhere in the trace :( I created a complete set of instructions for this and it is a bit more complete that what we discussed here. See if you can follow that and get the trace. |
Thanks. |
Of course; whenever you get a chance. It's my pleasure. |
new packet captures have been sent through. |
Got your email. Decoded. The only difference I see is that I am not sending a CRC otherwise the plugin's commands are identical to those of the app. I will add CRC and let you know. |
There were 3 sections in a message that I was not handling: (1) control counter, (2) 8 characters that I haven't figured out, and (3) CRC checksum. I have added the CRC checksum and am hoping that is all that is needed to get your device to work. Please update to the latest |
Hi @AMoo-Miki |
Hurray! Thanks for helping figure this out; I would have renamed this accessory in your honor but I fear people will get confused >:\ Let's hope @jchristianj also reports back that the problem is solved. |
Hi, Thank You |
@singhrajtomar I was with @unvalider when he was setting his up, and I have the same model. There used to be a method which was available as a part of homebridge-tuya-lan, called tuya-lan-find, which would (by putting your iPhone into a proxy environment for a Man-In-The-Middle style configuration) enable the id and key to be retrieved from the Tuya Smart app. Tuya patched their app, and this no longer works. There are other alternate apps that also worked with the proxy find service; Ucomen Home, and Smart Life; these too appear to be patched in current versions. I can't even get Ucomen Home to recognise the opener anymore; even though this was the way it was initially set up; and the key appears to have changed; so I'm unable to get it set back up. |
how should we intercept the id and key then? do we have to use wireshark or similar tool then? |
@singhrajtomar The ID can be retrieved through the TuyaSmart app. The key cannot be retrieved; it’s used to encrypt the traffic. You could in theory try brute-force; but you’d need to know the encryption algorithm in use, and given the keys are 16-character hexadecimal, there’s about 18,446,744,070,737,095,500 (18 quintillion) possible combinations, even if your computer could attempt 10 keys per second, you would be in for a wait of approximately 5 billion years to exhaust all possibilities. |
I have the beginnings of a theory, but it's untested, as the files I want to test are encrypted with a key I am uncertain on how to retrieve. I went on a bit of a deep-dive to see if I can find any more information on the Tuya app yesterday. Tuya have been so generous as to include a list of all the other libraries used as a part of developing the Tuya Smart Application within the settings section of the app. As at 15/04/2020, this stood as:
Packages relevant to database encryption: OpenSSL, MMKV, UICKeyChainStore and SQLCipher.
After performing an un-encrypted iOS backup to my Mac, and then browsing said backup with a third party utility (iBackup Browser: "freemium" commercial software), I was able to access the file storage used by Tuya Smart, cross-checking against Ucomen Home. They're all the same on the back-end. I could be way off; however, my instincts say that the key for the devices is stored in 🧂 (salt warning) 🧂 Update: 16/04 |
Okay. So after looking all over the Internet, there’s really only one solution. Keys are next to impossible to retrieve from iOS, but thanks to being able to install older APKs outside the Play Store on Android, it’s pretty easy to grab keys. What you’ll need:
|
Hi!
I'm about to purchase this garage door opener:
https://www.amazon.com/dp/B07GGRCH23/ref=cm_sw_em_r_mt_dp_U_ea58CbW6D87JX
Will it be possible to add it to Homekit by Homebridge and your plugin on my Raspberry pi?
Main point is, I would like to have it shown as a garage door in Homekit, not as a switch. It should indicate feedback of the door (open/closed) in the icon as well.
Can you confirm it will be working like this?
Thanks and regards,
Christian
The text was updated successfully, but these errors were encountered: