thirug010 / Virtual-Tasmota-for-Tuya-api-devices

New Tuya firmware (1.0.7, 2.0, 3.3..) updates disable the OTA Flashing options at the moment, This feature allows you to use the non flashed Tuya devices as tasmota device along with tasmota flashed devices, most of the tasmota features is virtually available and it can be expanded.
MIT License
16 stars 0 forks source link

rs file missing? #3

Closed mobamoba closed 4 years ago

mobamoba commented 5 years ago

Sorry I'm new to this. I followed your setup instructions but it's not working. I notice a reference to "Tuya-Api-Tasmota.rs" and "tuya-api-template.js" but I don't actually see either of those. Was there something additional I was supposed to install? Thanks.

thirug010 commented 5 years ago

@mobamoba,

Thanks for letting me know the template is missing, Template is upload.

  1. Use the template to add new devices ( JSon array format) update the deviceId, local key , friendly name , topic or
  2. In the home page click on the [+] icon to add new device image

Thanks Thiru

thirug010 commented 5 years ago

tuya-api-template.js

{"tam_app_001":{"deviceConfig":[{"topic":"nodeId","devId":"xxxxxxxxxxxxx","key":"xxxxxxxxxxxxx","friendlyName":"xxxxxxxxxxxxxx","nodeId":"xxxxxxxxxxxxxxx","name":"Tuya Swtich 3 CH","id":"tuya_switch_ch3","template":"shd_s3c_template.htm","isDimmer":false,"powers":[1,2,3],"dimmerId":0,"rangeFactor":-1,"minDimValue":1,"telePeriod":{"time":"15","factor":"s"},"pulsePeriod":{"1":{"time":-1,"factor":"n"},"2":{"time":-1,"factor":"n"},"3":{"time":-1,"factor":"n"},"4":{"time":-1,"factor":"n"}},"deviceType":"tuya_switchch3"} , **{repeat for second device } ...._** ] }}

Update and save it as "Tuya-Api-Tasmota.rs"

if you are not comfortable using json template use the [+] icon from the home page http://127.0.0.1:8082 to add new devices

Thanks Thiru

thirug010 commented 4 years ago

@mobamoba, Please let me know if you need any help .. ?

mobamoba commented 4 years ago

Thanks that solved it. I have a question though (sorry for the noobiness :)): is there a way to use a command line with the app rather than the gui? Thanks.

thirug010 commented 4 years ago

@mobamoba , Thanks for the confirmation, Will add CLI and Mqtt option to added / manage device .

mobamoba commented 4 years ago

Great thanks.

thirug010 commented 4 years ago

@mobamoba, CLI option is added follow the steps,

  1. Get latest code from the github
  2. Navigate to the code path and run "npm install"
  3. Run the Main with nodemon and run the CLI in separate instance "node tuya_api_mqtt_cli.js"
  4. New device will be added and will start sending mqtt

Check and let me know image

mobamoba commented 4 years ago

npm install is throwing this error:

npm ERR! file C:\npmnodes\Virtual-Tasmota-for-Tuya-api-devices\package.json npm ERR! code EJSONPARSE npm ERR! JSON.parse Failed to parse json npm ERR! JSON.parse Unexpected number in JSON at position 331 while parsing '{ npm ERR! JSON.parse "name": "tuya-api-mqtt", npm ERR! JSON.parse "descri' npm ERR! JSON.parse Failed to parse package.json data. npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.

thirug010 commented 4 years ago

@mobamoba, issue fixed check now

mobamoba commented 4 years ago

Yes that worked. Is there a way to use the CLI to manipulate the device (like toggling it on or off)? Thanks

thirug010 commented 4 years ago

I am not getting it. can you give me example of what you are looking for. You can use mqtt command to achieve it

mobamoba commented 4 years ago

Yes I realized that like 2 minutes after I typed my question - ignore :), thanks!