vention-diverter-mqtt-bridge
An MQTT control bridge for Vention popup diverters. It wraps the published
vention-popup-diverter
fleet library and exposes it over a simple MQTT command protocol, so a
MachineLogic program (or any MQTT client) can drive a diverter by publishing a
message.
It's designed to embed in a MachineLogic Python snippet with one line — MachineLogic only runs one snippet at a time, so the bridge rides inside the snippet that's already running, in a background thread.
Use it from a MachineLogic snippet (one line)
Add the dep to your app's requirements.txt:
vention-diverter-mqtt-bridge
Then at the top of your snippet:
from diverter_bridge import run_in_background
run_in_background() # non-blocking; bridge now serving MQTT in the background
# ... your snippet logic continues unchanged ...
run_in_background() returns immediately (it starts a daemon thread) and uses
the bundled, calibrated config. Override anything from Python:
run_in_background(mode="mock") # bench test, no hardware
run_in_background(broker_host="127.0.0.1") # different broker
run_in_background(fleet=[ # different diverter / fleet
{"location_id": "zone-a", "host": "192.168.21.20",
"lift_speed": 600, "t_lower_from_rest": 0.5024},
])
run_in_background("config") # your own ./config/config.yaml
Precedence: bundled config < a config_dir you point at < keyword overrides.
The MQTT protocol
The command is the topic (empty payload). Replies on
<prefix>/<location>/result → ok or error: <reason>.
Full divert (one message, runs the whole sequence):
vention/diverter/<location>/divert/forward
vention/diverter/<location>/divert/backward
Granular (drive each step yourself):
vention/diverter/<location>/move/up
vention/diverter/<location>/move/down
vention/diverter/<location>/move/forward
vention/diverter/<location>/move/backward
vention/diverter/<location>/move/stop
Direction is forward/backward at both levels. divert/… = the bridge runs
the sequence; move/… = manual control. See
docs/adr/0002-mqtt-protocol.md.
Standalone (for local dev / testing)
just install # uv sync
just smoke # local broker + bridge (mock) + a test divert
just ci # ruff format + lint + pytest
python -m diverter_bridge # or: python main.py (uses bundled config)
DIVERTER_MODE=mock selects mock diverters; CONFIG_DIR points at an override
config dir.
Calibration
The bundled config ships values calibrated at lift speed 600 (t_lower_from_rest,
t_full_rev, t_high_range, down_dwell). Re-calibrate with the Feed's
calibrate_all_diverters.py at the operating speed and update the config —
calibration speed must equal run speed.
mmAI access
SSH keypair for controller serial 6020083 is in
.keypairs/mmai-6020083/ (gitignored). The mmAI's LAN
port reaches the diverter subnet (192.168.21.x); the diverter is at
192.168.21.20.
Docs
Living docs/ tree per the delivery standard — start at
docs/README.md.
Metadata
Release files for vention-diverter-mqtt-bridge 0.6.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vention_diverter_mqtt_bridge-0.6.2.tar.gz | 12.3 kB | Without provenance | Details for vention_diverter_mqtt_bridge-0.6.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vention_diverter_mqtt_bridge-0.6.2-py3-none-any.whl | Python 3 | none | any | Details for vention_diverter_mqtt_bridge-0.6.2-py3-none-any.whl |
Total release size: 25.3 kB
Release files / vention_diverter_mqtt_bridge-0.6.2.tar.gz
| Download URL | vention_diverter_mqtt_bridge-0.6.2.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cb98a67ed486d23c27ad777e1a065ea06ce28f39cfb84c5c769c34672eafe1b0
|
|
BLAKE2b-256 checksum How to use checksums |
7fbcf773a8db12620a5911e32c7c2b967d2d41614ad9ee8950b104ecc1375d00
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.33 {"installer":{"name":"uv","version":"0.11.33","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / vention_diverter_mqtt_bridge-0.6.2-py3-none-any.whl
| Download URL | vention_diverter_mqtt_bridge-0.6.2-py3-none-any.whl |
|---|---|
| Size | 13.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9d022c78bcbb8937d543a6a632aead4d0d8aa01f111c5dbfc1373ac2fcc33034
|
|
BLAKE2b-256 checksum How to use checksums |
d844b6aebb24ca9e187d8c820489d953f27269f29cbd12f1d399bc0a1ada0b73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.33 {"installer":{"name":"uv","version":"0.11.33","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for vention-diverter-mqtt-bridge 0.6.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.