Skip to content

Setup Instructions

thirug010 edited this page Aug 21, 2019 · 7 revisions

Setup Instructions (Obtain device Id and local key, Install dependencies)

  1. Please follow this instructions to get device ID and local Key tuyapi- Device ID and Local Key

  2. clone/download the code from github https://github.com/thirug010/Virtual-Tasmota-for-Tuya-api-devices, extract and navigate the folder

  3. Install nodemon (required to update the newly added device without restarting the app) > "npm install nodemon"

  4. Install all dependencies libs > "npm install"

  5. Update the following MQttserver information in the "Utility.js"

    • Utility.mqttServer = 'mqtt://xxx.xxx.x.xxx:yyyy'; // Mqtt server ip and port
    • Utility.mqttUsername = 'xxxxxx'; // Mqtt server username
    • Utility.mqttPassword = 'xxxxx'; // Mqtt server username
    • Utility.mqttUseSequreLogin = false; // set true to use mqtt with username and password
    • Utility.mqttClientId = 'vir_tasmota_001'; // Mqtt client name
  6. Update the web(8082) and cdn(2362) port in "tuya_api_mqtt.js", if the port is in use var appPort = 8082;var cdnPort = 2362;

  7. Run the app using > "nodemon --ext rs tuya_api_mqtt.js"

  8. Open browser and navigate to 127.0.0.1:8082 or localhost:8082 and add new device

  9. Alternatively new device can be added to though CLI. run the CLI-App using the following command "node tuya_api_mqtt_cli.js"

  10. If you runinng the main app(tuya_api_mqtt) using nodemon then the new device will be active automatically else restart the main node app to refresh the newly added device.

  11. This code feature is not fully tested for all devices, feel free to post the comments or feedback

Clone this wiki locally