# Tuya devices and MQTT

**URL:** https://discourse.nodered.org/t/tuya-devices-and-mqtt/83867
**Category:** General
**Created:** [20 December 2023 11:02 UTC](https://discourse.nodered.org/t/tuya-devices-and-mqtt/83867 "2023-12-20T11:02:00Z")
**Posts on this page:** 6
**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: [20 December 2023 11:02 UTC](https://discourse.nodered.org/t/tuya-devices-and-mqtt/83867/1 "2023-12-20T11:02:00Z")

</div>

Hello

I have a few WIFI switches on my nodered system. They all communicate using node-red-contrib-tuya-local and it's working fine.

Just wondering, is there a way to communicate with them directly using an MQTT node? I am not quite sure how that tuya node is broadcasting to the devices in order to control them.

---

<div class="post-metadata">

### Author: ![stefan24](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stefan24/32/23075_2.png) [@stefan24](https://discourse.nodered.org/u/stefan24)
#### Post date: [20 December 2023 21:05 UTC](https://discourse.nodered.org/t/tuya-devices-and-mqtt/83867/2 "2023-12-20T21:05:45Z")

</div>

Maybe they still can be hacked with tasmota OTA? My gosund, Avatar and maxcio switches are 2-3 years old and all flashed with tasmota now. Full MQTT support and no cloud anymore

---

<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: [21 December 2023 00:34 UTC](https://discourse.nodered.org/t/tuya-devices-and-mqtt/83867/3 "2023-12-21T00:34:44Z")

</div>

The node is not going via cloud. It's communicating directly with the local IP address of the device via nodered. It must be doing it via mqtt some how.

---

<div class="post-metadata">

### Author: ![stefan24](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stefan24/32/23075_2.png) [@stefan24](https://discourse.nodered.org/u/stefan24)
#### Post date: [21 December 2023 13:42 UTC](https://discourse.nodered.org/t/tuya-devices-and-mqtt/83867/4 "2023-12-21T13:42:41Z")

</div>

I doubt, that the Node-RED node uses MQTT, but could indeed communicate directly and locally with the devices.  
Nevertheless, the Tuya devices themselves are still sending their data to the cloud.  
So my advice is still Tasmota. Try [GitHub - ct-Open-Source/tuya-convert: A collection of scripts to flash Tuya IoT devices to alternative firmwares](https://github.com/ct-Open-Source/tuya-convert)

---

<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 December 2023 20:08 UTC](https://discourse.nodered.org/t/tuya-devices-and-mqtt/83867/5 "2023-12-21T20:08:11Z")

</div>

While I agree going via the Tuya cloud is not ideal I have used these nodes for a few years and never had a problem. There are too many caveats in the How to Do It notes for me to want to flash to Tasmota so I am going to stick with the Tuya nodes until my devices fail and then replace them with zigbee units.

---

<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: [19 February 2024 20:08 UTC](https://discourse.nodered.org/t/tuya-devices-and-mqtt/83867/6 "2024-02-19T20:08:27Z")

</div>

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