# Help to Mqtt rules

**URL:** <https://discourse.nodered.org/t/help-to-mqtt-rules/66816>\
**Category:** General\
**Created:** [23 August 2022 13:49 UTC](https://discourse.nodered.org/t/help-to-mqtt-rules/66816 "2022-08-23T13:49:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JY21](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@JY21](https://discourse.nodered.org/u/JY21)\
**Post date:** [23 August 2022 13:49 UTC](https://discourse.nodered.org/t/help-to-mqtt-rules/66816/1 "2022-08-23T13:49:35Z")

</div>

Hi,  
I just discover nod-red, and I would like to pick up a value from my domoticz server and send to espeasy with a new Mqtt topic. Can anybody help me ?

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

I would like now to send the reading of svalue5 to a new Mqtt topic "power" but I don't find how to do it.  
Thanks for your help

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [23 August 2022 13:58 UTC](https://discourse.nodered.org/t/help-to-mqtt-rules/66816/2 "2022-08-23T13:58:24Z")

</div>

> [@JY21](#):
>
> I would like now to send the reading of svalue5 to a new Mqtt topic "power"

1. Connect a `change` node to the output of MQTT IN node
  1. Set `msg.payload` to `msg.payload.svalue5`
  2. Set `msg.topic` to `power`

2. Connect an MQTT out node to the new `change` node

> [@JY21](#):
>
> I just discover nod-red

The task you are doing is very basic knowledge of node-red, I recommend watching this playlist: [Node-RED Essentials](https://www.youtube.com/playlist?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6). The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

---

<div class="post-metadata">

**Author:** ![JY21](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@JY21](https://discourse.nodered.org/u/JY21)\
**Post date:** [24 August 2022 08:37 UTC](https://discourse.nodered.org/t/help-to-mqtt-rules/66816/3 "2022-08-24T08:37:56Z")

</div>

Thanks, it works, but I need also add a node to change only this specific publication.  
Maybe filter on name" Teleinfo kWh Total" or idx:59

I tried to add a switch between Mqtt in and the change node but I donn't know how to set it up.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [24 August 2022 08:42 UTC](https://discourse.nodered.org/t/help-to-mqtt-rules/66816/4 "2022-08-24T08:42:22Z")

</div>

> [@JY21](#):
>
> I tried to add a switch between Mqtt in and the change node but I donn't know how to set it up

Honestly, this is very basic beginners stuff. You really should spend some time learning node-red.

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

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

---

<div class="post-metadata">

**Author:** ![JY21](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@JY21](https://discourse.nodered.org/u/JY21)\
**Post date:** [24 August 2022 11:38 UTC](https://discourse.nodered.org/t/help-to-mqtt-rules/66816/5 "2022-08-24T11:38:46Z")

</div>

Thank you, works fine !

Have a nice day

---

<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:** [23 October 2022 11:39 UTC](https://discourse.nodered.org/t/help-to-mqtt-rules/66816/6 "2022-10-23T11:39:22Z")

</div>

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