acquire_throttle
Acquire control of a locomotive by DCC address and get its current speed and direction. Optionally specify a command station prefix for multi-system layouts.
Instructions
Acquire control of a locomotive by its DCC address, and report its current state.
Args: address: The locomotive's DCC address. prefix: Optional command station prefix (e.g. "O", "Z", "R") to target when more than one DCC system is connected. Omit to use JMRI's default command station.
You usually do NOT need to call this explicitly before set_speed/
stop/emergency_stop — those acquire the throttle automatically on
first use for a smoother voice UX ("speed up the 3" just works).
Call acquire_throttle directly when you specifically want to know a
loco's current speed/direction before deciding what to do (the
acquire reply reports both), or to target a non-default command
station via prefix.
Safe to call again on an address already acquired by this session — JMRI just re-confirms it, it does not error or reset the loco. Release with release_throttle when done, though it's not required: JMRI releases every throttle this session holds automatically if the MCP server disconnects.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prefix | No | ||
| address | Yes |