Skip to content

SheetMetalConnect/metalfab-uns-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MetalFab UNS Simulator

MQTT-based Unified Namespace simulator for a multi-site metal fabrication company. 22 machines across 3 European sites, ISA-95 hierarchy, PackML state machines.

Quick Start

git clone https://github.com/SheetMetalConnect/metalfab-uns-simulator
cd metalfab-uns-simulator
docker compose up -d --build

Simulator publishes to umh/v1/metalfab/... on port 1883. Verify:

mosquitto_sub -t "umh/v1/metalfab/#" -v

Dashboards

Open dashboards/index.html in your browser. Connects to MQTT via WebSocket on port 8083.

Available dashboards:

  • OEE Deep Dive β€” Single-machine A/P/Q breakdown, downtime Pareto, state timeline
  • Factory Overview β€” All machines at a site with status, jobs, OEE
  • Powder Coating Line β€” Zone tracking, RAL colors, process flow
  • Warehouse β€” AGV fleet, inventory

MCP Server (Claude Desktop)

Connect Claude to the simulator for natural language queries. See mcp-server/README.md.

Control

# Change complexity level (0=paused, 1=sensors, 2=stateful, 3=ERP/MES, 4=full+DPP)
mosquitto_pub -t "metalfab-sim/control/level" -m "3"

# Enable/disable sites
mosquitto_pub -t "metalfab-sim/control/site/brasov" -m "1"
mosquitto_pub -t "metalfab-sim/control/site/roeselare" -m "0"

# Clear all retained data
mosquitto_pub -t "metalfab-sim/control/clear" -m "1"

# Watch simulator status
mosquitto_sub -t "metalfab-sim/#" -v

Local Development

pip install -e .
metalfab-sim run --level 3
metalfab-sim subscribe
pytest

Reference

UMH Data Contracts

The simulator publishes data using two UMH data contract conventions:

_raw (all machines) β€” Unvalidated sensor data. Works out of the box with the starter kit's historian flow.

umh/v1/metalfab/{site}/{dept}/{machine}/_raw/{tag_name}   β†’ bare value (85.5, "EXECUTE")

_energy-monitor_v1 (energy data) β€” Validated data contract example. Requires a matching data model in UMH Core.

umh/v1/metalfab/{site}/energy/main/_energy-monitor_v1/{tag_name}   β†’ bare value (45.2)

Both publish alongside the existing Edge/, Line/, Dashboard/ topics used by the browser dashboards.

Use with UMH Core Stack

This simulator integrates with Luke's UMH Starter Kit β€” an opinionated, batteries-included UMH Core stack.

# From the UMH-Core-Stack repo
docker compose -f docker-compose.yaml -f examples/simulator/docker-compose.simulator.yaml up -d

Then deploy these flows via Management Console β†’ Data Flows β†’ Stand-alone:

Flow File in starter kit Purpose
Simulator Bridge examples/simulator/flows/simulator_to_uns_bridge.yaml Routes simulator data into UMH Core
Historian examples/databridges/flows/historian.yaml Persists _raw β†’ TimescaleDB
Energy Historian examples/simulator/flows/energy_historian.yaml Persists _energy-monitor_v1 β†’ TimescaleDB

End-to-end: Simulator β†’ HiveMQ β†’ UMH Core β†’ historian β†’ TimescaleDB β†’ Grafana

License

MIT

About

🏭 MQTT-based UNS simulator for sheet metal fabrication β€” 22 machines, 3 sites, ISA-95, PackML. Plug into UMH Core Stack for instant demo data.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages