TheAgentK / tuya-mqtt

Nodejs-Script to combine tuyaapi and openhab via mqtt
MIT License
173 stars 81 forks source link

Samples for nodejs script #68

Closed jah0wl closed 3 years ago

jah0wl commented 3 years ago

I'm sorry, but I can't find any sample or the real API documentation for controlling my RGB Led Device using this library. Or am I missing something? Thanks for your work on the library, btw.

tsightler commented 3 years ago

I don't understand what you are asking for. This is not an API, this is a script which provides a bridge to control Tuya devices locally via MQTT. The documentation has plenty of examples how to use this script with MQTT.

jah0wl commented 3 years ago

I'm sorry, but where are those examples? I can't find any. I've used tuyapi, and there are examples, but how can I use the friendly topics that tuya-mqtt implements? Are there any examples of that somewhere? Thanks

Flip76 commented 3 years ago

https://github.com/TheAgentK/tuya-mqtt/blob/master/docs/DEVICES.md

jah0wl commented 3 years ago

Ok... this doesnt' explain how can I make a nodejs script and change my led strip color... this all is so confusing and no example to work with.

Flip76 commented 3 years ago

If you want to control your devices via a nodejs script, maybe tuya-mqtt is the wrong approach.... tuya-mqtt is designed to control devices via MQTT... So basically you need a script which connects to your MQTT broker and from there you can send commands to the topics...

tsightler commented 3 years ago

Why would this project need to explain how to make a nodejs script? If you want to write your own NodeJS script, you should use TuyAPI, which you stated you already have done.

This project IS a NodeJS script, which allows you to interface Tuya devices to MQTT, you can then control your lights with any MQTT client, not NodeJS scripting required. You don't need to make a NodeJS script to use this project as, other than being written for NodeJS, this project has nothing to do with it. The linked documentation shows how to create a devices file so that your Tuya device will be exposed via MQTT and it documents all topics for the device. I'm not sure what more I can possibly provide.

jah0wl commented 3 years ago

Instead of saying "this project shouldn't" why just don't point me to real samples, as it seems you may know? This is supposed to be a community of helping people, not people blaming other people asking for help. Thanks for nothing.

Flip76 commented 3 years ago

You opened an issue - which basically means you found something which is not working like it should.... Issues are not intended to skip reading documentation! Maybe you should go and google the difference between NodeJS and MQTT.

Thanks for nothing.

Likewise!

tsightler commented 3 years ago

Instead of saying "this project shouldn't" why just don't point me to real samples, as it seems you may know?

There's literally a real sample config directly in the documentation that was linked above, and every single topic is fully documented, and if you just run the script one time it spits out all the topics for your device. If you won't try it what good is linking to a different sample going to do? Did you even try to use this script?

Thanks for nothing.

LOL! That's the thing about community, the less effort you put in yourself, the less you're likely to get out. If you put in nothing, well, that's result we have here. If you decide that you are willing to put in some effort to figure this out, I'm still happy to help, but for now I'm closing this.