Templates
Compose twins into a runnable environment with `.miravo.yaml` topology, namespace, protocol scope, and settings.
Compose twins into one environment when you need plant topology, namespace layout, runtime settings, or protocol scope.
Technical details
Start from a minimal template
kind: MiravoTemplate
version: "1"
name: "My Environment"
namespace:
enterprise: AcmeCorp
site: detroit-plant
areas:
- name: production
lines:
- name: line-1
twins:
- model: centrifugal-pump
count: 3
variation: 0.05
settings:
tick_interval_ms: 1000
time_multiplier: 1Save the file as my-plant.miravo.yaml.
Validate the file with miravo start before you start a runtime.
miravo start --template ./my-plant.miravo.yaml --dry-runInspect the resolved topology with miravo templates inspect.
miravo templates inspect ./my-plant.miravo.yamlModel topology explicitly
Templates define areas, then lines, then twins. Each assignment sets model, instance count, optional parameter overrides, optional starting hours, and optional protocol scope.
Namespace uses ISA-95-style enterprise and site or a flat prefix. Emitted paths continue with area, line, instance, and member.
Scope protocols where they matter
protocols:
opcua:
port: 4840
mqtt:
port: 1883
areas:
- name: machining
protocol_scope: [opcua]
lines:
- name: cnc-cell
twins:
- model: cnc-spindle
count: 2
- model: storage-tank
count: 1
protocol_scope: [mqtt]Nearest scope wins. Miravo resolves protocol_scope in this order: twin assignment, line, area, then global protocols.
Validate before you run
miravo start --template <id|path> --dry-run validates the template and its referenced models without starting the runtime. miravo templates inspect <id> shows the resolved topology and referenced model set.
Reference
| Field or block | Notes |
|---|---|
kind | Must be MiravoTemplate |
version | Current literal is "1" |
namespace | Use { enterprise, site } or { prefix } |
areas[].lines[].twins[] | Supports model, count, variation, starting_hours, parameters, protocol_scope |
protocols | Configure mqtt, opcua, modbus |
settings | Supports tick_interval_ms, time_mode, time_multiplier, seed, overrun_threshold_multiplier |
Related pages
Twin models
Asset type schema.
CLI ⭢ templates inspect
Inspect resolved topology from the shell.
Custom content
Fork or shadow a template.
Environments
Built-in runnable environments.
Smart Factory
One built-in template in context.
Was this page useful?
Last updated on
Miravo