![]() ![]() Json = status() # returns json payload from device Defaults to None.ĭev_type (str): Device type for payload options (see below) Local_key (str, optional): The encryption key. OutletDevice(dev_id, address, local_key=None, dev_type='default')ĬoverDevice(dev_id, address, local_key=None, dev_type='default')īulbDevice(dev_id, address, local_key=None, dev_type='default')ĭev_id (str): Device ID e.g. Scan() # interactive scan of local network Programming with TinyTuya TinyTuya Module Classes and Functions Global Functionsĭevices = scanDevices() # returns dictionary of devices found on local network For a helpful video walk-through of getting the LOCAL_KEYs you can also watch this great Tech With Eddie YouTube tutorial.The TinyTuya Wizard was inspired by the TuyAPI CLI which is an alternative way to fetch the LOCAL_KEYs: npm i -g and run tuya-cli wizard.If you ever reset or re-pair your smart devices, they will reset their LOCAL_KEY and you will need to repeat these steps above.TinyTuya will use this file to provide additional details to scan results from tinytuya.scanDevices() or when running python3 -m tinytuya to scan your local network. In addition to displaying the list of devices, Wizard will create a local file devices.json.The "key"s in this list are the Devices' LOCAL_KEY you will use to poll your device. The Wizard will poll the Tuya IoT Platform and print a JSON list of all your registered devices with the "name", "id" and "key" of your registered device(s).Use one from step 2 above or found in the Device List on your Tuya IoT project. The Wizard will prompt you for the API ID key, API Secret, API Region (us, eu, cn or in) from your Tuya IoT project noted above.From your PC/Mac run the TinyTuya Setup Wizard to fetch the Device LOCAL_KEYs for all of your.Verify under Cloud Development -> select your project -> API Setting that the following API groups have status "Open": Authorization management, Device Management and Device Control ( see here).When you scan the QR code, it will link all of the devices registered in your Smart Life app into your Tuya IoT project. Scan the QR code with the Smart Life app on your Phone (see step 1 above) by going to the "Me" tab in the Smart Life app and clicking on the QR code button in the upper right hand corner of the app. Click 'Add App Account' and it will display a QR code.Go to Cloud Development -> select your project -> Project Overview -> Linked Device -> Link devices by App Account (tab).Go to Cloud Development -> Create a project (note the Authorization Key: API ID and Secret for below).Create a Tuya Developer account on and log in.Follow these instructions to get the LOCAL_KEY: Both 3.1 and 3.3 devices will require a device LOCAL_KEY to control the device. Firmware 1.0.5 or above) will require a device LOCAL_KEY to read the status. Get device LOCAL_KEY: Devices running the latest protocol version 3.3 (e.g.Get device IP, ID and VERSION: Run the tinytuya scan to get a list of Tuya devices on your network along with their device IP, ID and VERSION number (3.1 or 3.3). ![]() Pair with your smart plug (this is important as you cannot monitor a plug that has not been paired). Download the "Smart Life" - Smart Living app for iPhone or Android.The following steps will help you determine the settings for your Tuya devices: Get the Tuya Device LOCAL_KEY Starting with v1.1.0, tinytuya also has a built in setup Wizard that will poll the Tuya IoT Cloud Platform and print a JSON list of all your registered devices (provides Name, ID and LOCAL_KEY). The tinytuya module has a built in network scanner that can be used to find Tuya Devices on your local network (provides IP, ID and VERSION). Pulling data from Tuya devices on your network requires that you know the Device IP, ID, VERSION and LOCAL_KEY (for 3.3 devices). # Install required libraries sudo apt-get install python-crypto python-pip # for RPi, Linux python3 -m pip install pycryptodome # or pycrypto or Crypto or pyaes python3 -m pip install tinytuya # this module Tuya Device Preparation Install pip and python libraries if you haven't already. NOTE This module requires the devices to have already been activated by Smart Life App (or similar). This is a compatible replacement for the pytuya PyPi module. This python module to control and monitor WiFi Tuya compatible Smart Devices (Plugs, Switches, Lights, Window Covers, etc.). Python module to interface with Tuya WiFi smart devices Description
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |