# MQTT switch on/off

**URL:** https://discourse.nodered.org/t/mqtt-switch-on-off/58384
**Category:** General
**Created:** [15 February 2022 13:09 UTC](https://discourse.nodered.org/t/mqtt-switch-on-off/58384 "2022-02-15T13:09:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Milanovic](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Milanovic](https://discourse.nodered.org/u/Milanovic)
#### Post date: [15 February 2022 13:09 UTC](https://discourse.nodered.org/t/mqtt-switch-on-off/58384/1 "2022-02-15T13:09:50Z")

</div>

Hi,

I am reading some data out of the MQTT server, but now I want to switch a smart device with node-red.

How can I do that? Which nodes do we need?

---

<div class="post-metadata">

### Author: ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)
#### Post date: [15 February 2022 13:46 UTC](https://discourse.nodered.org/t/mqtt-switch-on-off/58384/2 "2022-02-15T13:46:55Z")

</div>

Assuming you are using the MQTT-in to subscribe to messages from the broker

Then you would use the MQTT-out node to publish messages

---

<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: [16 April 2022 13:47 UTC](https://discourse.nodered.org/t/mqtt-switch-on-off/58384/3 "2022-04-16T13:47:10Z")

</div>

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