Coder Social home page Coder Social logo

Woox (Tuya compatible) devices about tuya-adapter HOT 4 CLOSED

bewee avatar bewee commented on September 3, 2024
Woox (Tuya compatible) devices

from tuya-adapter.

Comments (4)

bewee avatar bewee commented on September 3, 2024

Hi @PaulvdL,

the tuya add-on supports not only IoT devices branded directly by tuya, but also tuya-enabled devices of other manufacturers (e.g. FEIT electric). So I am confident that your Woox devices may work with this add-on out of the box as well (although I obviously cannot guarantee).

As stated in #28, the setup process for tuya devices is still a little more complicated than just pressing the pair button. So please follow the setup instructions given in the README.md to obtain the id and key values of your devices, which you then pass to the add-on in order to recognize them.

If you happen to own some more exotic devices (somebody once had a fireplace heater for instance) or devices which do not follow the common protocols (for instance a light bulb with a colour scheme the add-on does not know about yet), not all the properties may get recognized correctly. In this case, have a look at #9 and open a PR or just reach back to me here :)

Regards

from tuya-adapter.

bewee avatar bewee commented on September 3, 2024

Hi @PaulvdL,

the Product ID (16 characters)

key Product ID of the device

I am a little confused that you talk about "product ids". This sounds to me like some general property of a certain product. But the key value is rather a secret token generated during the handshake (what you did using tinytuya). This value is, like a password, used to protect your device from unauthorized use, and will be regenerated with every handshake.

Do you have any idea why my devices are not responding to my gateway instructions?

If the key is wrong (and you rather pasted some generic product ID into the add-on config) that's definitely a reason.
Could you please have a look at the log file (located in ~/.mozilla-iot/logs/run-app.log) and paste the interesting regions of it here?

The TinyTuya software finds my Zigbee gateway, but not the devices connected to it.

I guess that's because your gateway is a tuya device, but the devices connected to it aren't (but rather Zigbee devices).

Do you know how I can connect them to the WebThings gateway?

Since they seem to use the Zigbee protocol rather than the tuya interface, I would suggest you to have a look at the affiliated add-on and maybe file an issue there: https://github.com/WebThingsIO/zigbee-adapter

I am also wondering how I can add new device types (and their properties) to the Tuya Smart Life add-on. Is that through your instructions in #9?

Exactly

I went into that and I noticed that was a process to create a clone of the Smart Life/Tuya android/Ios app. Can you explain what this has to do with the WebThings gateway?

I doubt to fully understand this question. But I guess the answer is: Absolutely nothing. This add-on is not much more than an adapter between the webthings gateway and the tuyapi (an open source library which allows javascript programs (like this add-on) to talk directly to tuya devices). Since that library requires you to obtain the id+key value of your devices, this add-on does so too. And the process involving the tuya developer account is just the most convenient way of obtaining these values afaik.

Regards :)

from tuya-adapter.

PaulvdL avatar PaulvdL commented on September 3, 2024

Hi everyone,

I have spent some time to find out how you can include Tuya compatible wifi smart devices in your WebThings gateway. Most of the information is available on the forum, but not in one place.
The Webthings gateway has a Tuya Smart Life add-on that enables you to find Tuya (+ compatible) devices in your network and add them to your Webtings gateway in order to monitor and control them.
The main problem is that the Tuya Smart Life add-on needs and id and a local key value of all the devices you want to add to your gateway.
To obtain this device information and to add the devices to the gateway, I did the following:

  1. Add your devices to your network by means of the proprietary app (Tuya, Smart Life, etc.) on your phone/tablet.
  2. Create a Tuya developers account on the iot.tuya.com website.
  3. Create a new project on the website (give it any name, it is not important).
  4. With the project you get a Access ID/Client ID and a Access Secret/Client Secret which you will need later in the process.
  5. Click on "Link Devices" on the left side of the screen. This will bring you to the Link Devices screen.
  6. Click on "Link devices by App Account" in the Link Devices screen.
  7. Click on the blue "Add App Account" button on the right side of the screen. This will bring up a QR code to the screen.
  8. Go to the Tuya (or similar) app on your phone go to the "Me" screen of the app.
  9. Click on the scanner icon in the right top corner of the screen. This will open the phone camera and scan the QR code.
  10. This will link your app user account to the project and it will connect the smart devices from your app to the project.
  11. Click on "Device List" on the left side of the screen and this will bring up a screen with the smart devices known to your app.
    Attention: I had to change the "Region" field on the screen from China to Europe to make the device list visible!
  12. You will notice that in the first column of the device list contains the Device name and the Device ID. You will need the ID's later in the process.
  13. Install the Tuya CLI tool on your Raspberry (npm i @tuyapi/cli -g (use sudo in case of error messages).
  14. Run the Tuya CLI tool (Tuya-CLI wizard). The wizard will prompt you for the following:
    API Key: <give in the Access ID/Client ID from the project you created on the iot.tuya.com website>
    API Secret Value: <give in the Secret/Client Secret from the project you created on the iot.tuya.com website>
    Virtual ID: <give in one of the smart device id's from the device list mentioned above. It does not matter which one>
  15. The tool will respond with a list of all the (Tuya compatible) smart devices in your network with their ID's and local keys.
  16. Go to the Add-ons screen of the WebThings gateway and add the Tuya Smart Life add-on to the gateway.
  17. Click on the "Configure" button of the Tuya Smart Life add-on and add an entry for each smart device.
    (enter the ID, the local key and the device type (light, switch, etc. from a drop list).
  18. Go to the Things screen of the WebThings gateway and click on the "+" button to search for new devices on the network.
  19. After scanning you will presented a list of newly found smart devices.
  20. Click on the "Save" button of all the devices you want to show on the Things screen

That's it folks!

from tuya-adapter.

bewee avatar bewee commented on September 3, 2024

Hi @PaulvdL,

Thank you for your great work! I have added a separate file with your setup instructions linked from the README.md. Also, there is now a little more detailed contribution description.

Regards :)

from tuya-adapter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.