# Tasmota Switch node

**URL:** <https://discourse.nodered.org/t/tasmota-switch-node/84622>\
**Category:** Dashboard\
**Created:** [16 January 2024 20:52 UTC](https://discourse.nodered.org/t/tasmota-switch-node/84622 "2024-01-16T20:52:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kellerkind](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@Kellerkind](https://discourse.nodered.org/u/Kellerkind)\
**Post date:** [16 January 2024 20:52 UTC](https://discourse.nodered.org/t/tasmota-switch-node/84622/1 "2024-01-16T20:52:08Z")

</div>

Hello everyone,  
I need your help and I have a device with two switchable relays. I would like to switch the channels via 2 switches like in the, example "Tasmota Switch node" "[node-red-contrib-tasmota (node) - Node-RED](https://flows.nodered.org/node/node-red-contrib-tasmota)"

Does anyone have an example project? I would appreciate any help. Thanks.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/0/d09790b0610e099fcca5112d0528548992dded12.png)

My Version

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/e/4ee9cca78e1ca47c458d32447c89d51723302bc6.png)

Does anyone have an example project? I would appreciate any help. Thanks.

---

<div class="post-metadata">

**Author:** ![Kellerkind](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@Kellerkind](https://discourse.nodered.org/u/Kellerkind)\
**Post date:** [16 January 2024 20:52 UTC](https://discourse.nodered.org/t/tasmota-switch-node/84622/2 "2024-01-16T20:52:45Z")

</div>

![image (1)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/c/ec8f43b0dba94c18410bd362c6938133fe8db6d2.png)

 ![image (2)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/e/6e32152e4fce4c01af37887f802c56dc9c286e4c.png)

---

<div class="post-metadata">

**Author:** ![Kellerkind](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@Kellerkind](https://discourse.nodered.org/u/Kellerkind)\
**Post date:** [16 January 2024 20:53 UTC](https://discourse.nodered.org/t/tasmota-switch-node/84622/3 "2024-01-16T20:53:15Z")

</div>

![image (3)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/2/02b707856f3901e673245e8beb3126ccf70da1bd.png)

---

<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:** [16 January 2024 22:04 UTC](https://discourse.nodered.org/t/tasmota-switch-node/84622/4 "2024-01-16T22:04:19Z")

</div>

I do not use the tasmota node, but simple mqtt in and out nodes with several tasmota based plugs and other devices. So maybe I do not understand, what your problem is.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [16 January 2024 22:08 UTC](https://discourse.nodered.org/t/tasmota-switch-node/84622/5 "2024-01-16T22:08:05Z")

</div>

Hi @Kellerkind and welcome to the forum.

I use Node-red, I use Tasmota switches.

Tasmota is built around MQTT.  
To toggle switch 1 just publish a message to topic `cmnd/<device>/POWER1` with payload `TOGGLE` (or similar), where `<device>` is whatever you set as the topic in the Tasmota web console.  
You can control all aspects of the device from Node-red using MQTT, you can request status messages.  
There are hundreds of commands available, documented at [https://tasmota.github.io/docs/Commands/](https://tasmota.github.io/docs/Commands/)

Node-red has built-in MQTT publish and subscribe nodes, it even has it's own broker, Aedes (though mosquitto is better) so I have never understood what node-red-contrib-tasmota can contribute.

If the maintainer of the node is reading this, perhaps you can explain?

Here is a simple flow that turns a light on and off. The Tasmota MQTT config is like this  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/e/5e8bfc52fa039141abf8873106d016f9a60d0b6b.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/b/bb3b2ae0b3f676fa9622272a91f1868df3e48222.png)

```auto
[{"id":"3c49b4a6872e6aab","type":"mqtt out","z":"071230c942fdb8e9","name":"","topic":"","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"91cc30a194bcd3b5","x":590,"y":200,"wires":[]},{"id":"e9c2d5f117d9860d","type":"group","z":"071230c942fdb8e9","name":"First switch ON/OFF","style":{"label":true},"nodes":["e216363fd9a1e162","ef2ecb45a1f01815"],"x":34,"y":59,"w":332,"h":122},{"id":"e216363fd9a1e162","type":"inject","z":"071230c942fdb8e9","g":"e9c2d5f117d9860d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"cmnd/gosund/1/POWER1","payload":"ON","payloadType":"str","x":200,"y":100,"wires":[["3c49b4a6872e6aab"]]},{"id":"ef2ecb45a1f01815","type":"inject","z":"071230c942fdb8e9","g":"e9c2d5f117d9860d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"cmnd/gosund/1/POWER1","payload":"OFF","payloadType":"str","x":210,"y":140,"wires":[["3c49b4a6872e6aab"]]},{"id":"c5a76183bf96209c","type":"group","z":"071230c942fdb8e9","name":"Second switch TOGGLE","style":{"label":true},"nodes":["0e91ee3523850cf6"],"x":34,"y":199,"w":352,"h":82},{"id":"0e91ee3523850cf6","type":"inject","z":"071230c942fdb8e9","g":"c5a76183bf96209c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"cmnd/gosund/1/POWER2","payload":"TOGGLE","payloadType":"str","x":220,"y":240,"wires":[["3c49b4a6872e6aab"]]},{"id":"343a9db87c5392dc","type":"group","z":"071230c942fdb8e9","name":"Get results back","style":{"label":true},"nodes":["e59fdc3de33a9f94","2276d2094c871e23"],"x":34,"y":299,"w":472,"h":82},{"id":"e59fdc3de33a9f94","type":"mqtt in","z":"071230c942fdb8e9","g":"343a9db87c5392dc","name":"","topic":"stat/gosund/1/RESULT","qos":"2","datatype":"auto-detect","broker":"91cc30a194bcd3b5","nl":false,"rap":true,"rh":0,"inputs":0,"x":160,"y":340,"wires":[["2276d2094c871e23"]]},{"id":"2276d2094c871e23","type":"debug","z":"071230c942fdb8e9","g":"343a9db87c5392dc","name":"debug 12","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":400,"y":340,"wires":[]},{"id":"91cc30a194bcd3b5","type":"mqtt-broker","name":"Glasspi","broker":"192.168.1.11","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"autoUnsubscribe":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]

```

---

<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:** [15 February 2024 22:08 UTC](https://discourse.nodered.org/t/tasmota-switch-node/84622/6 "2024-02-15T22:08:37Z")

</div>

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