[solved] How to send MQTT topic w/o payload

Hello all,
I am searching for a solution to send only the topic without the payload.
Background: I have a Heos 1 Wifi speaker. it is connected to my homeautomation system FHEM. FHEM is able to publish ans subscibe MQTT messages.
This speaker starts to play on /cmnd/entertain/wz/heos1/play and stops on /cmnd/entertain/wz/heos1/stop
Both commands sendet by hand on the MQTT broker UI do very well.
How do i tell node red to send only the topic without any payload.

Best regards O.J.
(please excuse my weak english)

It is easy to remove the payload property from the msg object. A change node configured to delete the payload property would do the trick, but..

Doing a quick testing shows that the mqqt out node will send an empty string whenever msg.payload equals null or undefined

Therefore the question to be asked is : is it a problem for you to send an empty string as the payload ?

Yes just set msg.payload = “”; ie empty string and mqtt will do the right thing

Does it work if you send play or stop messages on the topic /cmnd/entertain/wz/heos ?

sorry, Im an absolute noob. how do i convert the msg.payload to “”

This forum has changed the normal double-quotes into smart quotes, making it in invalid.

Try this:

return msg;

You could also use a Change node to set msg.payload to an empty string.

found a better way:
I changed the payload type to "buffer" then in to the 3 points to change the content, but didnt change anything.
Injecting this gives an empty buffer (msg.payload : buffer[0])

Thank you all for your help