Skip to content

uniwire format specification, version 1.0 (draft)

Status: draft. The format is under construction: until it is adopted, it may still change without a version change, and documents declare "uniwire": "1.0.0-draft". Once adopted, it becomes the stable 1.0.0 and later additions follow §9 (a minor version for optional additions).

Open exchange format for describing electrical installations, drawn as single-line and multi-line diagrams (residential, commercial and industrial LV, with an MV/LV transformer at the head, standby sources, PV, EV charging (IRVE)). *.uniwire.json files, which can be validated against the published JSON Schema schema/uniwire.schema.json (draft 2020-12).

The key words MUST, MUST NOT, SHOULD and MAY are to be interpreted as described in RFC 2119.


1. Principles

  1. Describe the installation, not the drawing. A document contains the electrical topology and the characteristics of the equipment. It is complete without any coordinates: the layout is computed by the rendering tool. Views (views) carry only optional preferences and overrides (the same approach as CIM Diagram Layout and OpenSCD).
  2. Tree + links. Power flows down from the sources to the loads, and the vast majority of single-line diagrams are radial trees. A document therefore describes a tree (sources → children). Whatever falls outside the tree (source transfer switch, busbar coupling, bypass, control connections) is described in links. The "terminals / connectivity nodes graph" form (CIM, IEC 61850) is derived automatically (see §8).
  3. Explicit, closed typing. Each node has a type taken from a registry (§5). Unknown fields are rejected (a typo such as calibre instead of in_A is an error); extensions go in ext.
  4. Numeric quantities, unit in the name. in_A: 16, idn_mA: 30, section_mm2: 2.5 (as in pandapower). No "16 A" strings in a published file.
  5. Identifier ≠ reference designation. id is stable and is used for references; ref is the displayed IEC 81346 reference designation (-Q3), which may change when items are renumbered.
  6. Factoring. Repeated characteristics (a C16 4.5 kA circuit breaker…) are declared once in templates and applied with use.

2. Document structure

{
  "$schema": "https://uniwire.sh/schema/v1/uniwire.schema.json",
  "uniwire": "1.0.0-draft",
  "profiles": ["nfc15100"],
  "meta": { ... },
  "installation": { ... },
  "templates": { "C16": { "type": "breaker", "in_A": 16, "curve": "C", "icn_kA": 4.5 } },
  "sources": [ { "type": "grid", "children": [ ... ] } ],
  "links": [ { "kind": "control", "from": "CPT", "to": "KM1" } ],
  "views": [ { "id": "sld", "paper": "A3" } ],
  "ext": {}
}
Key Required Purpose
$schema no Schema URL (the major version appears in the path: /v1/)
uniwire no (default 1.0.0-draft) Format version: 1.0.0-draft (any other value is rejected while the format is a draft)
profiles no Business rule profiles to apply (nfc15100, vde0100, iec60364, enedis…)
symbols no (default iec) Symbol set of the drawing (§7.3)
meta no Title, project, client, author, date, revisions[], notes[], lang
installation no earthing (TT, TN-C, TN-S, TN-C-S, IT), system (1P+N, 3P+N…), un_V, f_Hz, supply, subscribed_kVA, planned_kVA, ik3_kA, earth_resistance_ohm, surface_m2, standard, premises (dwelling, commercial, office, industrial, public, agricultural, other: dwelling rules apply to dwelling or when absent)
templates no Named attribute templates
sources yes (≥ 1) Roots of the tree: grid, generator set, transformer…
links no Connections outside the tree (§4)
interlocks no Interlock declarations: number of keys per locks identifier (§4.1)
views no Rendering preferences (§7)
ext no Free-form extensions (§9)

3. Nodes

Every node has the following common fields (all optional except type):

Field Type Description
type enum Component type (§5), required
id ^[A-Za-z_][A-Za-z0-9_.-]*$ Identifier, unique within the document. If absent, the tool generates one (from ref, otherwise from the type)
ref text Displayed reference designation (IEC 81346: -Q1, -KM1, TD1)
label text Designation: function, room (Living room sockets)
use text Name of a template in templates
status new, existing, spare, future, removed State (planned / existing / spare)
phase L1, L2, L3, L1L2… Connection of a single-phase circuit on a three-phase network
location, manufacturer, part_number, note text Additional information
external boolean Equipment outside the scope (another work package, supplied by others): drawn dashed
cable object Cable run between the parent and this node (§3.2)
children array of nodes Nodes supplied by this one
ext object Extensions

3.1 Tree semantics

  • A node is supplied by its parent and supplies its children, in order (left → right).
  • A node with several children implicitly carries a busbar. The busbar type makes it possible to declare it explicitly in order to give it characteristics (In, dimensions, Ik).
  • A board (distribution board, cabinet, enclosure) is a container: it has no electrical function of its own; it groups its descendants down to the next board. It is drawn as a dashed frame. An inverter, ups, transfer_switch, busbar (other than the board's own, at its head) or transformer with a primary above 1000 V (u1_V) that has a cable, or is fed by a device that has one, is at the far end of that cable: it is drawn below the frame, with what it feeds.
  • Loads (category load), pv_array and battery are leaves.
  • A protective device without children represents an outgoing circuit whose load is not described (drawn ending on a small free terminal, as a spare way; a feeder continued elsewhere ends on an offpage node).

3.2 Cable

Field Description
designation Type: U1000R2V, H07V-U, AR2V, H1Z2Z2-K…
cores Core composition without the cross-section: 3G, 5G, 4x, or full composition 4x120+70
section_mm2, pe_section_mm2, neutral_section_mm2 Cross-sections
parallel Number of cables in parallel per phase
material Cu / Al
length_m Length
install Installation method (IEC 60364-5-52 reference)
insulation PVC, PR, EPR, XLPE
du_pct Calculated voltage drop
ref Cable tag (W12), written with the cable text on the drawings (display: §7.2)
marks Wire marks of its conductors, by conductor: {"L1": "101", "PE": "PE"} (§7.2)

3.3 Templates (templates)

A template is an object of attributes, optionally typed. During resolution:

  1. the template's attributes are copied into the node, with the node's own attributes taking precedence;
  2. if the template declares a type, it MUST be equal to the node's type;
  3. id, type and children are never inherited;
  4. the resulting node is validated against its type.
"templates": { "C20": { "type": "breaker", "in_A": 20, "curve": "C", "icn_kA": 4.5, "poles": "1P+N" } },
...
{ "type": "breaker", "ref": "-F0", "use": "C20", "in_A": 25 }   // → C25 4.5 kA 1P+N

3a. Common fields, switchgear, auxiliary devices and enclosures

Fields common to all nodes

Field Description
count Number of identical items represented, drawn once ("x 20", 8 micro-inverters). On a protective device: identical circuits, each with the device's subtree. Ratings and powers are per item
circuit Circuit or outgoing feeder number / code, distinct from the reference designation (C1, 15B)
un_V, uln_V Rated (phase-to-phase) voltage and phase-to-neutral voltage of the node (boards, busbars, loads, inverters)
ib_A, p_kW, q_kvar, cos_phi Feeder data / power balance
priority essential, non_essential, safety, standby
normal_state open / closed: ring open point, NO/NC device, removable link not fitted. Rendered as an N.O. annotation
locks[] Interlock keys engaged by the device: the members sharing a key form one interlock (§4.1)
notes[] References to the numbered notes on the sheet
point_no Sequence number of a point on a circuit (RGIE diagrams, Belgian wiring regulations)

Switchgear (all protection / switching types)

frame_A (AF), range, ue_V, icn_kA, icu_kA (kAIC), icw_kA, aux[] (MX, MN, OF, SD, IOF, heating control-wire contact), mounting (fixed, plug_in, withdrawable), lockable. Circuit breaker: ii_A, tsd_s, gf_A, selective, dc (device for direct current, as on switch_disconnector and spd: the line it is on is drawn as a DC line). A breaker has no residual-current fields: a breaker with residual-current protection is an rcbo (idn_mA, rcd_type), or a breaker with an rcd. rcbo.rcd_in_A (Vigi add-on block with a different rating). spd.poles, spd.uc_V. socket.in_A. spare.in_A/poles/frame_A (prepared space). transfer_switch.technology (static = STS). contactor.function: grid_relay, interface.

Boards, busbars, sources

board: in_A, ik1_kA, system, earthing (local earthing system, IT downstream of a transformer), ways, ip, form, kind: panelboard, pdu, substation, pen_split (TN-C-S: PEN split into PE + N at this board; when no board sets it, a TN-C-S installation splits at the first board, and a check finding asks to declare it). busbar: kind (busway = busbar trunking system), material, system, earthing. grid.scc_MVA, grid.system. transformer.kind (auto, earthing, isolation, bank), transformer.u1_alt_V (dual voltage). generator.prime_mover. inverter.protection (built-in grid decoupling protection), inverter.kind: charger. Systems: split-phase (120/240 V, 100/200 V); earthing system: TN. rcd_type: G.

Further types

Type Use
instrument_transformer (kind ct/vt/toroid/combined/shunt, ratio, accuracy, burden_VA) CTs, VTs, toroids, current shunts (shunt: a resistor in the conductor it measures, drawn as a resistor, not a CT ring; in the multi-line view on one conductor only: the one its phase names, else L+ on a DC line, else L1. On a shunt, phase names that conductor and does not make the circuit single-phase)
protection_relay (functions[], settings, idn_mA) ANSI relays, Vigirex, grid decoupling
earthing_switch Earthing switch
voltage_indicator VPIS / capacitive dividers
insulation_monitor IMD (insulation monitoring device, IT system)
surge_limiter Surge limiter (Cardew)
neutral_impedance (impedance_ohm) Neutral impedance (impedance-earthed IT)
terminal_block (terminals) Terminal block, connection point
junction_box (kind junction/pull/tap/manhole/vault/service_end) Junction box, manhole
connector MC4, plug-in connector
dc_converter (kind optimizer/mppt/dcdc/charge_controller) PV optimizers, charge controllers
earth_bar (kind main_earth/pe_bar/equipotential/neutral_bar) Main earthing terminal, PE bar, neutral bar

Cable

ref (reference designation / schedule tag), kind (busway, trunk...), conductors ("L1, L2, L3, N, PE"), pen, cpr_class, size_awg, raceway, ambient_C, status.

Conditions that correct the current-carrying capacity: grouped (circuits or multicore cables laid together, this one included), arrangement in air (bunched, the default, single_layer, ceiling, perforated_tray, ladder), supports (trays or ladders stacked one above another; grouped then counts the cables on one of them), spacing_m (clear distance between grouped circuits in the ground, 0 when touching), soil_resistivity_K_m_W (thermal resistivity of the soil, 2.5 when not given), third_harmonic_pct (third-harmonic content of the phase currents).

Auxiliary devices and enclosures

  • devices[] (document root): nodes outside the power tree (relays, CTs on a branch, IMDs, VPIS, communication modules). They are connected by links (measure, trip, control, data, earth). Rule: a tree node carries power; a device that only measures, controls or signals goes in devices.
  • enclosures[]: addressable enclosures that contain only the listed nodes (kind: cabinet, cell, box, room, zone, substation, boundary, lineup, panel; cell_type IM/QM/DM1…; position in the lineup; parent). Prefer them to board when the frame on the diagram does not match a subtree (MV cubicles, partial enclosure, property boundary).

Further kind values: infeed (additional supply to a node: 2nd incomer, MV ring, back-feed), earth (PE / equipotential bonding conductor), data (bus, TIC (French utility meter teleinfo), Modbus), key (key = key identifier). Further fields: cable, normally_open, status (temporary...).

Metadata and views

meta.drawing_number, meta.scale, meta.contributors[]; installation.ik1_kA, uln_V, du_max_pct. views[].direction accepts up, right, left (direction away from the source; the reference renderer draws downwards, up mirrored, and reports right and left with the core.view-direction finding). Additional circuit schedule rows: circuit, ib_A, cos_phi, cable_type, cable_ref, install, frame_A, count, un_V, and status (of the circuit, else of its protection), manufacturer and part_number (of the feeder's protection, else of its switching device, else of the final node; product first), icu_kA and icw_kA (of the protection, else of the switching device), socket_type (of the final node).

Out of scope (planned for 2.0)

Nodes with several parents / graph as the primary form (MV rings, double busbars), board reduced to an enclosure, cable as a first-class edge (sections, shared trunk), named ports (Q1#MX, T1#N).

3b. PLCs and product references

Product reference (product) on any node and any module

"product": {"manufacturer": "WAGO", "part_number": "750-8212", "range": "PFC200 G2",
            "description": "PFC200 2ETH RS controller", "ean": "…", "url": "…", "quantity": 1,
            "accessories": [{"part_number": "…", "description": "Vigi block"}]}
product takes precedence over the simple manufacturer / part_number fields (which are kept). The quantity of a bill of materials line is product.quantity, otherwise count, otherwise 1. uniwire bom file.uniwire.json produces the bill of materials (CSV): one line per part number, summed quantities, reference designations involved (-A1.3 = module in slot 3 of -A1). Equipment without a reference is grouped by type and main characteristics (spec: rating, curve, sensitivity, poles, breaking capacity, e.g. C16 1P+N 6kA), and cables by type, composition and material with their total known length (length_m), so that the bill of materials is useful before products are chosen.

Modular PLC (plc)

Field Description
role controller (CPU), coupler (remote I/O head), expansion, hmi
family 'PFC200', 'S7-1200', 'LOGO! 8', 'M241'
protocols[] 'Modbus TCP', 'PROFINET', 'EtherNet/IP', 'KNX'…
onboard[] I/O built into the head unit (slot 0)
modules[] Expansion modules in local bus order: slot, kind, part_number / product, channels, un_V, rating_A, signal, protocol, channel_labels

Module kind: cpu, coupler, power_feed, power_supply, di, do, ai, ao, relay_out, mixed_io, counter, temperature, power_measurement, comm, safety, motor, end, other.

A PLC is placed in the tree at the end of its supply circuit (often behind a power_supply 230 V AC → 24 V DC). What it controls or reads goes through links.

Channel ports (from_port / to_port)

A link can target a channel: "from_port": "3.1" = slot 3, channel 1 (slot 0 = built-in I/O). protocol field on data links. Example:

{"kind": "control", "from": "API1", "from_port": "4.1", "to": "KM21", "label": "Pump 1"},
{"kind": "data", "from": "RIO1", "to": "API1", "protocol": "Modbus TCP"}

Power supply (power_supply)

u1_V, u2_V, output (DC/AC), in_A, p_W, redundant. controller gains in_A and poles (time switch, load-shedding contact).

Rules (core profile)

plc.port (non-existent slot, channel beyond the number of channels, unreadable port), plc.port-shared (one channel controls several devices), plc.coil (24 V output driving a 230 V coil without a relay), plc.slots (duplicate or out-of-order slots), plc.wago-end / plc.wago-feed (WAGO local bus without an end module / power feed module).

Rendering

The PLC is drawn as a head unit followed by a strip of modules (one rectangle per slot, coloured by kind, slot number above); links leave from below the relevant module and carry the channel number.

kind Direction Rendering
transfer from = last device of the 2nd source, to = a transfer_switch Arrives at the "standby" input of the transfer switch
tie from / to = two nodes with a busbar; device = coupling device Horizontal coupling between busbars
bypass, parallel Additional power connection Solid line
infeed Additional supply to a node (2nd incomer, alternative position of a feeder) Solid line landing on the input conductor of to (junction dot)
control, interlock, trip, measure Control, interlocking, tripping, measurement Dashed line

Fields: kind, from, to (existing identifiers), label, device (node inserted on the link: bus coupler, removable link, switch, fuse…), normally_open, locks[], cable, id, ext.

A power link (transfer, tie, bypass, parallel, infeed) with normally_open: true is drawn with a long dash (control links use a short dash). Its device is drawn on the route, in its normal state, with its tag, rating and state (N.O., interlock keys) placed beside it.

Single-line view: a tree that only adds a supply to another one (its infeed links all land below the head of that tree) is drawn beside it. A link between two trees with a third tree drawn between them is an interrupted line: a short stub at each end naming the other end (its tag) and the link's label. Several feeds landing on one busbar each get their own tap on top of it, beyond its end, inside the frame of the board.

4.1 Interlocks (locks, interlocks)

locks[] (on any node and on any link) lists the interlock keys engaged by a device. Trapped-key principle: all the members (nodes and links) whose locks contain the same identifier form one interlock; with K keys, at most K members may be closed at the same time. A link and the device it carries are one member (their locks are merged).

  • A node is closed unless its normal_state is open (a transfer_switch engages its interlocked alternate position only when its normal_state is closed).
  • A link is closed unless it is normally_open or its device has normal_state: "open".

The optional document-level interlocks section gives the number of keys of an interlock (a key used in locks without a declaration has one key):

Field Required Description
key yes Identifier used in locks
keys no (default 1) Number of keys: maximum number of members closed at the same time
label no Description
kind no trapped_key, mechanical, removable_link, electrical

Typical uses: 1 key = mutually exclusive positions (removable links, changeover jumpers, either/or supplies, UPS maintenance bypass / UPS output); 2 keys for 3 breakers = two transformers and a bus coupler never paralleled ("2 of 3").

Example: feeder -QA selectable between busbars W1 and W2 by removable links. The default position is in the tree, the alternative position is an infeed link from the other busbar; both carry the key LA:

{"id": "W1", "type": "busbar", "children": [
  {"id": "X11", "type": "disconnector", "ref": "-X11", "normal_state": "closed", "locks": ["LA"],
   "children": [{"id": "QA", "type": "breaker", "ref": "-QA", "in_A": 250}]}]}
"links": [{"kind": "infeed", "from": "W2", "to": "QA", "normally_open": true,
           "device": {"type": "disconnector", "ref": "-X21", "normal_state": "open", "locks": ["LA"]}}],
"interlocks": [{"key": "LA", "kind": "removable_link", "label": "Feeder A: links on W1 or W2"}]

The rule core.interlock checks it (see §10); example 52 shows three such feeders.

5. Type registry (core 1.0)

The registry (src/uniwire/registry/core.json) gives, for each type, its category, the usual IEC 81346 letter (iec81346), the 2- or 3-letter IEC 81346-2:2019 class (iec81346_class, e.g. breaker → QAB, rcd → FBA, null if no class fits), the labels (English and French), the symbol and the CIM / IFC / IEC 61850 SCL mappings. The iec81346_class field only stores a class code. The full IEC 81346-2 class table (codes and headings) is available from the optional data package uniwire-data-iec81346 (pip install "uniwire[iec81346]", licensed CC BY-SA 4.0, separately from the Apache-2.0 library); once installed it is read with uniwire.registry.iec81346_table() (empty table otherwise).

Category Types and specific attributes
Sources grid (supply, un_V, ik_kA) · transformer (sn_kVA, u1_V, u2_V, ucc_pct, coupling, insulation) · generator (sn_kVA, p_kW, un_V, fuel) · ups (sn_kVA, autonomy_min, bypass) · pv_array (modules, module_W, strings, p_kW, voc_V, isc_A) · battery (capacity_kWh, un_V, technology) · inverter (kind string/central/micro/hybrid/battery, p_kVA, count, mppt) · meter (kind, in_A, bidirectional)
Protection / switching (common in_A, poles) breaker (curve B/C/D/K/Z/MA, icn_kA, frame_A, range, trip_unit, ir_A, isd_A, aux[], e.g. heating control-wire contact, dc) · rcd (idn_mA, idn_range_mA, rcd_type AC/A/F/B/A-SI/Hpi, delay) · rcbo (breaker + rcd) · main_breaker / AGCP (main incoming circuit breaker) (range_A "15-45", idn_mA, idn_range_mA, rcd_type, selective, icn_kA, subscribed_kVA) · fuse (fuse_class, size) · fuse_switch (fuse_A, fuse_class, size) · switch_disconnector (dc) · disconnector · contactor (function HC/power/lighting/load_shedding, coil_V, manual) · impulse_relay (coil_V) · thermal_relay (range_A, setting_A) · motor_starter (method dol/reversing/star_delta/soft_starter/vfd, p_kW) · transfer_switch (mode, interlock) · spd (spd_type 1/2/1+2/3, imax_kA, in_kA, up_kV, dc) · controller (function, symbol_text)
Connections / containers busbar (in_A, ik_kA, dimensions) · board (kind main/distribution/sub/ac_box/dc_box/mcc/switchboard/enclosure, ik_kA, own_sheet) · earth (resistance_ohm) · offpage (target): cross-reference to another sheet or document
Loads (common p_kW, p_max_kW, room) lighting (points) · socket (points, poles 2P+T / 3P+N+T…, socket_type) · heating (pilot_wire) · water_heater (volume_L) · cooking (kind hob/oven/range) · appliance (kind washing_machine/dishwasher/dryer/freezer/fridge) · motor (in_A, cos_phi, rpm, phases) · ev_charger (mode) · ventilation · shutter · load (symbol_text) · spare

Common enumerations: poles ∈ {1P, 1P+N, 2P, 3P, 3P+N, 4P}.

6. Quantities and units

  • A published file MUST contain numbers in the unit indicated by the field suffix: _A, _mA, _kA, _V, _kV, _kW, _kVA, _kWh, _W, _mm2, _m, _pct, _ohm, _Hz, _min.
  • All quantities are ≥ 0.
  • An implementation MAY accept strings as input ("16 A", "2,5 mm²", "0,03 A") or {"value": 30, "unit": "mA"} and MUST then convert them on output (uniwire normalize rewrites a document in its canonical form).

7. Views (views)

Field Default Description
id sld Identifier
kind single-line single-line or multi-line (power diagram, one line per conductor, §7.1)
title - Sheet title
root - Draw only the subtree of this node
paper / orientation A3 / landscape Sheet format. When paper is absent, a renderer may choose the smallest format that holds the drawing at full size (the reference library: A4 landscape when it fits, else A3)
direction down Direction of power flow: down, up (mirrored), right, left (the reference renderer draws right and left downwards and says so with the core.view-direction finding)
pitch_mm 20 Width of an outgoing feeder column, 10 to 40 (a value under 10 is read as 10, with a core.normalized note)
cartouche label, ref, protection, idn_mA, cable, p_kW Rows of the circuit schedule (among label, ref, protection, in_A, curve, icn_kA, idn_mA, rcd_type, poles, cable, section_mm2, length_m, p_kW, phase, room, points, and the additional rows of §3a, e.g. cable_ref "Cable tag"); an idn_mA value carried by a device upstream of the feeder (incomer, group RCD), not by its own protection, reads "30 mA (upstream)"
folio_split auto auto: split across sheets if needed (several trees side by side: groups of whole trees first, then sub-distribution boards on their own sheet, then busbars cut into continuation sheets; a way wider than a sheet, such as a distribution below a device rather than a board, has its branches drawn on sheets of their own, with off-page references at both ends); none: everything on one sheet, at whatever scale it needs
min_scale 0.7 Maximum reduction before splitting. With folio_split: auto no sheet is drawn below 0.6 (a smaller value is read as 0.6): below it the texts are too small to read on paper. The scale of each sheet is written in its title block (in a corner of the sheet when it has no title block)
annotations true Reference designation and characteristics next to the symbols
tag_field ref Displayed identifier: ref or part_number (diagrams that print only catalogue part numbers)
conductor_marks true Conductor-count strokes (IEC 60617: one stroke per conductor, or one stroke and the number) and phase of single-phase circuits on each outgoing feeder, on the line leaving each source / transformer, and below each switching device whose poles change the conductors of the line above it (not repeated lower in the same column). A neutral the device does not cut is shown apart: 3P+N → three strokes and +N, 4P → one stroke and 4; 3P gets +N only when circuits below use the neutral and its supply has one (never below a three-wire 3P network). One phase and the neutral is always one stroke and +N (L1+N when its phase is known), whatever the poles (1P, 1P+N, 2P); a line without a neutral (a 3P network, below a device that passes none) gets no +N, its conductors are counted. What a cable does not state is that of the line it leaves (below a two-pole device: its two conductors). PE is not counted
frames [] Enclosure frames {label, nodes[]} drawn around arbitrary nodes (cabinet, cubicle) when they do not form a board subtree
title_block true Sheet border and title block
first_folio, total_folios 1, - Numbering within a partial set of sheets ("sheet 1/3"). Drawn together, the views make one set: a view without first_folio follows the one before it, and so does a view whose sheets would take numbers already given. A view drawn on its own keeps the numbers it has in the set (title block, cross-sheet references, total)
show_pe true multi-line views: draw the protective conductor (PE)
auxiliaries false multi-line views: also draw the auxiliary devices (devices: controllers, terminal blocks, sensors, meters placed through links) and the control, interlock, trip, measure, data, key and earth links, as on the single-line diagram (§7.1)
color none Colour mode: conductors (multi-line: every conductor in its colour; single-line: single-phase feeders in their phase colour), phase (single-phase feeders by phase, phase cell of the schedule tinted), source (what each source (tree root) feeds in normal operation; normally-open alternative supplies in the colour of the source they come from, dashed), status (status of nodes and links, inherited downstream: existing grey, new black, future blue dashed, temporary orange, removed red; outside this mode a node of status future, and what inherits it, has "(future)" added to its label), voltage (MV > 1 kV AC, LV, ELV ≤ 50 V AC, DC). Strokes only: texts stay black, frames and earth / data links keep their colour; a legend of the colours used is drawn in a free corner of each sheet. Omitted: black drawing
palette - Colour overrides {key: "#rrggbb"} for the colour mode: conductor names (L1 … PE, PEN, L+, L-), source ids, status values, mv / lv / elv / dc
conductor_colors - Preset of the conductors mode: iec (IEC 60445: L1 brown, L2 black, L3 grey, N blue, PE green-yellow) or us (L1 black, L2 red, L3 blue (brown / orange / yellow from 480 V), N white drawn light grey, ground green). Omitted: us when installation.standard names the NEC / CEC, else iec
wire_marking - Wire marking rules (§7.2): scheme (manual, sequential, potential, pattern), pattern, start, step, prefix, suffix, per, power, keep_manual, order
wire_marks true with wire_marking Show the wire marks on the multi-line drawing (§7.2)
overrides {} Per id: label_offset [dx, dy] in mm, hide

A view never contains topology. Deleting all views does not change the meaning of the document.

7.1 View kinds

A document may declare several views, of either kind, e.g. "views": [{"id": "sld"}, {"id": "ml", "kind": "multi-line", "paper": "A3"}].

  • single-line (default): the single-line diagram, one line per circuit.
  • multi-line: the multi-line power diagram, derived from the same tree with no extra data: every circuit is drawn with one line per conductor (L1, L2, L3, N, PE, PEN, L+ / L- in DC) and every switching device with one contact per pole. The conductors of a node are deduced, in order of precedence, from its phase (a single-phase circuit taps that phase; without phase, L1), its poles (1P and 3P leave the neutral uncut, 1P+N / 3P+N add an unprotected neutral pole, 2P / 4P switch every live conductor), its cable cores (3G = L + N + PE, 4G = 3 L + PE, 5G = 3 L + N + PE), the number of phases of a motor, the system of a board or busbar and the usual connection of the load type, otherwise from upstream. The supply follows installation.system / grid.system and the earthing system: TN-C and TN-C-S carry a PEN, split into PE + N at the board flagged pen_split (by default the first board in TN-C-S); TN-S carries a PE from the source; TT and IT get their PE at the first board. A transformer starts a new system (neutral from the vector group, Dyn11 → N); a power supply feeds a DC pair (L+, L-). An inverter (or a UPS) has an AC side and a DC side: fed in AC, the batteries, PV arrays and DC boards below it are on its DC pair and its other children on its AC output; fed in DC (a PV array, a battery), it gives the AC conductors of the installation at its output. A DC link to an inverter/charger or a UPS lands on its DC pair. A star_delta motor starter on three phases adds the other ends of the motor windings, W2, U2, V2, from its delta contactor: they go down with the phases to the motor, drawn with its six terminals (U1 V1 W1, W2 U2 V2), and are carried by its cable (their wire marks under the cable marks keys U2, V2, W2).

Rendering of the reference implementation: busbars as one rail per conductor (named at their end); circuit breakers with the breaker cross on each protected pole, the poles linked by a dashed mechanical link; RCDs with a toroid around all live conductors; current transformers as a ring on each phase, a current shunt as a resistor in the one conductor it measures; fuses on each phase; transformers as two windings with their vector group; motors as M 3~ with terminals U V W and PE; loads as a box with one terminal per conductor; devices connected in parallel (voltage transformers and indicators, surge limiters, neutral impedances, insulation monitors, earthing switches) on taps beside the conductors they use; other types as a labelled box across their conductors. Without a colour mode the protective conductor is drawn dash-dot (with the conductor colours, solid green/yellow). Ratings and tags are written as on the single-line diagram, load descriptions under the loads, outgoing cables above them. Large documents are split into sheets like the single-line diagram. The power links outside the tree (transfer, bypass, parallel, tie, infeed) are drawn conductor by conductor, with an off-sheet reference when their other end is on another sheet. Every node of the tree is drawn whatever its type (a meter, a contactor, a controller in the tree); the auxiliary devices (devices), the other links and frames are not drawn in this view, unless auxiliaries is true: then the auxiliary devices and their links are drawn as on the single-line diagram (frames still not drawn).

7.2 Wire marking and wiring exports (part of UEP-0001)

This is the part of the 2.0 proposal UEP-0001 §3.3.2 and §3.5 that the current format can carry, with the same names and meaning, so that 2.0 extends it without breaking it.

Wires in the current format. Without a wires[] section, the wires are the conductors of the cables of the power tree: the cable of a node (node.cable) feeds it from its parent and carries the conductors of the node's input as derived for the multi-line view (§7.1). A conductor that starts in the node (the PE at the main earthing terminal of a TT installation) is not part of the cable; the N and PE of a board that splits a PEN arrive on one PEN core. Each conductor has the identifiers 2.0 gives to implicit wires: cable <node id>.cable, wire <node id>.cable.<conductor> (M1.cable.L1). Its from end is the parent node, its to end the node.

Manual marks. cable.marks gives the marks (ferrule texts) of the conductors of a cable, by conductor: "marks": {"L1": "1L1", "L2": "1L2", "L3": "1L3", "PE": "PE"}. This field has no counterpart in UEP-0001, where marks are written on wires[].mark; it is their place in the current format, and a 2.0 migration moves them there.

Marking rules: views[].wire_marking (and wire_marks, default true when wire_marking is set, to show or hide the marks on the drawing):

Field Default Description
scheme manual manual: only the marks of the document (cable.marks). sequential: one number per conductor. potential: one number per potential (net), shared by its conductors. pattern: marks built from pattern
pattern - Template of pattern: {circuit} (circuit of the feeder), {conductor}, {ref} (tag of the from node), {from}, {to} (tags of the two ends), {cable} (cable ref, else its id), {n} (sequence number). {from_port}, {to_port}, {potential}, {strip}, {terminal} are reserved for 2.0 and empty in the current format; other tokens are errors. Example "{circuit}-{conductor}" → C3-L1
start, step 1, 1 First number and increment
prefix, suffix "" Added around generated numbers ({n} included)
per document Numbering restarts per document, sheet (multi-line sheet) or enclosure (of the from end: an enclosures[] entry, else the board)
power conductor sequential and potential schemes: conductor marks the power conductors with their name (L1, N, PE), number numbers them, none leaves them unmarked (also for pattern). As every wire of the current format is a power conductor, numbering needs "power": "number"
keep_manual true cable.marks are kept; generated numbers skip the values they use
order layout layout: sheet, then column, then top to bottom in the multi-line drawing of the view; document: order of the tree

Marking is deterministic: the same document and view always give the same marks. Potentials (potential scheme) follow UEP-0001 §3.4.2: a conductor keeps its net through boards, busbars, meters and any device that does not switch it (an uncut neutral, the PE); each pole of a switching device, a drive, a transformer or converter, and the neutral created by a PEN split start a new net.

Display. In the multi-line view, each marked conductor of a cable carries its mark along the line, left of it, just above the node the cable feeds (for a cable held by a device above a load: above the load, where the cable text is written). When an edge between two devices is too short for its marks, they are carried only in the SVG (data-uw-mark) and in the exports. The single-line view is unchanged.

Cable tag. cable.ref is written with the cable text: in the cable row of the circuit schedule (W12 · 4G2.5, unless the view also has a cable_ref row, header "Cable tag"), and before the cable designation in the multi-line view.

Freezing. uniwire marks FILE --view ID --write writes the generated marks into cable.marks, so that later edits do not renumber printed ferrules (with keep_manual, the view then gives the same marks).

Exports (CSV, UTF-8, comma separated, stable English column names, UEP-0001 §3.5.2):

  • wire list uniwire wires FILE [--view ID]: wire_id, mark, from, from_display, from_enclosure, to, to_display, to_enclosure, potential, conductor, section_mm2, color, cable, core, length_m, status (in the current format every row is an implicit power connection; potential, color, core are empty);
  • wire marker list uniwire markers FILE [--view ID]: mark, wire_id, end, terminal_display, section_mm2, color, enclosure, quantity, one row per end of a marked wire;
  • cable schedule uniwire cables FILE: cable_id, ref, designation, cores, section_mm2, length_m, from_enclosure, to_enclosure, from, to, cores_used, cores_spare, status (tree cables <node id>.cable, then link cables <link id or index>.cable).

Without --view, the rules of the first view that declares wire_marking apply (none: manual marks only).

Control side (same CSV conventions), from the PLCs and terminal blocks of §3b:

  • I/O list uniwire io FILE: plc, plc_display, slot, module, module_kind, io_type, channel, address, direction, signal, un_V, label, device, device_display, device_port, terminal, link_kind, cable, status, one row per channel of each I/O module (connected or spare), then the other links that address the PLC;
  • terminal strip table uniwire terminals FILE [--view ID]: strip, strip_display, terminal, function, from, from_display, from_port, from_mark, from_cable, to, to_display, to_port, to_mark, to_cable, link_kind, label, one row per terminal of each terminal block (those listed in terminals, then those named by link ports).

7.3 Symbol sets

symbols names the set of symbols the document is drawn with. iec (the default) is the set built into the reference library, after IEC 60617. Other sets are registered by packages installed beside the library (entry point group uniwire.symbol_sets, see the API documentation); a set may give only some symbols, the others are drawn from iec. A set that is not installed does not refuse the document: it is drawn with the iec symbols and the rule core.symbol-set-unknown says so. Like views, the symbol set never changes the meaning of the document. In multi-line views, switching and protective devices are drawn pole by pole by the renderer: a symbol set does not change them.

8. Derived graph form

uniwire graph file.uniwire.json produces the canonical "network" form:

  • components[]: each node with its terminals (in, out, in2 for the transfer switch), its attributes and its mappings (cim, ifc, scl); each cable becomes a cable component;
  • connectivity_nodes[]: connectivity nodes (cn:<parent id>), one busbar = a single node;
  • signals[]: control connections.

This form is the starting point for exports to calculation tools (pandapower, power-grid-model), CIM/CGMES, IEC 61850 SCL or IFC4 (IfcDistributionPort + IfcRelConnectsPorts).

9. Extensibility and versions

  • Every object accepts ext: {"<vendor prefix>": {...}}. A tool MUST preserve the extensions it does not understand.
  • Everywhere else, undefined properties are forbidden (additionalProperties: false).
  • Versions: 1.y.z. A minor version only adds optional fields or enumeration values. An incompatible change bumps the major version and the $id path (/v2/).
  • While the format is a draft (1.0.0-draft), a reader accepts only that version. The rules below apply once 1.0.0 is stable.
  • A reader MUST accept any 1.y.z document. A document written for a newer minor version than the reader supports loads as long as it uses only fields the reader knows; otherwise its unknown fields are rejected like any other, and the reader SHOULD say that a newer version is needed.

10. Validation

  1. Structure: JSON Schema (schema/uniwire.schema.json), usable with any validator. The node union is dispatched by if/then on type (for performance on deep trees).
  2. Integrity (reference implementation): templates exist and have the same type, identifiers are unique, link endpoints exist.
  3. Business rules per profile (uniwire check):
  4. core (always): unique reference designations per board, downstream rating ≤ upstream rating, consistency of links / transfer switches; core.interlock (§4.1): error when more members of an interlock are closed in normal operation than it has keys (or when a key is declared twice), warning when a declared interlock is used by fewer than 2 members, or when an undeclared locks key is used by a single member (it interlocks nothing);
  5. nfc15100: checks of a French low-voltage installation under NF C 15-100 (2002 edition with its 2005 update and amendments A1 to A5, the version that gives presumption of conformity under the order of 3 August 2016). The rules of dwellings (part 10-1 of amendment A5, marked dwelling) apply when installation.premises is dwelling or absent; for other premises only the general rules apply (30 mA on socket-outlets up to 32 A and charging points, selectivity, earth electrode resistance in TT), and the cable table becomes a warning to size the cable for its installation method (part 5-52, guide UTE C 15-105). Each rule carries a source (document and clause) and a confidence (high / medium), available in uniwire.rules.RULE_INFO; each Finding repeats the source. Rules, checks and levels: Rules.

  6. vde0100 (optional, must be declared in profiles): German installations (DIN VDE 0100): 30 mA RCDs for socket-outlets, the lighting of dwellings and bathrooms, charging points, surge protection, PEN cross-section. Rules, checks and levels: Rules.

  7. iec60364 (optional, must be declared in profiles): current-carrying capacity of cables and the 30 mA RCD of socket-outlets.

    • Rule iec60364.iz
    • Condition: the cable specifies section_mm2, material, insulation and install.
    • Check: the rating of the protective device supplying the cable does not exceed Iz. The rating used is ir_A, otherwise fuse_A, otherwise in_A. Iz is multiplied by parallel.
    • Level: warning, never error. The message cites the source.
    • Data: registry/data/iz_iec60364.json, readable with uniwire.registry.iz_iec60364().
    • Formulas a * S^m after IEC 60364-5-52, never above its values.
    • Reference conditions: 30 °C in air; 20 °C and 2.5 K·m/W in the ground.
    • Coverage
    • Copper and aluminium, PVC or XLPE (PR and EPR are treated as XLPE).
    • Installation methods A1, A2, B1, B2, C, D1 (also written D-duct), D2, E, F, with 2 or 3 loaded conductors.
    • The cross-sections of the tables: 1.5 to 300 mm², from 2.5 mm² for aluminium, from 25 mm² for F. Outside them, the rule emits an info.
    • Number of loaded conductors: 3 if the protective device is 3P, 3P+N or 4P. Otherwise 2. If the poles are not specified, installation.system is used.
    • Ambient temperature: the cable's ambient_C corrects Iz by sqrt((θmax − θ) / (θmax − θref)), θmax 70 °C for PVC and 90 °C for XLPE, from 10 °C up to 60 °C (PVC) or 80 °C (XLPE); above, Iz is not checked (info). Without ambient_C, 40 °C in air and 20 °C in the ground.
    • Grouping: grouped, with arrangement (in air, bunched when not given) or supports (2 or 3 stacked trays or ladders), or spacing_m in the ground (D1, D2; the cable is taken as single-core in its ducts when cores reads 1x), applies the grouping factor: up to 20 circuits in air, 9 per stacked support, 6 in the ground.
    • Soil: soil_resistivity_K_m_W corrects Iz in the ground from 0.5 to 3 K·m/W (a lower value is taken as 0.5).
    • Harmonics: third_harmonic_pct on a three-phase circuit with a neutral (3P+N, 4P) multiplies Iz by 1 / sqrt(1 + 4 h²), h the content, up to 50 %; by 1 / sqrt(1 + 7 h²) up to 15 % when the neutral is smaller (neutral_section_mm2).
    • The factors are formulas of the same file, never above those of IEC 60364-5-52. Beyond their range, Iz is not checked (info).
    • Rule iec60364.iz-estimate: a cable giving section_mm2 without its material, insulation or install is estimated: copper and PVC unless stated, the most favourable method in air (A1 to F) unless stated, at 30 °C. A rating above that Iz: warning. One info lists the cables estimated, so that an empty result is not read as a checked cable.
    • Rule iec60364.rcd-30mA (IEC 60364-4-41:2005+AMD1:2017, 411.3.3 and 411.3.4): a socket-outlet up to 32 A, in all premises, and a lighting circuit when installation.premises is dwelling, protected by an RCD of at most 30 mA: error. Not applied below an isolation transformer feeding an IT system (medical IT, IEC 60364-7-710), nor when the document also declares nfc15100 or vde0100 (they check it).
  8. enedis (optional, must be declared in profiles): connection of a low-voltage installation to the French public network (NF C 14-100, Enedis technical reference Enedis-NMO-RAC_001E), separate from nfc15100, which starts downstream of the service main breaker. Rules enedis.connection (power tiers of the connection), enedis.agcp-setting (the setting in_A of the service main_breaker carries the connection power: 0.2 kVA per ampere single-phase, 0.6 kVA per ampere three-phase, 60 A at most), enedis.agcp-rcd (500 mA residual-current service breaker recommended), enedis.production (injection and installed power limits, storage included), enedis.service-cable (length and section of the individual service cable) and enedis.decoupling (decoupling protection of production and storage inverters). Applies only to a low-voltage supply from a grid source. Details and levels: Rules.

These rules are consistency checks: they do not replace the standard.

11. History

Version Changes
1.0 (draft) 1.0.0-draft: the format under construction, not yet stable

12. Complete minimal example

{
  "uniwire": "1.0.0-draft",
  "installation": { "earthing": "TT", "system": "1P+N", "un_V": 230 },
  "sources": [
    { "type": "grid", "label": "Grid", "children": [
      { "type": "main_breaker", "ref": "-Q0", "range_A": "15-45", "in_A": 45, "idn_mA": 500, "selective": true,
        "children": [
          { "type": "rcd", "ref": "-Q1", "in_A": 40, "idn_mA": 30, "rcd_type": "A", "children": [
            { "type": "breaker", "ref": "-Q11", "in_A": 16, "curve": "C",
              "cable": { "cores": "3G", "section_mm2": 1.5 },
              "children": [ { "type": "lighting", "label": "Lighting", "points": 6 } ] },
            { "type": "breaker", "ref": "-Q12", "in_A": 20, "curve": "C",
              "cable": { "cores": "3G", "section_mm2": 2.5 },
              "children": [ { "type": "socket", "label": "Sockets", "points": 8 } ] }
          ] }
      ] }
    ] }
  ]
}

See examples/ for complete documents, from a dwelling board to industrial installations.