How to Click push button send value to mqtt

I have two problems

1.How to save temperature and humidity values ​​to a CSV file? by splitting into two files Each file provides temperature/humidity and time values.
I get the values ​​from MQTT.

CSV File no.1 = Timestemp / Temperature
CSV File no.2 = Timestemp / Humidity

2.Get temperature value from MQTT and displays it in the gauge. and when the button is pressed it will send the temperature value to another MQTT topic

Sorry if my English is not good.

Your topic description and details are confusing but let me see if I can help.

How to Click push button send value to mqtt

Connect a ui-button node to a change node. In the change node, move your value (from where ever it is stored) to msg.payload. Connect the change node to a mqtt-out node and configure it with a ‘topic’ and the broker you will use. Now when you press the button on the dashboard, the msg will be sent to the broker.

I would try to answer your question about the csv file but you say you are going to save both temperature, humidity and time but then show an example where each file only has one of the data items. Which is it?

Take a look at the write file node and csv nodes and read the Help tab for each one.

I recommend watching this playlist: Node-RED Essentials. 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.

1 Like

Thank you very much, I am doing what you suggested.

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