-
Notifications
You must be signed in to change notification settings - Fork 128
Connect to OpenClaw
Whisplay Chatbot now support IM mode. After setting LLM_SERVER to "whisplay-im", you can use the chatbot as an IM client to connect to OpenClaw.
Whisplay IM acts as a channel for OpenClaw. You can use the chatbot to send messages to OpenClaw and receive responses from OpenClaw. This allows you to interact with OpenClaw using the chatbot interface, making it more convenient to use in various scenarios.
.env file settings:
LLM_SERVER=whisplay-im
## Whisplay IM bridge (use OpenClaw as IM backend)
# WHISPLAY_IM_BRIDGE_HOST=127.0.0.1
# WHISPLAY_IM_BRIDGE_PORT=18888
# WHISPLAY_IM_INBOX_PATH=/whisplay-im/inbox
# WHISPLAY_IM_POLL_PATH=/whisplay-im/poll
# WHISPLAY_IM_SEND_PATH=/whisplay-im/send
# WHISPLAY_IM_TOKEN=define_by_yourself_and_configure_in_openclaw
# WHISPLAY_IM_TIMEOUT_MS=30000Normally, you only need to set the LLM_SERVER to whisplay-im and configure the WHISPLAY_IM_TOKEN. The other parameters have default values that should work in most cases. Make sure to set the same token in both the chatbot configuration and OpenClaw configuration for them to communicate successfully.
You can use the following command to test the connection between the chatbot and OpenClaw by sending a test message. Replace <token> with the actual token you set in the configuration, and <device-host> with the IP address or hostname of the machine running the chatbot.
curl -X POST \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"reply":"Hello from OpenClaw","emoji":"🦞"}' \
http://<device-host>:18888/whisplay-im/sendClone the whisplay-im-openclaw-plugin for OpenClaw:
cd
git clone https://github.com/PiSugar/whisplay-im-openclaw-pluginInstall the plugin following the instructions in the plugin repository. You will need to set the same token(credential) in the plugin configuration as you set in the chatbot configuration.
In OpenClaw, you can create a new channel that uses the Whisplay IM plugin. Set the channel type to "Whisplay IM" and configure the necessary parameters.
- Host(Ip): <CHATBOT_IP_ADDRESS>:18888 (replace <CHATBOT_IP_ADDRESS> with the actual IP address of the machine running the chatbot)
- Credential(Token): the same credential you set in the chatbot configuration, optional but recommended for security
- Id: a unique identifier for the channel, can be any string. This will display in the OpenClaw's chat page.
After setting up the channel, you can start sending messages from OpenClaw to the chatbot and receive responses. Try talking to OpenClaw using the chatbot device, and check the OpenClaw's log to see the incoming messages and responses.
In the chatbot log, you should see the poll requests from OpenClaw. If you don't see any poll requests, check the network connectivity between the chatbot and OpenClaw, and make sure the plugin is installed and configured correctly in OpenClaw.
If you open the OpenClaw Control UI directly through the Raspberry Pi LAN address, the browser may show this error:
control ui requires device identity (use HTTPS or localhost secure context)
This happens because the Control UI requires a secure browser context for device identity. http://192.168.x.x:18789 is not treated as a secure context by the browser. The simplest fix is to access the Control UI through an SSH tunnel so the browser uses localhost.
Create the tunnel on your local machine:
ssh -N -L 18789:127.0.0.1:18789 pi@<OPENCLAW_HOST>Example:
ssh -N -L 18789:127.0.0.1:18789 pi@192.168.100.158Then open the Control UI in your local browser:
http://127.0.0.1:18789/
Notes:
- Keep the SSH tunnel process running while using the Control UI.
- If port
18789is already in use on your local machine, choose another local port, for example:
ssh -N -L 28789:127.0.0.1:18789 pi@192.168.100.158Then open:
http://127.0.0.1:28789/
- If the UI asks for authentication, use the OpenClaw gateway token configured on the Raspberry Pi.
- You can read the current OpenClaw gateway token on the Raspberry Pi with:
ssh pi@192.168.100.158 'python3 - <<"PY"
import json, pathlib
obj = json.loads(pathlib.Path("/home/pi/.openclaw/openclaw.json").read_text())
print(obj.get("gateway", {}).get("auth", {}).get("token", ""))
PY'- The token is stored in
~/.openclaw/openclaw.jsonundergateway.auth.token. - If you want to use the LAN address directly in the browser instead of an SSH tunnel, you must put the Control UI behind HTTPS.