TuyaDAEMON
A generic IOT framework, open for all user node-red devices and for any advanced custom logic, with some unique features: rich in interfaces (MQTT, REST, DB), OO oriented plus the ability to integrate ALL Tuya devices without hacking.
Install / Use
/learn @msillano/TuyaDAEMONREADME
TuyaDAEMON's primary objective is not merely controlling some devices or providing a unique user interface. Instead, it focuses on seamlessly integrating the entire Tuya ecosystem into node-red, thereby establishing a new level of abstraction encompassing the Tuya cloud, any IOT device of every brand, any custom device, REST, MQTT, DB, and extended automation logic. TuyaDAEMON serves as an open framework for advanced custom IoT development.
Tuya ecosystem:(source Tuya)

TuyaDAEMON is a powerful and versatile IoT development framework that can be used to create a wide variety of projects. It is easy to use for beginners, but also has powerful features that appeal to experienced developers.
Advanced features that make tuyaDAEMON unique
TuyaDAEMON has some unique features that make it stand out from the competition. These features include:
- Open, modular, full documented: expressly designed for every customization need.
- TuyaDAEMON is borns to work with any Tuya device without hacking, but it is also open to all devices, custom or from other firms. This makes it a more flexible framework than some of its competitors (see 'study cases' on wiki).
- ObjectOriented approach that makes it easy to create complex projects.
- Powerful control meta-language (command chains) with an expressive power (Turing complete) not found in other IOT environments, usually limited to "IF ... THEN" automation (see also here).
- Meta-tools for device test, maintenance, and documentation activities.
- Applications and programmer's notes repository.
If you are looking for an IoT development framework that is powerful, versatile, and easy to use, then TuyaDAEMON is a good option to consider.
All the details of the communication with devices are resolved by tuyaDAEMON, using 4 bidirectional communication channels transparently to the user:
LOW LEVEL MQTT (see tuya DEAMON core + CORE_devices)
Using node-red-contrib-tuya-smart-device you can exchange local MQTT communications with many Tuya devices. You receive notifications of device status changes regardless of the cause: Tuya-cloud, smartlife app, or voice control. And vice versa, the commands sent by tuyaDAEMON are executed by the devices, and all the app interfaces are kept updated in real-time.
HIGH LEVEL TRIGGER (see tuyaTRIGGER + MIRROR_devices)
The TRIGGERs do not connect to individual devices, but create a direct and bidirectional connection with Tuya-cloud events and 'automation', allowing complete control from anywhere of both the smartlife logic and the devices not handled by LOW-LEVEL MQTT channel. In the cases where a device relies on cloud servers (see Tuya info) user can define 'mirror' devices: see 'Smoke detector' case-study) to access the features of the device.
Example: Using a “Smart Home Infrared Universal Remote Controller” device you have replicas of the various remote controls on your smartphone, even better than those I had developed in 2016 (see remoteDB). Very well: thanks to Tuya I can now control 2 televisions, a monitor, an air conditioner, a DVB tuner, and a TV top box from my smartphone! There are some limitations: voice commands cannot be used, moreover, since the device does not use the MQTT protocol, it cannot be controlled at the LOW LEVEL. However, Tuya-cloud resources can be used to create a 'scene' with the sequence of commands needed to tune a TV channel, e.g. "Rai 3 HD", on the living room television. As the icon, I will use the RAI3 logo, as the name: 'tune RAI three'. Now I can use the voice command: "Hey Google, run tune Rai three"! A "mirror" device standardizes this behavior in tuyaDEAMON, using TRIGGERS to execute commands. I can now create Node-RED automation, which, if I am at home, automatically turns on the television and tunes in RAI 3 when my favorite TV series is on the air!
tuyastatus: object
living.tv: object
tvchannel: "RAI3 HD"
comment: "available: 'RAI1 HD’,’RAI2 HD’,’RAI3 HD’..."
LOW LEVEL OpenAPI (see device core_OPENAPI)
Since Ver 2.2.4, this new optional communication channel for Tuya Cloud can be used only in essential cases, to minimize the TuyaDAEMON's dependences on the evolution and strategy of Tuya Cloud. Doing complete access at all APIs, via REST, can be used for reading the device's status, for sending instructions to devices, and for accessing some non-basic aspects of device control (e.g., spaces (home), groups, automation) not manageable via TRIGGER + Automation.
CUSTOM CHANNEL (see system and 'fake' devices)
Simple node-red flows constitute the interfaces to HD and SW resources, allowing the insertion of external devices, not Tuya-compatible, into the system. A very useful two-tier model, consisting of a first-level represented by tuyaDAEMON processor, which standardizes the various sources and devices, to provide all data and commands in a homogeneous way to the higher application level (see TuyaDAEMON application model).
Custom channels are implemented additively with specialized flows, to implement 'fake' devices.
In many cases, the required interface is a simple protocol adapter, like in case of MQTT devices or in case of PM detector, a device that uses USB-COM interface.
In the case of the '433 MHZ sensor gateway', the module includes a specialized adapter for each device, such as the weather station which uses 3 sensors (temperature, wind, rain).
Since version 2.0 the generalized OO perspective, in a distributed environement, adds more power to tuyaDAEMON. It is easy to finalize the tuyaDAEMON resources in integrated projects, OO-oriented, with UI and many base devices: see as an example the device watering_sys, a terrace watering timer with UI, fuzzy control from wheater, build using 3 tuya devices.
From version 2.0 tuyaDAEMON is a complete framework for advanced custom IOT projects.
node-red interfaces
TuyaDAEMON has a high-level interface for custom node-red logic and applications: in reading, the data of all devices are available in an RT updated global object (´tuyastatus´), with a device:capability:value hierarchy and names were chosen by the user. Example:
tuyastatus: object
humidifier: object
_connected: true
spray: "OFF"
output: "small"
In writing, the commands for state change requests to all devices take the form of a node-red message:
payload: object
device: "humidifier"
property: "spray"
value: "ON"
REST interfaces
To make easier the interoperability with external applications, tuyaDEAMON offers also (Since ver. 2.0) a fast REST asynchronous interface with an immediate JSON response: Examples:
- SET:
http://localhost:1984/tuyaDAEMON?device=tuya_bridge&property=relay&value=OFF- answer:
{"device":"tuya_bridge","property":"switch","status":"sent"}
- answer:
- GET:
http://localhost:1984/tuyaDAEMON?device=tuya_bridge&property=relay- answer:
{"device":"tuya_bridge","property":"relay","value":"ON"}
- answer:
- SCHEMA:
http://localhost:1984/tuyaDAEMON?device=tuya_bridge.- answer:
{"device":"tuya_bridge","schema":{"_connected":true,"_t":1616865119,"trigger (reserved)":0,"relay":"ON","restart status":"memory"}}
- answer:
- LIST devices:
http://localhost:1984/tuyaDAEMON.- answer:
{"list":["Zigbee Gateway","Smart IR 1","HAL@home","BLE MESH(SIG)Gateway","tuya_bridge","Temperature living", "Door sensor","USB siren","PIR sensor"]}
- answer:
- ERROR:
{"status":"ERROR: not found the property (switch) in 'tuya_bridge'"} - ERROR:
{"status":"ERROR: not found the device 'tuya_trigger'"}
note: all devices accept 'GET' and 'SCHEMA' requests via fast REST: the data comes from the 'global.tuyastatus' structure.
A second debug REST interface is synchronous and dedicated to development appl
Security Score
Audited on Aug 9, 2025
