Skip to main content

Transport-agnostic client library for the Silla Prism EV wallbox over MQTT

Project description

pysillaprism

Transport-agnostic Python client library for the Silla Prism EV wallbox, speaking its native MQTT protocol (topic manual rel. 4.0).

The library does not own an MQTT connection. It parses the Prism topics into typed state and builds the command topics; you wire it to whatever MQTT client you already have — for example Home Assistant's mqtt integration. This keeps it free of transport dependencies and trivially unit-testable.

Install

pip install pysillaprism

Usage

from pysillaprism import PrismDevice, PortMode

# `publish` may be sync or async (e.g. hass mqtt.async_publish).
async def publish(topic: str, payload: str) -> None:
    ...

device = PrismDevice("prism", publish=publish)

# Wire callbacks (all optional).
device.on_status_update = lambda upd: print("changed", upd.field)
device.on_event = lambda ev: print("touch/knock", ev.values)
device.on_command_result = lambda res: print(res.command, res.result)
device.on_hello = lambda info: print("serial", info.serial)

# Subscribe your MQTT client to `device.subscription_topic` ("prism/#")
# and feed every message in:
device.handle_message("prism/1/state", "3")

print(device.status.port(1).state)        # PortState.CHARGING
print(device.status.energy.power_grid)    # signed watts

# Send commands:
await device.set_mode(PortMode.NORMAL)
await device.set_current_limit(9.6)        # amps, for load balancing
await device.set_current_user(16)          # amps, mirrors the +/- buttons
await device.authorize()

Notes on the protocol

  • Prism publishes a topic only when its value changes, so status fields stay None until first reported. Status topics are retained on the broker, so a fresh subscriber receives the current snapshot immediately.
  • The hello announcement (which carries the serial and firmware version) is sent only when Prism (re)connects and is not retained. Treat device info as opportunistic: it populates on the next Prism reboot, and the device works without it. Identify a device by its base topic, not its serial.
  • power_solar / power_house are only meaningful with a Powerwall/meter configured; otherwise Prism publishes 0.

License

MIT © Ermanno Baschiera. Not affiliated with Silla S.r.l.

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

pysillaprism-0.1.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

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

pysillaprism-0.1.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pysillaprism-0.1.0.tar.gz
Algorithm Hash digest
SHA256 db3ada1598848dcaff7c619b444fa4fd6d2d6bd5a642fd7039ed786940ebb7f2
MD5 e49cd0c259dfd396c584f2a116749046
BLAKE2b-256 00e77871ed5e09ee9b551445c0d83791a379daf185bcf0cdfbbee3bfa8358608

See more details on using hashes here.

Provenance

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

Publisher: release.yml on ebaschiera/pysillaprism

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

File details

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

File metadata

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

File hashes

Hashes for pysillaprism-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b31f04b2671637aa6491db680e2b8bcc36d4ae546aa907a0028c1847f65a5abf
MD5 880a9aabfa3ed0f831c6df449131f23d
BLAKE2b-256 2c2ee8fb2f3d1ad2eba67f6e92f3f3085915402ef3517a66c56717305a48fccd

See more details on using hashes here.

Provenance

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

Publisher: release.yml on ebaschiera/pysillaprism

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