Skip to main content

OpenSMI Logo

Docs PyPI version Python versions License

OpenSMI Server

Open Smart Machine Interface (SMI) provides an abstract, standardized, vendor-neutral way to interact safely with real (or simulated) machines. OpenSMI is an asynchronous Python framework, built on top of asyncua for building SMI-compliant OPC UA servers.

It gives you the building blocks for exposing manufacturing capabilities — axes, grippers, robots, conveyors, whole machines — over a standardized, hierarchical OPC UA information model, without having to hand-roll everything yourself.

Why OpenSMI

A common real-world use case is as an adapter in front of a Programmable Logic Controller (PLC): many PLCs can speak OPC UA but don't natively expose SMI's richer skill model — suspendable/resumable skills, composite orchestration, feasibility/precondition checks, standardized locking. OpenSMI lets you sit in front of such a PLC and:

  • Adapt what the PLC already exposes into proper SMI skills/methods, so any SMI-aware client can talk to it uniformly regardless of vendor or PLC platform.
  • Extend it: if the PLC only implements simple atomic skills (e.g. MoveTo, Open, Close), compose them into higher-level composite skills (e.g. PickAndPlace) in Python — where orchestration logic is faster to write, test, and iterate on than in PLC ladder/structured text.

This keeps low-level, safety-critical motion on the PLC where it belongs, while higher-level sequencing and coordination logic lives in a language better suited for rapid development.

Requirements

  • Python 3.11+

Installation

pip install opensmi-server

Quick Start

Define a skill, add it to a machine, and start the OPC UA server:

import asyncio

from asyncua import ua
from opensmi.core import Unit

from opensmi.server import BaseMachine, BaseSkillFinalResultData, BaseSkillFinite, ParameterSet, Server, UaVariable
from opensmi.server.mixins import FinalResultDataMixin, ParameterSetMixin, ParentMixin


class ExampleSkillParameterSet(ParameterSet):
    """Parameters of the example skill."""

    X = UaVariable(0, unit=Unit.NANOAMPERE, range=(0, 10))
    Y = UaVariable(0, unit="nA", range=(0, 10))


class ExampleSkillSimpleFinalResultData(BaseSkillFinalResultData):
    """Final result data of the example skill."""

    ComputationResult = UaVariable(0, unit="nA", range=(0, 20))


class ExampleSkill(
    ParameterSetMixin[ExampleSkillParameterSet],  # provides type-checkable parameters
    FinalResultDataMixin[ExampleSkillSimpleFinalResultData],  # provides type-checkable results
    BaseSkillFinite,  # provides finite skill logic etc.
):
    async def _handle_running(self) -> None:
        # define logic that is executed in the RUNNING state

        # read our parameters
        x = await self.parameter_set.X.read()
        y = await self.parameter_set.Y.read()

        # simulate long-running calculation etc.
        await asyncio.sleep(1)

        # we are done, write return variables
        await self.final_result_data.ComputationResult.write(x + y)


class ExampleMachine(BaseMachine):
    async def _init(self) -> None:
        await super()._init()

        await self.add_skill(ExampleSkill())

    async def _write_identification(self) -> None:
        # These identification variables must be set for machines
        await self.identification.SerialNumber.write("1234-56789-abc")
        await self.identification.ProductInstanceUri.write("urn:smartfactory.de-model:snr-1234-56789-abc")
        await self.identification.Manufacturer.write(
            ua.LocalizedText("Technologie-Initiative SmartFactory-KL e. V.", "de-DE")
        )


async def main() -> None:
    async with Server() as server:  # will properly shut down the server
        await server.add_machine(ExampleMachine())  # add machine(s)
        await server.start(blocking=True)  # start the server and block while it is running


if __name__ == "__main__":
    asyncio.run(main())

Usage

  1. Connect to the server with any OPC UA client (e.g. UaExpert) at opc.tcp://localhost:4841, authenticating as user operator with password operator.
  2. Navigate to Objects/Machines/ExampleMachine.
  3. Under ExampleMachine/Lock, call the InitLock() method to acquire exclusive access — required before you can write parameters or call skill methods.
  4. Navigate to ExampleMachine/SkillSet/ExampleSkill/SkillExecution. This is where the skill's ParameterSet, StateMachine, and FinalResultData etc. live.
  5. Under ParameterSet, write values for X and Y.
  6. Under StateMachine, call Reset(). Skills start in the Halted state and must be reset to Ready before they can run.
  7. Call Start(). The skill moves through Starting → Running → Completing → Completed.
  8. Once StateMachine's CurrentState reads Completed, read the result from ComputationResult under FinalResultData.

Or simply use our OpenSMI-Client.

Explore the safety features:

  • Try writing parameters or calling skill methods without holding the Lock — it will be rejected.
  • Try writing X or Y outside their allowed range — it will be rejected.
  • Try acquiring the Lock while authenticated as user visitor with password visitor — it will be rejected.

See here for more OpenSMI server examples.

Core Concepts

Concept What it is
Machinery Items Common base for Machines and Components: attributes, identification, parameters, monitoring, sub-components, skills, methods, etc.
Components One piece of a machine's hierarchy, e.g. an axis or a gripper. May nest further sub-components.
Machines The top-level unit a client addresses as "the machine," e.g. a robot + storage + transport port. A single server can expose several machines.
Skills Asynchronous, stateful capabilities — finite (run once, complete) or continuous (run indefinitely), atomic or composite.
Methods Synchronous, quick operations — no state machine, just call() in, result out.
Variables Values that belong together: structures as dataclasses, their fields as child variables, and groups of variables.
Events Messages as OPC UA events: info, warning and error notifications and their history.

Project Status

OpenSMI began as a closed-source project at SmartFactory-KL, in active use in our model factory since 2020. Its OPC UA information model has been refined across many iterations of research and demonstrator use. The framework was open-sourced in 2026 following substantial refactoring and cleanup.

Most of the framework is stable and well-tested, but it remains pre-1.0 — expect minor API changes before the 1.0 release.

Publications

Get more information of OpenSMI by reading our publications:

Scientific Publications

Title Content
Seamless Machine Integration in Smart Manufacturing: Utilizing OPC UA for Machinery with Skill-Based Engineering of Varying Granularity Application of skills in robotics and an introduction to OpenSMI's OPC UA modeling
Developing a skill-based flexible transport system using OPC UA Application of skills in intralogistic
Interaction between FeasibilityCheck, PreconditionCheck and SkillExecution in skill-based machining Application of skills in machining

Joint Publications

Title Content
Capabilities and Skills in Production Automation Guidline for capabilities and skills with a focus on OPC UA
Information Model for Capabilities, Skills & Services Presenting an information model for flexible manufacturing in Industry 4.0 based on capabilities, skills and services
Capabilities, Skills and Services CSS Model Extensions and Engineering Methodology Refinement of the information model for capabilities, skills and services

License

The library itself is licensed under the MIT License.

Example code contained in the examples directory is dedicated to the public domain under the CC0 1.0 Universal license.


This text was drafted with AI assistance (Claude, Anthropic) and reviewed/edited by the author before publication.

Metadata

Release files for OpenSMI-Server 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for OpenSMI-Server 0.4
File Size Uploaded Provenance Actions
opensmi_server-0.4.tar.gz 131.1 kB With provenance Details for opensmi_server-0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for OpenSMI-Server 0.4
File Interpreter ABI Platform Actions
opensmi_server-0.4-py3-none-any.whl Python 3 none any Details for opensmi_server-0.4-py3-none-any.whl

Total release size: 246.3 kB

Release files / opensmi_server-0.4.tar.gz

Download URL opensmi_server-0.4.tar.gz
Size 131.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f4c1dbb6dd75c0625d0971240667e3ec458c4273d0530a8f96470d98062d86dc
BLAKE2b-256 checksum
How to use checksums
ef0bd025aadca67ab9f31be952e2855a8f8c12f99b198dafacbedf6e9cded435
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / opensmi_server-0.4-py3-none-any.whl

Download URL opensmi_server-0.4-py3-none-any.whl
Size 115.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86f8acb117eb247920a97b4c925265d7200a661a52ba383e71b6c385cff69322
BLAKE2b-256 checksum
How to use checksums
b0d1ae1bbaf082dc55ec05a9f4ceeed0d5eefa2bf02b8baac944b22566aa78df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for OpenSMI-Server 0.4

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for opensmi_server-0.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.4 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page