Feature

Automation, Python & CI

Turn running twin behavior, scenarios, and protocol checks into repeatable tests that fit Python, Docker, and CI/CD workflows.

Turn a simulation into a repeatable check

Use the SPX Python client to start an instance, change its inputs and check the resulting state. The same idea can support a local regression test or a CI job that runs against an isolated SPX test environment.

Python automation

From a test to live model state

Local machine or CI runner

Python test

Create, set inputs, compare readings and clean up.

Python calls

Python library

spx-python client

Connects the test to the SPX API.

HTTP API

SPX server · container or host

API ↔ running instance

The model processes inputs and exposes its live state.

1. Write
Set a model input.
2. Read
Fetch the resulting telemetry.
3. Assert
Compare values and report pass or fail.
The test uses the HTTP control API. Device-protocol checks require a separate protocol client and any supporting services.

Example: check temperature telemetry

The public temperature quickstart registers a small model on an SPX test server, creates its own instance and changes a temperature input from 20.0 °C to 37.5 °C. It reads the telemetry, checks the result and removes the objects it created. View the Python source.

This checks the model's input-to-telemetry behavior. It does not test MQTT, Modbus or a physical sensor. A running test server, a valid product key and capacity for an additional instance are required; keep credentials in your local secure configuration or CI secrets.

Ask your AI agent

Open your prepared SPX workspace in a local agent and use this request:

Prompt for your AI agent

Write and run a small Python check against my running SPX test server: create an isolated temperature sensor model and instance, verify that changing its input from 20.0 to 37.5 °C changes the telemetry, and remove only the model and instance created by this check. Use the installed SPX Python client and the workspace's private connection configuration. In an installer-managed workspace, obtain the configured client via installer.setup_runtime.SetupRuntime(workspace).create_client(); do not print or save credentials. Report the command, observed values, cleanup result and any limitations. If you cannot run it safely, explain what is missing.

Tested with GPT-6 Luna · Medium

The agent may need to locate the installed client and connection configuration. Ask it to report actual readings and cleanup, and distinguish a local test from a CI run.

In our local test, the agent used the prepared installer workspace, observed telemetry change from 20.0 °C to 37.5 °C and removed its test model and instance. This was a Python runtime check, not a CI job or a protocol test.

Bring the check into CI

Once your local check works, add it to your pipeline with a disposable SPX test server, its required services and a securely supplied product key. Your job should fail if the expected behavior is not observed and should clean up its own test resources.

GitHub Actions job for SPX catalog qualification, with the step to start a disposable server and services and test published models expanded.
A real spx-examples qualification job starts a disposable server and tests catalog models. · View workflow

Screenshot preview

A real spx-examples qualification job starts a disposable server and tests catalog models. Open original image

This job qualifies a catalog against server versions; it is a separate, broader workflow than the temperature example above. Explore the workflow YAML and the runtime stack source. Adapt the setup and checks to your project and review their actual results before relying on them.

Where to use it

  • Check model behavior after a change to application or integration code.
  • Repeat scenarios with known inputs in a test environment.
  • Run protocol-client checks when the required services and endpoint are available.

Continue exploring