{"repo":"codetheweb/tuyapi","free":true,"listed":false,"github":"https://github.com/codetheweb/tuyapi","clone":"git clone https://github.com/codetheweb/tuyapi.git","description":"🌧 An easy-to-use API for devices that use Tuya's cloud services. Documentation: https://codetheweb.github.io/tuyapi.","language":"JavaScript","stars":2316,"topics":["iot","tuya","nodejs","smarthome","local"],"license":"MIT","category":"dev-tools","readme_excerpt":"TuyAPI 🌧 🔌 A library for communicating with devices that use the Tuya cloud network. These devices are branded under many different names, but if your device works with the TuyaSmart app or port 6668 is open on your device chances are this library will work. Installation npm install codetheweb/tuyapi Basic Usage See the setup instructions for how to find the needed parameters. These examples should report the current status, set the default property to the opposite of what it currently is, then report the changed status. They will need to be adapted if your device does not have a boolean property at index 1 (i.e. it doesn't have an on/off property). Index 20 seems to be another somewhat common on/off property. Asynchronous (event based, recommended) Synchronous Data not updating? Some new devices don't send data updates if the app isn't open. These devices need to be \"forced\" to send updates. You can do so by calling refresh() (see docs), which will emit a dp-refresh event. 📝 Notes - Only one TCP connection can be in use with a device at once. If using this, do not have the app on your phone open. - Some devices ship with older firmware that may not work with tuyapi . If you're experiencing issues, please try updating the device's firmware in the official app. - Newer firmware may use protocol 3.3. If you are not using find() , you will need to manually pass version: 3.3 to the constructor. - TuyAPI does not support sensors due to the fact that they only connect to the net","default_branch":null,"files":null,"tree":[],"storefront":"/r/codetheweb","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/codetheweb/tuyapi/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}