Working with Tuya Cloud API: Introduction for beginners

Поделиться
HTML-код
  • Опубликовано: 22 окт 2024
  • НаукаНаука

Комментарии • 104

  • @xs2ahmed
    @xs2ahmed Месяц назад

    Hello,
    Thanks for the video, I have some questions below if you can advise.
    1 - If I have a device to purchase and it has Tuya logo on it, before the purchase and adding it to the Tuya clould , how would I know the list of API's for that device ? Whether it is suitable for my intended need or not ..
    2- Is Tuya cloud API only to read information published by the device or it can call API's on device to instruct it to do some operation only. In other words Is touya api read only api's or they can send the commands to device too..
    thank you

  • @joeroganpodfantasy42
    @joeroganpodfantasy42 Год назад

    4:59 I have been fantasising and dreaming about this finger bots , they have actually made them.

  • @hassbiano8150
    @hassbiano8150 3 года назад +2

    Just wonder if there is a tutorial behind this speed-up-not-enough-information video I just watched and tried to understand what to click and where to go for what? I know I am asking for too much - But I was hoping to have a basic settings to work with and not a quick flash and go kind of tutorial that you have provided here - This is a good place to learn from each other and I am also teaching miniature designs on my local channel - not on YT. a good Step-by-Step would have been a solution for people to actually learn from these videos - I was hoping to get this up and running using your tutorial and I was LOSDT from step 3.. I know that your channel called Not-Enough-tech , I was hoping for more - I do appreciate what you shared with us for sure I am not complaining I am just feeling somewhere we all missed the added value of sharing knowledge. I hope to have a step by step tutorial on that since I think this is a good solution for Smart home with Tuya - I wish somewhere I can find a REAL GOOD tutorial on this. Thanks

    • @notenoughtech
      @notenoughtech  3 года назад

      Have you seen the write up attached in the description? It has a bit more info on how to get started and the test flows to play about. Unfortunately with these things I have to pick a reasonable balance between covering important information and not making it 2h long.

    • @aryeguetta8592
      @aryeguetta8592 3 года назад

      @@notenoughtech I think that 2 hours video is too much :) But since I would also be happy to have a basic settings to work with Tuya cloud and make it work on my sdie as well.. I have tried several times and I am getting error with token and Parsing after I made all the needed changes and tried to follow your written tutorial with no success - I can relate with that I am missing the step by step basics to make the connection between the API and NodRed - The screen resolution is high on your end and it sometimes very hard to see what you have on your screen - I am using a regular 24" screen and have also hard time to follow your while setting up the Tuya API. I would be happy if someone can direct me with a step by step tutorial top successfully connect NodeRED and Tuya APi - that I will know what to fill in and where to do that? and with a paste that I can follow :) I know that I am asking to much and I am sure that I am not in the place to ask such a thing - I do thank everyone that share knowledge - But I am a bit frustrated when I can NOT follow the tutorial when I am following instructions and I feel that there is a major part of explanation that is missing. I would be happy to hacve the NodeRED and Tuya API connected - i have all my devices ready there and I am able to run the commands from the online API without any issues - I am not able to connect NR and Tuya :) Thanks

  • @kilnageer
    @kilnageer Год назад

    Thanks Mat. I can now talk to a Tuya DDS238. Enjoy the coffee :)

    • @notenoughtech
      @notenoughtech  Год назад

      Thank you (Anthony?) I'm about to brew up!

  • @RodrigoGomes-xo3hr
    @RodrigoGomes-xo3hr 2 года назад +1

    The trial edition is just one month right? After that we would need to pay?

    • @notenoughtech
      @notenoughtech  2 года назад

      I think I seen somewhere the Dev accounts were free if you didn't cross certain quota for requests. It's worth checking the current pricing structure as these things change sometimes and it has been a a year since

  • @susantasharma
    @susantasharma 2 года назад +1

    Thanks a ton man. I highly appriciate your effort. This is exactly what I was looking for. "You made it quite easily UNDERSTANDABLE".😊

  • @EsotericArctos
    @EsotericArctos 3 года назад +1

    Thanks for clearing this up. I am one of those that is fine with the cloud. I mean, apart from the reliance on internet, what data are they really collecting? The temperature inside? Humidity? I think some people over react and maybe need to take their foil hats off :) Their are plenty of companies, electricity, telephone etc, that have more data than Tuya does, and it is in the cloud as a lot use Azure or AWS.

    • @notenoughtech
      @notenoughtech  3 года назад +1

      I think we are in the same bucket. Sure it's good to be vigilant and I do appreciate the paranoid people who actually do the security research and publish exploits. But a paranoid end user is definitely not how I describe myself. Plus I'm already spied on by Alexa 😜

    • @EsotericArctos
      @EsotericArctos 3 года назад

      @@notenoughtech Or in my case Google. It never listens to me when I want it to, but it sure can pipe up and answer things when triggered by TV or RUclips

    • @notenoughtech
      @notenoughtech  3 года назад

      Haha so true

    • @lorddanielday3244
      @lorddanielday3244 2 года назад

      @@notenoughtech need some help with tuya api is there a way we can possibly speak or a service we can. Message on thanks Daniel

  • @juanjosesotogutierrez3997
    @juanjosesotogutierrez3997 7 месяцев назад

    Hi! Thanks for the information. I have a question, maybe you can help me about.
    I running the TUYA scripts in cURL based PHP. For now, I can successfuly connect and get the access_token, but when I try to run the 'Get Device data points' request cURL PHP based I'm receiving the 1004: sign invalid error. I'm using the same algorithm to sign this request as the 'Get Token' request. Any idea?
    As far as I've been reading the developer page; Only can figure that maybe the sign error came because of the body content_sha (I'm taking it blank bacause GET method same as the 'Get token'), but I'm stuck. In the Device management section doesn't came much information about if we have to send body content, I'm assuming it's only in the POST or PUT request...
    Regards from México.

  • @laGameTV
    @laGameTV 3 года назад +1

    How did you generate the Sign in the Pre-request Script for the Token? Would've been nice to know. Just got some smart home lights and trying to controll them and for testing i wanted to get everything working in postman. Could you help?

    • @notenoughtech
      @notenoughtech  3 года назад

      Postman has the shortcut for that to generate the token. Just fill in the variables correctly and you will be able to test it. The nodered setup just require your variables and will request one for you and keep it stored and refreshed every day

    • @laGameTV
      @laGameTV 3 года назад

      @@notenoughtech But.. i need a sign? Not a token that regenerates every day? Or did i get something wrong there? And from the looks in the video you have something defined in the "Pre-request Script" tab? Whats that and if i get the hole thing wrong. Whats the shortcut?

    • @notenoughtech
      @notenoughtech  3 года назад

      Sign is an encrypted token with the current timestwmp

    • @notenoughtech
      @notenoughtech  3 года назад

      ​@@laGameTV I have added the nonce to authenticate it according to the last standard. download available now

  • @erycson.schmeing
    @erycson.schmeing 6 месяцев назад

    I have a Raspberry Pi with a Flask server that controls some devices via http. I would like to link the http strings to buttons in the Tuya app, how do I do this?

  • @marcinooooo
    @marcinooooo 10 месяцев назад

    Hey, thank you for an amazing video! How can I query data about energy consumption form my smart plug via tuya iot platform and node red?

    • @notenoughtech
      @notenoughtech  10 месяцев назад +1

      You can query the socket periodically to see current value. There might be access to historical data but I would refer you to the documentation as I haven't done this

  • @aryelinux9676
    @aryelinux9676 3 года назад

    Can you please let me know what is the added value of using Postman over the API Explorer provided by Tuya in the Platform? I have been using it and it gave me almost everything that I needed. I would be happy to know if there is an added value on using Postman over API explorer - that i will need to go over all the settings needed and make Postman the Right tool for me. And I mean added value besides not using the web. Thanks

    • @notenoughtech
      @notenoughtech  3 года назад +1

      Postman generates the REST calls for most of languages out there it's handy if you are playing with a new API or a programming language you don't know well.
      It can greatly speed up development especially if the API provider gives you setting file for postman.

  • @klausschlitt6026
    @klausschlitt6026 Год назад

    Is postman still working with Tuya API? It was not possible for me to get an access token. My assumption is, that this issue might be related to changed signature validation by Tuya.

    • @notenoughtech
      @notenoughtech  Год назад +1

      The article had updated flow accounting for some changes a couple of months ago - have you tried that? if API has changed again recently, I haven't implemented anything else after that

    • @klausschlitt6026
      @klausschlitt6026 Год назад +1

      ​@@notenoughtech Thanks for the reply. Meanwhile, it is working. The problem was, that I missed saving the settings in "Environments" (e.g. url, client_id, etc.).

  • @faisalachmad8958
    @faisalachmad8958 3 года назад

    Hey great tutorial, i did exactly like you but got sign invalid. API is enabled. Any idea why?

    • @notenoughtech
      @notenoughtech  3 года назад

      Have you used correct URL for your region? Have you modified all the variables in the flow?

    • @faisalachmad8958
      @faisalachmad8958 3 года назад +1

      @@notenoughtech found the problem, had to fill in the details on the environment tab? For both initial and current. Works ok now, thanks!

  • @ajayshokal7193
    @ajayshokal7193 Год назад

    Hello, Can we send any data to our server by using Tuya Wifi module?...

    • @notenoughtech
      @notenoughtech  Год назад

      not without changind the firmware o your device. You can obtain the copy of that data from tuya cloud

  • @huseyint
    @huseyint 3 года назад

    I have recently purchased a tuya powered smart pet feeder, it's tuya category is "sp". I cannot find any function perform the feed operation through the API, any pointers would be greatly appreciated.

    • @notenoughtech
      @notenoughtech  3 года назад

      If you use the postman and device info with SP in the URL then you will have all the parameters that this device supports. Then look back at the docks for examples how to structure the data for each param. I'm mobile right now so I can't give precise instructions but it's not that difficult once you have the command tree posted back.

    • @huseyint
      @huseyint 3 года назад

      @@notenoughtech yeah I have done that but the thing is, it only has 4 functions listed which all related with the camera of the feeder. no functions listed for anything related with feeding.

    • @notenoughtech
      @notenoughtech  3 года назад

      How about the device status? Anything useful there ?

    • @huseyint
      @huseyint 3 года назад

      @@notenoughtech same set of function names to read the current status of their values

    • @notenoughtech
      @notenoughtech  3 года назад

      This is the link I was talking about. Send me an email with results I'll look into tomorrow when I have a moment maybe I'll have an idea how to do it

  • @jeanyvesfondu5811
    @jeanyvesfondu5811 2 года назад

    Hi, Good video, can you point me on is Schema field in postman?

    • @notenoughtech
      @notenoughtech  2 года назад

      Last time I checked there was one to download from the dev page. I think I might have linked it in the article associated with the video.

    • @jeanyvesfondu5811
      @jeanyvesfondu5811 2 года назад

      @@notenoughtech it seems there is a bug in the script implemented in postman.

    • @notenoughtech
      @notenoughtech  2 года назад

      I know authentication has changed since I initially covered it but I believe my flow shout reflect this. As per tuya postman scrip make sure you are using the one that has new authentication implemented. They could have both in the docs

  • @marcinooooo
    @marcinooooo 10 месяцев назад

    Where can I get NodeRed flow? Would you mind sharing it?

    • @marcinooooo
      @marcinooooo 10 месяцев назад

      that would actually be VERRRRY helpful, have been trying to recreate for the past 5 hours haha

    • @notenoughtech
      @notenoughtech  9 месяцев назад

      It's in the article at the end of it

    • @marcinooooo
      @marcinooooo 9 месяцев назад

      @@notenoughtech thank you, though the github code does not cover all of the presented flows e.g. refresh token. Do you have it somewhere else maybe? Thank you for all the help!

  • @ForWarZz
    @ForWarZz 3 года назад

    When i executing a request to get token on Postman, it's return to me "sign invalid", how can i solve it ? Help me plz

    • @notenoughtech
      @notenoughtech  3 года назад +1

      Credentials could be invalid or API not enabled. Also double check if you are using correct URL for your region

  • @FlyBarter
    @FlyBarter 3 года назад

    Hi I have been trying to follow this through for a few days now (why is it sooo difficult when Home Assistant just needs your Tuya user name and password) and I am now being returned "sign invalid" - this is a new (June 2021) stage to the validation process. Will you be updating these instructions to help use the new method please?

    • @notenoughtech
      @notenoughtech  3 года назад

      I pushed the update to github. Can you try the latest version?

    • @notenoughtech
      @notenoughtech  3 года назад

      From the updated description, it looks like you need to add the UUID to time to complete the authenticaton

    • @FlyBarter
      @FlyBarter 3 года назад

      @@notenoughtech Will do, thanks very much - I'll let you know how I get on.

    • @FlyBarter
      @FlyBarter 3 года назад

      Hi, I have tried working this through from the very start, triple checking everything. I even built a fresh Tuya account just in case that was the problem - all I ever get is 1004 "sign invalid". Can I please ask why is this so hard to set up in Red-Node when Home Assistant simple asks for a user name and password to read and control everything, no ClientID, UserID or Secret required? Thanks in advance but I think I may have to admit defeat :(

  • @junlianger4047
    @junlianger4047 Год назад

    hi, is there a way to send HTTP request from Tuya cloud to update device status?

    • @magnusnelenius649
      @magnusnelenius649 10 месяцев назад

      I have the same question. It would be nice to get a status change without a periodic poll. Is that possible?

    • @notenoughtech
      @notenoughtech  10 месяцев назад

      I'm not aware of it as status changes are usually requests sent to the server.

  • @Daniel-gf5mw
    @Daniel-gf5mw 3 года назад +1

    Can it be controled using tasker?

    • @notenoughtech
      @notenoughtech  3 года назад

      Yes. Tasker has REST support so you can set a similar controls with tasker directly

    • @Daniel-gf5mw
      @Daniel-gf5mw 3 года назад

      @@notenoughtech nice!! Any chance for a tutorial video using tasker? Hahah btw, nice channel, thanks for the information 😁

    • @notenoughtech
      @notenoughtech  3 года назад

      Not in the near future I'm afraid. I'm swamped for now with stuff. I have some weather tasker tutorials it shows you how to do Rest

    • @Daniel-gf5mw
      @Daniel-gf5mw 3 года назад

      @@notenoughtech Ok, i understand. Thanks for ur attention. I will watch the videos and try it here. Thanks again!! :)

    • @notenoughtech
      @notenoughtech  3 года назад

      Good luck. For most part once you know how rest works in tasker ( it's similar) it's just copy and paste from the script or postman)

  • @Sergio-k4c
    @Sergio-k4c 2 месяца назад

    Hi, Thank you for your video it is very god.
    I would like to ask you if you did some special configuration on your Tuya cloud account because with mine almost any Api call get a message saying "No permissions"
    I've tried several things, in fact I can get the token via api but not any action with devices.
    I'm on FreeTrial but I think you were too.
    Any help will be appreciated

    • @notenoughtech
      @notenoughtech  2 месяца назад

      Permission issue may imply the configuration of your project isn't correct or key that you use isn't for the project selected

    • @Sergio-k4c
      @Sergio-k4c 2 месяца назад

      @@notenoughtech Thank you for your reply.
      It is solved now, apparently there is a delay between you activate your project and you can use the api.
      I was able to do it next day.

  • @BrianB2579
    @BrianB2579 3 года назад +1

    Tuya is worth $ 11 billion and trading huge amounts in order to grow ..... What does the word "Tuya" mean it's a name of rare and distinct volcano.

    • @notenoughtech
      @notenoughtech  3 года назад +1

      Cool trivia. I actually never looked up the word ;)

    • @yapanliu9608
      @yapanliu9608 3 года назад +1

      ​@@notenoughtech I believe the word "tuya" is translated from the Chinese word "涂鸦“ which means "Graffiti".

    • @notenoughtech
      @notenoughtech  3 года назад

      I'll have to take your word for it!

  • @ronm6585
    @ronm6585 3 года назад

    Thank you Mat. Great info.

  • @danielrath7952
    @danielrath7952 Год назад

    very useful video - thanks a lot

  • @ManiKandan-ic1wj
    @ManiKandan-ic1wj 8 месяцев назад

    I need a help regarding this

  • @rcarioca
    @rcarioca Год назад

    i haven't found the option to unlink a cloud project since you cannot delete it

  • @Cra1gst
    @Cra1gst 2 года назад

    how do i go about getting my user id ? i have client id from the project api but no where is user id ? through explorer api i get permission denied trying to get user list

    • @notenoughtech
      @notenoughtech  2 года назад +1

      User id should be available from the developer account under the cloud account link to your mobile device

    • @Cra1gst
      @Cra1gst 2 года назад

      @@notenoughtech oh great still get "Missing configuration, please check your algorithm or key." , dont it need secret in the config?

    • @notenoughtech
      @notenoughtech  2 года назад

      The authentication has changed and requires UUID to salt the request further I had a quick play few days ago bit it was a bit more complex than adding this up. Check the postman file available from their website this will point you into the right direction

    • @Cra1gst
      @Cra1gst 2 года назад

      @@notenoughtech well above me then , i have postman up and running ad set up and working , trying to just send a click on my finger bot but time tokens is a pain

    • @Cra1gst
      @Cra1gst 2 года назад

      @@notenoughtech and as we speak tuya openapi eu is offline :( so cant do anythink

  • @oznog4791
    @oznog4791 2 года назад

    Thank You, Thank You, Thank You,,,, :)

  • @pazzazzo
    @pazzazzo 2 года назад

    How Sign in header!!!??? 😭

  • @_nom_
    @_nom_ Год назад

    Pro-tip, reduce your resolution when you make a video. You should know this.

    • @notenoughtech
      @notenoughtech  Год назад

      Another pro-tip: code heavy tutorials are best when complemented by a written article that provide the same (if not more) information so you don't have to strain your eyes on your tiny mobile screen. You should know this

  • @rcarioca
    @rcarioca Год назад

    My devices do not show up.

    • @notenoughtech
      @notenoughtech  Год назад +1

      Any error messages? Make sure to query correct server TUYA app comes with different locations and your data is stored on the one selected by app. Pick your query modifier accordingly

    • @rcarioca
      @rcarioca Год назад

      @@notenoughtech I found the Region (USA/ Canada) on Smartlife app and I chose Eastern USA as the cloud server in Tuya IOT platform cloud when I created my cloud project. linked to my smartlife account.

    • @rcarioca
      @rcarioca Год назад

      @@notenoughtech ok the server is the west USA and not East USA ..

  • @yachitsinha2165
    @yachitsinha2165 2 года назад

    can you give source code for nodered ?

    • @notenoughtech
      @notenoughtech  2 года назад

      The node red flow is linked in the article

  • @user-mo4ul5td2p
    @user-mo4ul5td2p 2 года назад

    where did you get the json file in tuya that you fill in the import fonction of postman please ??? well found here :developer.tuya.com/en/docs/iot/set-up-postman-environment?id=Ka7o385w1svns

    • @notenoughtech
      @notenoughtech  2 года назад

      Yes tuya had it on ther dev page

    • @user-mo4ul5td2p
      @user-mo4ul5td2p 2 года назад

      @@notenoughtech i get some strange issue with the clouds... for token i get an error my ip is not in same region but i m in france and choose central europe should works... then i use a vpn to get the same country than server now i get token but many other POST request like user list or product details get me an "invalid permission" response strange it work good with embeded tuya call. in noticed the uid i get from token is not the same than the one use on tuya post request made on there IOT website.. so for now partial failed of use. I wanna get a monthly graph of my clim who use tuya protocol and dont know how to query it directly from my local network instead of tuya cloud who seem to be free only for 1 month....

    • @notenoughtech
      @notenoughtech  2 года назад

      The API key should be obtained and used until it's invalid. So In theory you do it once then use that to get the authentication details for each call.
      VPN would work ok if you are assigned to the same region. Cloud should not complain about it if the request uses correct authentication details against the correct account.
      Invalid permission suggests that your credentials are no longer valid, incorrect or you are authenticating against different account.

    • @user-mo4ul5td2p
      @user-mo4ul5td2p 2 года назад

      @@notenoughtech yes but not idea why credential a not valid because i get it by doing the get acces token {{url}}/v1.0/token?grant_type=1 first who give me the token and info well feeded in "postman env" and then use this env for get user list or get device info who failed