Skip to content

Send WebSocket Message

  • Action
  • Web
  • Advanced mode

Sends a text message to a WebSocket server, e.g. Streamer.bot, Home Assistant or a chat service, and can wait for its reply. Uses the connection a WebSocket Message trigger already keeps open to the same address, otherwise connects for this step and closes again.

In the editor, press Space on the canvas to add a step, then open Actions > Web, or type its name. In Simple mode it's under Show all, and search finds it.

Settings

URL

A web address Required

The server's WebSocket address, e.g. ws://192.168.1.20:8080/ or wss://example.com/socket. An address that holds a token belongs in Password mode.

Starts as: empty Takes ${variables} and expressions Can come from another step's output

Message

Text

The text sent, often JSON. ${variables} are filled in.

Starts as: empty Takes ${variables} and expressions Can come from another step's output

Wait for a reply

On or off

On: continues once the server sends a message back (or the time limit passes).

Starts as: Off Can come from another step's output

Reply must contain

Text

Only a reply holding this text counts, e.g. the request's id. Empty: the next message.

Starts as: empty Takes ${variables} and expressions Can come from another step's output

Authorization

Text

Sent as the Authorization header, e.g. Bearer and the token. Stored as a password.

Starts as: empty Takes ${variables} and expressions Can come from another step's output Starts as a password

Headers

Text More options

One per line, e.g. Origin: https://example.com

Starts as: empty Takes ${variables} and expressions Can come from another step's output

Time limit (ms)

A duration More options

For connecting, sending and the reply. 0 waits as long as it takes.

Starts as: 10000 Can come from another step's output

Where it continues

  • Success: Continues here when the answer has a 2xx status.
  • Failed: Continues here when it fails; the reason is in the run log.

Outputs

Values the step gives to the steps after it. In the Graph view, drag a wire from an output to another step's field.

Send WebSocket Message outputs
OutputGivesWhat it is
ReplyTextThe reply's text; empty without Wait for a reply.
ErrorTextWhy it failed; empty when it worked.

Good to know

  • Fields marked as passwords keep their value in the Windows password vault, never in the macro.

More in Web