# Help with tuya-smart-device node

**URL:** <https://discourse.nodered.org/t/help-with-tuya-smart-device-node/62324>\
**Category:** General\
**Created:** [7 May 2022 08:23 UTC](https://discourse.nodered.org/t/help-with-tuya-smart-device-node/62324 "2022-05-07T08:23:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sirhc](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sirhc](https://discourse.nodered.org/u/Sirhc)\
**Post date:** [7 May 2022 08:23 UTC](https://discourse.nodered.org/t/help-with-tuya-smart-device-node/62324/1 "2022-05-07T08:23:53Z")

</div>

Hello

I have a WIFI switch that I'm controlling via the tuya-smart-device node successfully.

For my home automation setup, I have two independent instances of node red running on the one linux machine under two different user accounts.

The reason for this is that I want to have two dashboards for my home automation system, one for my phone and one for an ipad screen. The dashboard for the doesn't work well on the iphone.

I cannot get both instances of node red to connect to simultaneously to the one tuya device via the tuya-smart-device node. When I disconnect one, the other connects, but not both at the same time.

Can anyone think of a work around for this?

Thanks

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [7 May 2022 08:55 UTC](https://discourse.nodered.org/t/help-with-tuya-smart-device-node/62324/2 "2022-05-07T08:55:14Z")

</div>

I **think** you are trying to use the node the wrong way. Sorry.

You should make the _dashboards_ for each person and then send the status from both of those bigger parts to the one node.

Just a thought.

---

<div class="post-metadata">

**Author:** ![Sirhc](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sirhc](https://discourse.nodered.org/u/Sirhc)\
**Post date:** [7 May 2022 09:02 UTC](https://discourse.nodered.org/t/help-with-tuya-smart-device-node/62324/3 "2022-05-07T09:02:46Z")

</div>

Sorry not sure that I follow.

I think the way around it is to use MQTT to connect to the switches. Does anyone have a go by on how to send MQTT commands to WIFI devices in node red?

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [7 May 2022 09:14 UTC](https://discourse.nodered.org/t/help-with-tuya-smart-device-node/62324/4 "2022-05-07T09:14:01Z")

</div>

If you read the tuya node help

> 1. Make sure that you haven't created multiple nodes for the same device. Multiple connections to the same device is not possible. This is a limitation of TuyAPI.

You will need to pick one node-red and have that connect to the tuya api. The other node-red instance will have to send its commands via first node-red, using http/mqtt/or other protocol.

---

<div class="post-metadata">

**Author:** ![Sirhc](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sirhc](https://discourse.nodered.org/u/Sirhc)\
**Post date:** [7 May 2022 09:18 UTC](https://discourse.nodered.org/t/help-with-tuya-smart-device-node/62324/5 "2022-05-07T09:18:51Z")

</div>

> [@E1cid](#):
>
> http/mqtt/or other protocol.

Yeah I realized that after I posted. That might be a good work around, otherwise I'm trying to work out how to connect to these devices via straight MQTT, but not sure if that's possible :\

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [7 May 2022 09:36 UTC](https://discourse.nodered.org/t/help-with-tuya-smart-device-node/62324/6 "2022-05-07T09:36:10Z")

</div>

You say you have 2 of the same tuya node to control the one device.

As pointed out: you can't do that.

So my suggestion is that you change the two existing flows and where each talks to their own tuya node: delete one and connect it's inputs to the other one's input.

---

<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:** [7 May 2022 22:17 UTC](https://discourse.nodered.org/t/help-with-tuya-smart-device-node/62324/7 "2022-05-07T22:17:38Z")

</div>

I use the Tuya nodes and I connect them to other Node- Red instances using MQTT. MQTT in to get status and issue commands and MQTT out to let the rest of the system know the state of the device. The nodes shown below will obviously not work for you but hopefully they will give you some ideas

```auto
[{"id":"35200d76f4989e92","type":"mqtt in","z":"4eb208f14551dccd","name":"Tuya Study Light Status","topic":"tuya2mqtt/+/device_status/Smart Bulb 04/get_status","qos":"2","datatype":"json","broker":"ee05e0d9.9118e","nl":false,"rap":true,"rh":0,"inputs":0,"x":120,"y":80,"wires":[["64ea03241ef78d14","a59e34a1af1414ca"]]},{"id":"1197417772aa19fb","type":"debug","z":"4eb208f14551dccd","name":"Tuya Port 1","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":730,"y":20,"wires":[]},{"id":"e2ea327cae523e02","type":"mqtt out","z":"4eb208f14551dccd","name":"Tuya Study Light Status","topic":"tuya2mqtt/NRTDO/device_status/Smart Bulb 04/status","qos":"1","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"ee05e0d9.9118e","x":770,"y":60,"wires":[],"info":"tuya/NRTDO/device_state/smart_bulb_04/state"},{"id":"0524560abd4e2643","type":"debug","z":"4eb208f14551dccd","name":"Tuya Port 2","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":730,"y":120,"wires":[]},{"id":"d84d25b0b9f3c2e7","type":"mqtt in","z":"4eb208f14551dccd","name":"Tuya Study Light Control","topic":"tuya2mqtt/+/device_control/Smart Bulb 04/command","qos":"2","datatype":"json","broker":"ee05e0d9.9118e","nl":false,"rap":true,"rh":0,"inputs":0,"x":130,"y":40,"wires":[["64ea03241ef78d14","a59e34a1af1414ca"]],"info":"tuya/NRDCO/device_control/smart_bulb_04/command\r\ntuya/+/device_control/smart_bulb_04/command"},{"id":"a59e34a1af1414ca","type":"debug","z":"4eb208f14551dccd","name":"MQTT In","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":440,"y":40,"wires":[]},{"id":"64ea03241ef78d14","type":"tuya-smart-device","z":"4eb208f14551dccd","deviceName":"Smart Bulb 04","disableAutoStart":false,"deviceId":"bfed04c9d469db879doe2y","deviceKey":"20120ede82e21064","deviceIp":"","retryTimeout":1000,"findTimeout":1000,"tuyaVersion":"3.1","eventMode":"event-both","x":460,"y":80,"wires":[["e2ea327cae523e02","1197417772aa19fb"],["0524560abd4e2643"]]},{"id":"ee05e0d9.9118e","type":"mqtt-broker","name":"MQTT","broker":"192.168.1.21","port":"1883","clientid":"","autoConnect":true,"usetls":false,"compatmode":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]

```

---

<div class="post-metadata">

**Author:** ![mikey](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@mikey](https://discourse.nodered.org/u/mikey)\
**Post date:** [7 May 2022 23:43 UTC](https://discourse.nodered.org/t/help-with-tuya-smart-device-node/62324/8 "2022-05-07T23:43:10Z")

</div>

Set up home assistant

Integrate tuya smart

Link it to your node thru that api is easiest way I’ve found to use it.

Plus the dashboards are way cleaner!

---

<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:** [6 July 2022 23:43 UTC](https://discourse.nodered.org/t/help-with-tuya-smart-device-node/62324/9 "2022-07-06T23:43:27Z")

</div>

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