Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rs file missing? #3

Closed
mobamoba opened this issue Jul 9, 2019 · 12 comments
Closed

rs file missing? #3

mobamoba opened this issue Jul 9, 2019 · 12 comments

Comments

@mobamoba
Copy link

mobamoba commented Jul 9, 2019

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
Copy link
Owner

@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
Copy link
Owner

thirug010 commented Jul 10, 2019

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_switch_ch3"} , {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
Copy link
Owner

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

@mobamoba
Copy link
Author

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
Copy link
Owner

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

@mobamoba
Copy link
Author

Great thanks.

@thirug010
Copy link
Owner

thirug010 commented Jul 14, 2019

@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
Copy link
Author

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
Copy link
Owner

@mobamoba, issue fixed check now

@mobamoba
Copy link
Author

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

@thirug010
Copy link
Owner

thirug010 commented Jul 15, 2019

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants