Litmus Edge
Create Miravo-managed devices, tags, Digital Twins models, and Digital Twins instances on Litmus Edge from scripts, CI, and saved targets.
Create Miravo-managed devices, tags, Digital Twins models, and Digital Twins instances on Litmus Edge from scripts and CI. These commands assume a Miravo template and a reachable Litmus Edge.
Apply
- Save the target.
# Save a target (token from stdin)
printf %s "$LE_TOKEN" | miravo le target add \
--label demo \
--hostname 10.0.0.20 \
--source-hostname 172.17.0.1 \
--api-token-stdinThe token never goes on the command line. Without --api-token-stdin, a terminal gets a hidden prompt. Instead of saving a target, you can set LITMUS_EDGE_API_TOKEN and pass --le-hostname.
- Preview the plan.
# Preview changes
miravo le apply --target demo -t smart-factory --dry-run- Apply.
# Apply changes
miravo le apply --target demo -t smart-factoryVerify before applying
Run miravo le target test demo to check connectivity and the detected Litmus Edge version.
Miravo supports Litmus Edge 4.0.10 through 4.3.x and warns when the target is older than 4.0.10.
Expose the protocol to Litmus Edge
Miravo binds protocol listeners to 127.0.0.1 by default. If Litmus Edge runs on another machine, start Miravo with the applied protocol reachable, for example miravo start --opcua-host 0.0.0.0, and keep it on an isolated network. See Security.
Update
le apply converges Litmus Edge toward the template. Running it again with the same template compares each device (settings and tags), Digital Twins instance and parameter link with what Litmus Edge holds. Unchanged resources show as NOOP and nothing is written, so an unchanged re-apply reports 0 resources applied. Only resources that differ are updated. A Digital Twins model that already exists by name counts as unchanged, so after a model schema change, run cleanup and then apply again.
# Sync all resources
miravo le apply --target demo -t smart-factory# Limit resource types
miravo le apply --target demo -t smart-factory --scope devices,models# Target one asset
miravo le apply --target demo -t smart-factory --asset pump-001Apply and export generate asset ids the same way miravo load -t does, as <template-id>-<model>-NNN.
Offline runs mark what they create with the factory name offline. Resources the Console applied for a running factory carry that factory's name instead, so le cleanup -t only removes offline applies. Remove a Console apply from the Factory page (Integrations tab, Clean up on its row), or with --all-managed.
Apply never takes another factory's resources, and cleanup leaves them alone unless you pass --all-managed. Apply blocks when a device or Digital Twins instance with the same name carries another factory's marker, naming the owner. Cleanup lists any model or instance whose markers it could not read under Blockers and deletes nothing through it; retry once Litmus Edge answers.
Clean up
Cleanup removes only Miravo-managed resources. Everything else on Litmus Edge stays in place. -t scopes it to that template's offline apply.
# Preview removal
miravo le cleanup --target demo -t smart-factory --dry-run# Remove managed resources
miravo le cleanup --target demo -t smart-factory -yLitmus Edge refuses to delete a Digital Twins model that instances still use. When --scope includes models but not assets, the plan lists those models under Blockers with the instances that use them, and a run without --dry-run stops with exit code 1 before deleting anything. Fix: remove the instances first by adding assets to --scope, or omit --scope (the default removes instances, then models, then devices).
Export
Export when Miravo cannot reach Litmus Edge directly, or when you want import files.
# Export template bundle
miravo le export template -t smart-factory# Override embedded endpoint host
miravo le export template -t smart-factory --source-hostname 192.168.1.100 --protocol opcua -o ./out/sfThis writes <prefix>.le-template.json and <prefix>-tags.csv covering every asset, and prints the asset count per protocol. Pass --protocol to export one protocol. Assets scoped to other protocols are then skipped, with a warning that suggests omitting --protocol for one file with everything. Import the JSON in Litmus Edge under Template Store ⭢ Import.
# Export tag CSV
miravo le export tags --device smart_factory_cnc_001 --protocol opcua# Write tag CSV to a file
miravo le export tags --device smart_factory_cnc_001 --protocol mqtt -o tags.csv# Export a model JSON
miravo le export dt centrifugal-pumpCreated resources
- Devices: one per asset, per protocol.
- Tags: every published member, with engineering units and access levels. OPC UA and Modbus tags are numeric or boolean. MQTT tags are strings holding the whole Miravo JSON message (
value,timestamp,quality), because the Litmus Edge MQTT Client driver offers only a string value type and cannot extract a field from the payload. Use OPC UA or Modbus when you need numeric tag values. - Digital Twins models: one per Miravo asset model.
- Digital Twins instances: one per asset, bound to its device and tags.
Reference
Environment variables
| Name | Default | Purpose |
|---|---|---|
LITMUS_EDGE_HOSTNAME | Unset | Litmus Edge hostname or IP for le apply and le cleanup |
LITMUS_EDGE_API_TOKEN | Unset | Litmus Edge API token for le apply and le cleanup |
MIRAVO_SOURCE_HOSTNAME | Unset | Hostname Litmus Edge uses to reach Miravo |
Resolution order
| Input | Order |
|---|---|
| Litmus Edge hostname | With --target: the named target, with --le-hostname overriding it. Otherwise: --le-hostname ⭢ LITMUS_EDGE_HOSTNAME ⭢ most recently used saved target |
| Litmus Edge API token | With --target: the named target. Otherwise: LITMUS_EDGE_API_TOKEN ⭢ most recently used saved target. Never a flag. Save it with le target add --api-token-stdin |
| Source hostname | --source-hostname ⭢ MIRAVO_SOURCE_HOSTNAME ⭢ named target ⭢ most recently used saved target |
Related pages
Litmus Edge integration
Install, run, and explore Miravo with Litmus Edge.
CLI ⭢ le target add
Save a target before you apply.
CLI ⭢ miravo le apply
Scope, dry run, and collision policy.
CLI ⭢ le export template
Build an import bundle offline.
Core ⭢ Templates
The .miravo.yaml behind the plan.
Console integrations
The same saved targets and operations in the browser.
Environment variables
LITMUS_EDGE_* and MIRAVO_SOURCE_HOSTNAME.
Was this page useful?
Last updated on
Miravo