# Using node-red-contrib-tuya-smart-device how to do a GET query?

**URL:** <https://discourse.nodered.org/t/using-node-red-contrib-tuya-smart-device-how-to-do-a-get-query/65427>\
**Category:** General\
**Created:** [21 July 2022 15:41 UTC](https://discourse.nodered.org/t/using-node-red-contrib-tuya-smart-device-how-to-do-a-get-query/65427 "2022-07-21T15:41:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)\
**Post date:** [21 July 2022 15:41 UTC](https://discourse.nodered.org/t/using-node-red-contrib-tuya-smart-device-how-to-do-a-get-query/65427/1 "2022-07-21T15:41:22Z")

</div>

I am using the following nodes...  
[https://github.com/vinodsr/node-red-contrib-tuya-smart-device](https://github.com/vinodsr/node-red-contrib-tuya-smart-device)

And I can't seem to get a 'GET' query to work, the way I read the TUYA API the following should work...

```auto
msg.payload={
    get: {}
    dps:1
}

```

The following works for a 'SET' command...

```auto
msg.payload={
    set: true
    dps:1
}

```

Since the nodes available can't see to query the state of the Smart IoT device, but 'GET' command is referenced, with no example of GET use at all unfortunately, just a link to the TUYA API, which just says a GET query with empty options '{}' should return all the information available for the device in question.

---

<div class="post-metadata">

**Author:** ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)\
**Post date:** [21 July 2022 17:28 UTC](https://discourse.nodered.org/t/using-node-red-contrib-tuya-smart-device-how-to-do-a-get-query/65427/2 "2022-07-21T17:28:43Z")

</div>

`msg.payload = {operation: 'GET', dps: 1}`

---

<div class="post-metadata">

**Author:** ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)\
**Post date:** [22 July 2022 00:12 UTC](https://discourse.nodered.org/t/using-node-red-contrib-tuya-smart-device-how-to-do-a-get-query/65427/3 "2022-07-22T00:12:28Z")

</div>

Thanks! I finally figured out what I was reading into it... I was trying to transpose TUYA API javascript to NR.... not good. LOL!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [5 August 2022 00:12 UTC](https://discourse.nodered.org/t/using-node-red-contrib-tuya-smart-device-how-to-do-a-get-query/65427/4 "2022-08-05T00:12:51Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
