Lovensepy
Full-featured Python client for Lovense API. Supports LAN Game Mode, Cloud Server API, WebSocket (Socket API), and real-time Toy Events. Optimized for high performance and asynchronous automation
Install / Use
/learn @koval01/LovensepyREADME
LovensePy
LovensePy is a Python client for the Lovense developer APIs: Standard API over LAN (Game Mode) and cloud, Socket API (WebSocket, optional LAN command path), and Toy Events. Optional pieces include a Home Assistant MQTT bridge and direct BLE control.
Who it is for: developers building scripts, bots, dashboards, Home Assistant integrations, or experiments. Lovense’s official docs remain the source of truth for protocol behavior; this library wraps those flows in typed, tested Python.
Install
pip install lovensepy
Optional extras:
pip install 'lovensepy[mqtt]' # Home Assistant / MQTT bridge (paho-mqtt)
pip install 'lovensepy[ble]' # Direct BLE (bleak, pick for examples)
Minimal example (Game Mode)
from lovensepy import LANClient, Actions
client = LANClient("MyApp", "192.168.1.100", port=20011)
client.function_request({Actions.VIBRATE: 10}, time=3)
Enable Game Mode in Lovense Remote, use the app host’s IP, and pick the right port (e.g. 20011 for Remote, 34567 for Connect). Full setup, tutorials, and API tables are on GitHub Pages (or browse the docs folder in the repository).
For async/await code, AsyncLANClient, AsyncServerClient, BleDirectHub, and BleDirectClient all subclass LovenseAsyncControlClient: same control methods so you can switch transport by changing only construction. See Connection methods and the API reference.
How clients reach the toy
flowchart TB
subgraph yourCode [Your app]
LANClient
AsyncLANClient
ServerClient
AsyncServerClient
SocketAPIClient
ToyEventsClient
BleDirect[BleDirectClient / BleDirectHub]
HAMqttBridge
end
subgraph localNet [Local network]
RemoteApp[Lovense app]
Toy[Lovense toy]
MQTTBroker[MQTT broker]
end
subgraph cloudLayer [Lovense cloud]
LovenseServer[Lovense server]
end
LANClient -->|"HTTP/HTTPS"| RemoteApp
AsyncLANClient -->|"HTTP/HTTPS"| RemoteApp
RemoteApp --> Toy
ServerClient -->|"HTTPS"| LovenseServer
AsyncServerClient -->|"HTTPS"| LovenseServer
LovenseServer --> RemoteApp
SocketAPIClient -->|"WebSocket"| LovenseServer
SocketAPIClient -->|"HTTPS when use_local_commands"| RemoteApp
ToyEventsClient -->|"WebSocket"| RemoteApp
HAMqttBridge -->|"LAN: HTTP + Toy Events WS"| RemoteApp
HAMqttBridge -.->|"BLE mode: direct"| Toy
HAMqttBridge <-->|"MQTT"| MQTTBroker
BleDirect -.->|"BLE"| Toy
Documentation and official APIs
- Project docs (site): lovensepy.koval-dev.org — source: docs/index.en.md (Russian: index.ru.md)
- Lovense Standard API
- Lovense Socket API
- Toy Events API
Changelog
See CHANGELOG.md.
License
Apache License 2.0 — see LICENSE for full text.
Related Skills
canvas
341.0kCanvas Skill Display HTML content on connected OpenClaw nodes (Mac app, iOS, Android). Overview The canvas tool lets you present web content on any connected node's canvas view. Great for: -
gh-issues
341.0kFetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5] [--notify-channel -1002381931352]
imsg
341.0kiMessage/SMS CLI for listing chats, history, and sending messages via Messages.app.
oracle
341.0kBest practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
