Skip to content

funscript-gateway v0.1.8

Choose a tag to compare

@github-actions github-actions released this 25 Apr 10:12
· 15 commits to main since this release

funscript-gateway — Release Notes


v0.1.8

What is funscript-gateway?

A Windows desktop bridge service that connects video players to smart home and IoT outputs using funscript haptic axis data.

Supported players: HereSphere (VR), MPC-HC
Supported outputs: Tasmota (HTTP), MQTT, WebSocket continuous value

When you play a video, the gateway reads the associated .funscript file, evaluates values in real time, and drives physical outputs — smart plugs, MQTT devices, or any WebSocket endpoint — based on configurable thresholds and mappings.


Input types

Seven input types are supported. Each produces a 0–100 value that any number of outputs can read from:

  • Funscript Axis — reads interpolated haptic values from a .funscript file at the current playback position
  • Restim — polls restim's HTTP status endpoint and evaluates playing state / volume conditions
  • AS5311 Magnetic Encoder — receives position data from the restim AS5311 encoder via WebSocket, maps a configurable window to 0–100
  • Tasmota — polls a Tasmota device's power state (OFF→0, ON→100)
  • Calculated (Logical) — combines inputs with AND / OR / XOR boolean logic
  • Calculated (Arithmetic) — weighted average of multiple inputs
  • Heart Rate (BLE) — connects to a BLE chest strap or compatible heart rate sensor via the standard GATT Heart Rate Profile, maps BPM to 0–100

Output types

  • Threshold → Tasmota (HTTP) — switches a Tasmota relay on/off based on a configurable threshold and hysteresis; optional pulse-mode keep-alive repeat
  • Threshold → MQTT — publishes ON/OFF payloads to any MQTT broker (Home Assistant, Mosquitto, Tasmota MQTT, etc.)
  • Value → WebSocket — sends a continuous numeric value to a WebSocket endpoint at a configurable interval; input 0–100 is linearly mapped to a configurable output range

Automation

  • Restim autostart — when playback begins, automatically starts any restim instances that are currently stopped

What's new since v0.1.5

Heart Rate (BLE) input

Direct BLE connection to any chest strap or compatible heart rate sensor implementing the Bluetooth SIG Heart Rate Profile (Polar H10, Wahoo TICKR, Garmin HRM, Coospo, and others). No third-party app or API required. BPM is mapped linearly to 0–100 using configurable min/max BPM bounds. The Inputs tab shows the live BPM reading. A Scan… button in the input dialog discovers nearby paired HR devices automatically. Retries on disconnect every 5 seconds.

Prerequisite: the device must be paired in Windows Bluetooth settings first.

WebSocket continuous-value output

A new output type (Value → WebSocket) that streams the input value as JSON to any WebSocket endpoint at a configurable interval (0.1–10 s). The input 0–100 range is linearly mapped to a configurable min/max output range:

output = min_output + (max_output − min_output) × input ÷ 100

The connection is maintained persistently and reconnected automatically on failure.

Primary use case — Heart Rate → restim pressure: configure the output with URL ws://localhost:12346/sensors/pressure, field name pressure, min output 100000, max output 110000. This drives restim's pressure effect in proportion to heart rate, using restim's default pressure threshold and range, with no additional middleware.

Bug fixes

  • Fixed WebSocket output dialog showing the wrong tab content when editing an existing ws_value output (the Threshold tab was being hidden but its content was still rendered; now disabled cleanly and the Driver tab is selected automatically)

Full Changelog: v0.1.7...v0.1.8