Skip to main content

Python API and CLI for controlling Jackery portable power stations

Project description

socketry

CI Python

Python API and CLI for controlling Jackery portable power stations.

Reverse-engineered from the Jackery Android APK (v1.0.7) and iOS app (v1.2.0). Communicates via Jackery's cloud MQTT broker and HTTP API — no modifications to the device or its firmware.

Quick start

uvx --from git+https://github.com/jlopez/socketry socketry login --email you@example.com --password 'yourpass'
uvx --from git+https://github.com/jlopez/socketry socketry get

Or install it once and use socketry directly:

uv tool install git+https://github.com/jlopez/socketry
socketry login --email you@example.com --password 'yourpass'
socketry get

Supported devices

All 10 models in the current Jackery app share the same protocol:

Model Code
Explorer 3000 Pro 1
Explorer 2000 Plus 2
Explorer 300 Plus 4
Explorer 1000 Plus 5
Explorer 700 Plus 6
Explorer 280 Plus 7
Explorer 1000 Pro2 8
Explorer 600 Plus 9
Explorer 240 10
Explorer 2000 12

Properties and MQTT action IDs are exhaustive for this APK version. Unknown properties returned by newer firmware are displayed as raw key/value pairs.

Install

# Install as a CLI tool (from GitHub)
uv tool install git+https://github.com/jlopez/socketry

# Or from PyPI (once published)
uv tool install socketry

# Or install as a library
pip install socketry

CLI usage

Login

# Authenticates and discovers all devices (owned + shared with you)
socketry login --email you@example.com --password 'yourpass'

# List devices and select the active one
socketry devices
socketry select 0

Credentials are saved to ~/.config/socketry/credentials.json (mode 0600).

Reading properties (get)

# All properties (colored + grouped on a TTY)
socketry get

# Single property — by CLI name or raw protocol key
socketry get battery          # Battery: 85%
socketry get rb               # Battery: 85% (same thing)
socketry get ac               # AC output: ON

# JSON output (indented on TTY, compact when piped)
socketry get --json
socketry get ac --json        # {"oac": 1}
socketry get --json | jq .rb  # pipe-friendly

Available properties:

Group Names
Battery & Power battery, battery-temp, battery-state, input-power, output-power, input-time, output-time
I/O State ac, dc, usb, car, ac-in, dc-in, light, wireless
Settings charge-speed, auto-shutdown, energy-saving, battery-protection, sfc, ups, screen-timeout
AC / Power Detail ac-input-power, car-input-power, ac-voltage, ac-freq, ac-power, ac-power-2, ac-socket-power
Other / Alarms error-code, temp-alarm, power-alarm, power-mode-battery, total-temp, system-status, power-capacity

Raw protocol keys (rb, oac, bt, ...) are also accepted.

Changing settings (set)

# I/O toggles
socketry set ac on
socketry set dc off
socketry set usb on
socketry set car off

# Light
socketry set light high       # off | low | high | sos

# Device settings
socketry set charge-speed mute      # fast | mute
socketry set battery-protection eco # full | eco
socketry set ups on
socketry set sfc on

# Integer settings
socketry set screen-timeout 30
socketry set auto-shutdown 60
socketry set energy-saving 30

# Wait for device confirmation
socketry set ac on --wait

# Show available settings
socketry set
socketry set light            # "expects a value: off | low | high | sos"

Writable settings:

Setting Values Description
ac on / off AC output
dc on / off DC output
usb on / off USB output
car on / off Car (12V) output
ac-in on / off AC input
dc-in on / off DC input
light off / low / high / sos Light mode
screen-timeout integer Screen timeout
auto-shutdown integer Auto shutdown timer
charge-speed fast / mute Charge speed mode
battery-protection full / eco Battery protection level
energy-saving integer Energy saving timeout
sfc on / off Super fast charge
ups on / off UPS mode

Library usage

from socketry import Client

# Authenticate (or load saved credentials)
client = Client.login("email@example.com", "password")
client.save_credentials()

# Or load previously saved credentials
client = Client.from_saved()

# List and select devices
devices = client.fetch_devices()
client.select_device(0)

# Read properties
props = client.get_all_properties()
setting, value = client.get_property("battery")
print(f"{setting.name}: {setting.format_value(value)}")

# Control
client.set_property("ac", "on")
result = client.set_property("light", "high", wait=True)

How it works

socketry ──HTTP──> iot.jackeryapp.com    (login, device list, properties)
socketry ──MQTT──> emqx.jackeryapp.com  (device control via encrypted TLS)

Login uses AES-192/ECB + RSA-1024 encrypted HTTP POST. Device control commands are published over MQTT (TLS 1.2 with a self-signed CA). Status polling uses the HTTP property endpoint. See docs/protocol.md for the full protocol specification.

Roadmap

  • MQTT real-time monitor (subscribe to live property changes)
  • Token auto-refresh (JWT expires ~30 days)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

socketry-0.1.0.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

socketry-0.1.0-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file socketry-0.1.0.tar.gz.

File metadata

  • Download URL: socketry-0.1.0.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for socketry-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ca4c657bbac3c43539cb5688b2713b60e6aba3b1b37a7b00a7a4f2a6138b1e02
MD5 bf0af2141a05b83661297aed161feff0
BLAKE2b-256 d262a74d8e1307b0cbbaf48797c21fcb5d402f7aa56de7da2460b854e31b91f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for socketry-0.1.0.tar.gz:

Publisher: release.yml on jlopez/socketry

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file socketry-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: socketry-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for socketry-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1f57398e3071bc5f767a84388d522f4efa7347b0151db92de40b5a9c2118e21
MD5 0b461deca0b84e32655c2359bcff37b5
BLAKE2b-256 f5247e550d8028057f56bad43fd971ec565883355ebae5046400febb11adb45a

See more details on using hashes here.

Provenance

The following attestation bundles were made for socketry-0.1.0-py3-none-any.whl:

Publisher: release.yml on jlopez/socketry

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page