Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to send an empty payload #188

Closed
henriksvensson opened this issue Feb 6, 2021 · 2 comments
Closed

Add possibility to send an empty payload #188

henriksvensson opened this issue Feb 6, 2021 · 2 comments

Comments

@henriksvensson
Copy link

Problem or use case

I'm using mqtt-cli to communicate with a device running the Tasmota firmware. One feature of Tasmota is the ability to request a status update by sending an empty message to a command topic, see Tasmota MQTT documentation.

From what I understand of mqtt-cli, it is not possible to send and empty payload to a topic, though it seems supported by MQTT brokers. It would be great to be able to do this!

Preferred solution or suggestions

Maybe the most straight-forward solution would be to let the -m parameter on the pub command be optional and send an empty payload if not set. Another option could be to add another parameter --no-message or similar to make it explicit that this is actually what the user wishes to do.

Thanks for a great tool!

@gitseti
Copy link
Contributor

gitseti commented Feb 6, 2021

Hi @henriksvensson & thank you for your request! :)

Have you tried mqtt pub -t topic -m "" -h <your-broker-address>?

@henriksvensson
Copy link
Author

Hi @gitseti and thanks for a quick reply! I did try it and failed yesterday, but when I ran it again just know it works as expected. My bad, PEBKAC =).

Thanks again for a great tool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants