-
Notifications
You must be signed in to change notification settings - Fork 52
Setup Instructions
Miki edited this page Sep 14, 2019
·
9 revisions
You will need your iPhone and console access to the server you are using or plan to use for Homebridge. All the following steps are to be performed on the console of your server, unless stated. While it might appear to be just too much, it hardly takes a minute to get done provided you have a functioning Homebridge setup.
Make sure you perform the cleanup steps after you are done.
- If you haven't already, install and configure Homebridge.
- Install this plugin using
npm i -g homebridge-tuya-lan
. - Add all your devices to the Tuya Smart app to avoid having to repeat these steps.
- Using any app other than Tuya Smart might not result in the desired outcome. You might be able to install the Tuya Smart app, extract
id
andkey
combinations, and simply abandon or uninstall it, without thekey
going bad.
- Using any app other than Tuya Smart might not result in the desired outcome. You might be able to install the Tuya Smart app, extract
- Make sure the Tuya Smart app is not running or minimized.
- Follow these steps to get the
id
andkey
combinations for the devices. These instructions were created for iOS 13; using older versions of iOS, you might see some slight differences.- Execute
tuya-lan-find
. Within a few seconds, you would be shown (a) a QR code and (b) details of the proxy server.- If you have a new type of device, you can run
tuya-lan-find --schema
to get the full definition of your device.
- If you have a new type of device, you can run
- Scan the QR code with your iPhone. If you don't know how to do that, just say "Hey Siri, scan a QR code!" and point the camera at the barcode.
- Your phone will ask you your permission to open Safari; let it.
- Safari will alert you that the website is trying to download a configuration profile; allow that too.
- A confirmation message will be shown, letting you know that the profile was downloaded. Hit
Close
. - Launch the
Settings
app on your phone. Just below your name, you would findProfile Downloaded
; tap it.-
If you are using an older iOS, you won't see that. Go to
General
, scroll down, and tap onProfiles & Device Management
. Tap onNodeMITMProxyCA
and follow the steps below.
-
If you are using an older iOS, you won't see that. Go to
- You would find yourself on the
Install Profile
screen forNodeMITMProxyCA
. HitInstall
on the top-right of the screen. If your phone has a passcode, you would be asked to enter it. A confirmation dialog will pop up; hitInstall
again. Finally hitDone
to close it all.- We will get rid of this "profile" later.
- On your iPhone, go to
Settings
, openGeneral
, and tap onAbout
. Towards the bottom, locate and openCertificate Trust Settings
. - Enable full trust for
NodeMITMProxyCA
by flicking its switch. You will be prompted with a warning; just hitContinue
. - On your iPhone, go to
Settings
and openWi-Fi
. Hit the info button, which is a bluei
in a circle, for the WiFi connection you are using. This will open the configuration for your connection. - On your WiFi connection screen, scroll to the bottom and hit
Configure Proxy
. This will open the proxy configuration screen. - On the proxy configuration screen, tap on
Manual
to reveal additional settings. Use the details shown below the QR code to fill in the server and port.- Leave the
Authentication
switch off.
- Leave the
- On your phone, open the Tuya Smart app; if it was already open, kill it and open it again. In a few seconds, a several lines will appear under the QR code on the console.
- Grab the
id
andkey
for your devices.
- Grab the
- After storing the
id
andkey
combinations elsewhere, follow the clean up instructions below to get rid of all the things we won't need anymore, and to be able to use your phone again.
- Execute
- Update the
config.json
file of your Homebridge setup, by modifying the sample configurations and using theid
andkey
combinations.
After taking note of your id
and key
combinations, follow this steps to revert the changes you made above. Do not miss these!
- On your iPhone, go to
Settings
and openWi-Fi
. Hit the info button, which is a bluei
in a circle, for the WiFi connection you are using. OpenConfigure Proxy
and selectOff
. - On your iPhone, go to
Settings
>General
>About
>Certificate Trust Settings
and switch off full trust forNodeMITMProxyCA
. - On your iPhone, go to
Settings
>General
>Profiles & Device Management
>NodeMITMProxyCA
and tapRemove Profile
. If one is set, you will be asked to enter your passcode. You would also be asked to confirm that you want to remove the profile; hitRemove
.