Publish MQTT Message
emqx_publishPublish MQTT messages to control devices or update Home Assistant entities. Set QoS, retain, and payload encoding to match your device requirements.
Instructions
Publish a single MQTT message through the broker.
This is how you drive a device or feed a Home Assistant MQTT entity. Publishing to a topic nobody subscribes to succeeds silently — check emqx_list_subscriptions if nothing reacts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| qos | No | MQTT QoS: 0, 1 or 2. | |
| topic | Yes | Target topic, e.g. 'woow/test/switch/state'. Wildcards (+ and #) are not allowed when publishing. | |
| retain | No | Keep this as the topic's retained message, so new subscribers receive it on connect. | |
| payload | Yes | Message body, encoded per `payload_encoding`. | |
| payload_encoding | No | Use base64 for binary payloads. | plain |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||