# uniwire > uniwire ("electrical diagrams, as code") is an open standard JSON format (`*.uniwire.json`, format 1.0.0) to describe electrical installations (drawn as single-line and multi-line diagrams), with a reference Python library (`pip install uniwire`, Apache-2.0) that validates documents, checks them against rule profiles (NF C 15-100, IEC 60364, PLC), produces bills of materials and draws SVG / PDF sheets. A document is a power tree (sources -> devices -> loads, each node in its parent's `children`) plus `links` for everything outside the tree. Layout is automatic. For assistants: the reference card of the format (generated from the model) follows this file at https://uniwire.sh/llms.txt, so one read gives you everything needed. Locally, `uniwire card` prints the same card. ## How to produce a document Use the first way that works for you: 1. **The library** (installed, or installable with `pip install uniwire`; pure Python, needs only `pydantic`, plus `reportlab` for PDF): build the document, then run `uniwire check FILE`; `uniwire link FILE` prints the link below. Use `uniwire describe FILE` to read a document with its stable ids and `uniwire patch FILE OPS.json` to edit it by id. 2. **uniwire MCP tools**, if they are connected to you (server `uniwire-mcp`, extra `uniwire[mcp]`): get_reference_card, validate, check, describe, apply_patch, render, bom. Their results carry `viewer_url`: that is the link to give. 3. **Otherwise, write the JSON yourself** following the reference card: one JSON document, valid JSON, no comments, values in the forms the card gives (`"poles": "1P+N"`, `"cores": "3G"`, quantities as plain numbers). Re-read the card's common mistakes before answering. Never say a document passed uniwire checks unless the library or the MCP tools actually returned that result. When you report check results, say once, in one sentence, that they are automatic checks of the document, not a conformity certificate, and that a qualified electrician must verify the installation; do not repeat it. In every case, give the user the link below. ## Show the user the drawing (no install) The link opens the document in the web editor: drawing (single-line and multi-line), rule findings, PDF and SVG downloads. If you can run Python, build it like this (no network needed; the document stays in the part after `#` and is sent nowhere): ```python import base64, json, zlib text = json.dumps(document, indent=1, ensure_ascii=False) # document: the uniwire JSON as a dict c = zlib.compressobj(9, zlib.DEFLATED, -15) # raw deflate link = "https://uniwire.sh/viewer/#doc=" + base64.urlsafe_b64encode(c.compress(text.encode()) + c.flush()).decode().rstrip("=") ``` When the user asks for a PDF, add `&download=pdf` at the end of the link: the editor then also downloads the PDF drawn by uniwire (do not draw a PDF yourself). Write the full link directly in your reply as a clickable Markdown link, e.g. `[Open the drawing](https://uniwire.sh/viewer/#doc=...)`: never put it in a file or behind a download. Without Python, ask the user to paste the JSON into https://uniwire.sh/viewer/. ## Check and draw - [Web editor](https://uniwire.sh/viewer/): paste a document to validate, check and draw it in the browser; or open `https://uniwire.sh/viewer/#doc=` to show a document directly (recipe above) - [Hosted MCP server](https://mcp.uniwire.sh/mcp): streamable HTTP endpoint with the validate, check, render and export tools ## Docs - [In your assistant](https://uniwire.sh/docs/assistants/): hosted MCP server setup for ChatGPT, Claude, Cursor, VS Code; example requests - [LLM tools](https://uniwire.sh/docs/llm/): reference card, describe, patch, MCP server setup, evaluations - [Specification](https://uniwire.sh/docs/SPEC/): the format, normative - [Python API and CLI](https://uniwire.sh/docs/api/) - [Code-first API](https://uniwire.sh/docs/build/): build documents in Python - [Rules](https://uniwire.sh/docs/rules/): rule profiles and their sources ## Reference - [JSON Schema](https://uniwire.sh/schema/v1/uniwire.schema.json): draft 2020-12 - [Type registry](https://github.com/uniwire-dev/uniwire/blob/main/src/uniwire/registry/core.json): node types, categories, IEC 81346 letters, CIM / IFC mappings - [Examples](https://uniwire.sh/viewer/examples/index.json): 52 documents, each at `https://uniwire.sh/viewer/examples/` (dwellings, commercial, industrial, PV, EV, UPS, MV/LV substations, PLCs) ## Optional - [Evaluation tasks](https://github.com/uniwire-dev/uniwire/tree/main/evals/llm): 15 tasks that score model-written documents, with a runner that makes no network calls - [Changelog](https://github.com/uniwire-dev/uniwire/blob/main/CHANGELOG.md) --- # uniwire 1.0.0 reference card uniwire is an open JSON format for electrical installations, drawn as single-line and multi-line diagrams (files `*.uniwire.json`). A document describes the installation as a power TREE (sources -> devices -> loads) plus LINKS for everything that is not a parent/child feed. Layout is automatic: never give coordinates. ## Document skeleton Top-level keys (only `sources` is required): - `$schema`: "https://uniwire.sh/schema/v1/uniwire.schema.json" - `uniwire`: "1.0.0" - `profiles`: Rule profiles: 'nfc15100'... - `meta`: title, project, client, site, company, author, checked_by, date, revisions[], lang, drawing_number, scale, contributors[], notes[] - `installation`: earthing(Earthing), system(System), un_V, f_Hz, supply, subscribed_kVA, planned_kVA, ik3_kA, ik1_kA, uln_V, du_max_pct, earth_resistance_ohm, surface_m2, standard, premises(dwelling|commercial|office|industrial|public|agricultural|other) - `templates`: Reusable attribute templates, referenced by 'use' in nodes - `sources`: Tree roots (power sources) - `devices`: Auxiliary devices outside the power tree (relays, CTs, insulation monitors (CPI), voltage presence indicators (VPIS)...), connected by links - `enclosures`: Addressable enclosures - `links`: links outside the tree (see Links) - `interlocks`: Interlock declarations: number of keys per 'locks' identifier - `views`: rendering preferences (see Views) ## Principles - Each node is fed by its parent and feeds its `children` (list). Roots go in `sources`. A node with several children is drawn as a busbar; a `board` frames its whole subtree. - Anything outside the tree (2nd source on a transfer switch, bus tie, control/trip/measure wiring, data bus, earth bonding, key interlock) is a `links` entry `{kind, from, to}` using node ids. - `id` = stable machine identifier (pattern `^[A-Za-z_][A-Za-z0-9_.-]*$`, unique, generated from `ref` or type when missing); links, enclosures, `view.root` and `frames` reference ids. `ref` = displayed tag (`-Q1`, `KM1`), may repeat across boards. - Quantities are plain numbers in the unit given by the field-name suffix: `in_A: 16`, `idn_mA: 30`, `section_mm2: 2.5`, `p_kW: 3.6`, `un_V: 400`, `length_m: 25`. - `cable` on a node = the cable run from its parent to this node (`{cores: "3G", section_mm2: 2.5, material, length_m, designation, install}`). - `templates` holds named attribute sets; a node with `use: "C16"` inherits them (its own fields win; the template `type` must match). - Unknown fields are rejected (typos fail). Put vendor data in `ext: {vendor: {...}}`. - `cable` fields: designation, cores, section_mm2, pe_section_mm2, neutral_section_mm2, parallel:int, material(Material), length_m, install, insulation(PVC|PR|EPR|XLPE), du_pct, ref, kind(cable|busway|overhead|bar|trunk), conductors, pen:bool, cpr_class, size_awg, raceway, ambient_C, status(Status), marks ## Fields common to every node id, ref, label, use, status(Status), phase(Phase), location, manufacturer, part_number, product{}, note, external:bool, count:int, circuit, un_V, uln_V, ib_A, p_kW, q_kvar, cos_phi, priority(essential|non_essential|safety|standby), normal_state(open|closed), locks[], notes[], point_no:int, cable{}, children[] Extra fields common to switching/protective devices (marked *): in_A, poles(Poles), frame_A, range, ue_V, icn_kA, icu_kA, icw_kA, aux[], mounting(fixed|plug_in|withdrawable), lockable:bool Extra fields common to loads (marked +): p_max_kW, room ## Node types by category (`type` label: specific fields) ### source - `grid`: Utility grid. Public distribution network / point of supply (point de livraison). - supply: 'Tarif Bleu', 'Tarif Jaune', 'HTA 20 kV', 'Enedis C5'... - ik_kA: Maximum Ik at the point of supply - scc_MVA: Short-circuit power of the upstream network, in MVA - system(System) - `transformer`: Transformer - sn_kVA: Rated power - u1_V: Primary voltage - u2_V: No-load secondary voltage - ucc_pct: Short-circuit (impedance) voltage - coupling: Vector group: 'Dyn11', 'Yzn11'... - insulation(oil|dry) - kind(power|auto|earthing|isolation|bank) - u1_alt_V: Second primary voltage (dual-voltage 15/20 kV) - `generator`: Generator - sn_kVA - fuel - prime_mover: 'diesel', 'turbine', 'wind', 'hydro'... - `ups`: UPS. Uninterruptible power supply (UPS, ASI / onduleur). - sn_kVA - autonomy_min - bypass:bool: Static / maintenance bypass present - `pv_array`: PV array. Photovoltaic array (champ photovoltaïque). - modules:int - module_W: Peak power of one module (Wp) - strings:int - voc_V - isc_A - `battery`: Battery - capacity_kWh - technology - `inverter`: Inverter. PV inverter / micro-inverter / hybrid inverter / charger. - kind(string|central|micro|hybrid|battery|charger) - p_kVA: Apparent power per unit - mppt:int - protection: Built-in interface (decoupling) protection (DIN VDE 0126, RI...) - `dc_converter`: DC converter. DC converter: PV optimizer, MPPT controller, DC/DC, solar charge controller. - kind(optimizer|mppt|dcdc|charge_controller) - p_kVA - in_A ### measure - `meter`: Meter. Meter / metering (compteur). - kind: 'Linky', 'electronic', 'CT', 'sub-metering'... - in_A - bidirectional:bool - `instrument_transformer`: Instrument transformer. Instrument transformer: CT, VT, toroid. In series in the tree or as an auxiliary device (``devices``). - kind(ct|vt|toroid|combined) - ratio: '600/5 A', '20000/100 V' - accuracy: Accuracy class: '0.5', '5P10', 'C100' - burden_VA - `voltage_indicator`: Voltage presence indicator. Voltage presence indicator (VPIS / capacitive dividers). - `insulation_monitor`: Insulation monitoring device. Insulation monitoring device (IMD) of an IT system. - range ### protection - `breaker`*: Circuit breaker. Circuit breaker: modular, moulded-case or air circuit breaker. - curve(Curve) - trip_unit: Trip unit: 'Micrologic 2.2', 'TM-D', 'LSIG'... - ir_A: Long-time / thermal setting - isd_A: Short-time / magnetic setting - ii_A: Instantaneous setting - tsd_s: Short-time delay - gf_A: Ground-fault protection threshold (GF) - selective:bool: Selective circuit breaker (SLS) - `rcd`*: Residual current switch. Residual-current device or standalone residual-current unit. - idn_mA: Sensitivity IΔn - idn_range_mA: IΔn setting range, in mA: '30-3000' - rcd_type(RcdType) - delay: 'S' (selective), 'inst', 'retardable' (adjustable delay), or delay in ms - `rcbo`*: RCBO. RCBO: overcurrent + residual-current protection. - curve(Curve) - idn_mA - idn_range_mA: IΔn setting range, in mA: '30-3000' - rcd_type(RcdType) - delay - rcd_in_A: Rating of the associated residual-current add-on block (Vigi), if different - `main_breaker`*: Main breaker. Service main breaker (incoming device of a dwelling, e.g. the French AGCP). - range_A: Setting range: '15-45', '30-60' - idn_mA - idn_range_mA: IΔn setting range, in mA - rcd_type(RcdType) - selective:bool: Selective residual-current device (type S) - subscribed_kVA: Associated subscribed / setting power (e.g. 9 kVA) - `fuse`*: Fuse - fuse_class: 'gG', 'aM', 'gPV'... - size: Size: '10x38', '22x58', 'NH00'... - `fuse_switch`*: Fuse switch-disconnector. Fuse switch-disconnector / fuse-carrier disconnector. - fuse_A: Fuse rating - fuse_class - size - `thermal_relay`: Overload relay. Thermal overload relay for motor protection (relais thermique). - range_A: Setting range: '4-6' - setting_A - `spd`: Surge protective device. Surge protective device (parafoudre). - spd_type(1|2|1+2|3) - imax_kA - in_kA - up_kV - uc_V: Maximum continuous operating voltage Uc - poles(Poles) - dc:bool - `protection_relay`: Protection relay. Protection relay (ANSI 50/51, 27/59, Vigirex residual-current relay, RI interface protection...). - functions[]: Functions: '50/51', '51N', 'I>', 'RI'... - settings: Printed settings: 'I> 0,6 s ; I>> 0,1 s' - idn_mA: Residual-current threshold (Vigirex relay) - `surge_limiter`: Surge limiter. Surge limiter (Cardew) between neutral (or phase) and earth in IT systems. - un_rating_V ### switching - `switch_disconnector`*: Switch-disconnector. Switch-disconnector. - dc:bool: Device for direct current - `disconnector`*: Disconnector. Disconnector, without on-load breaking capacity. - `contactor`*: Contactor - function(HC|power|lighting|load_shedding|grid_relay|interface|other) - coil_V - manual:bool: Manual override 0/1/Auto - `impulse_relay`*: Impulse relay. Impulse relay. - coil_V - `motor_starter`*: Motor starter. Integrated motor starter (motor circuit breaker, starter, variable-speed drive). - method(dol|reversing|star_delta|soft_starter|vfd) - `transfer_switch`*: Transfer switch. Transfer switch (normal / standby source). The 2nd source arrives through a 'transfer' link. - mode(manual|automatic) - technology(electromechanical|static): 'static' = STS - interlock(mechanical|electrical|both) - `earthing_switch`: Earthing switch. Earthing switch. - icw_kA - ue_V ### control - `controller`: Controller. Control device drawn as a labelled box: load shedder, pilot-wire controller, time switch, day/night relay, energy manager... - function: 'load shedder', 'pilot wire', 'time switch', 'EMS'... - symbol_text: Short text inside the box - in_A: Contact rating / rated current - poles(Poles) - `plc`: Programmable controller. Modular programmable logic controller (WAGO 750/PFC, Siemens S7-1200/ET 200SP/LOGO!, Schneider M241/TM3...). Modules are ordered sub-components; channels are addressed through link ports (``from_port`` / ``to_port`` = 'slot.channel', e.g. '3.1'). - role(controller|coupler|expansion|hmi): 'coupler' = remote I/O head on a fieldbus - 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 slot order - ip_address ### converter - `power_supply`: Power supply. Power supply (switch-mode AC/DC, control transformer): 230 V AC -> 24 V DC. - u1_V: Input voltage - u2_V: Output voltage - output(DC|AC) - in_A: Rated output current - p_W: Rated power - redundant:bool ### conductor - `busbar`: Busbar. Explicit busbar (otherwise implicit as soon as a node has several children). - in_A - ik_kA - dimensions: '28x10', 'comb 63 A'... - kind(busbar|busway|comb): 'busway' = prefabricated busbar trunking - material(Material) - system(System) - earthing(Earthing) - `earth`: Earth electrode - resistance_ohm - `neutral_impedance`: Neutral earthing impedance. Neutral earthing impedance (impedance-earthed IT, neutral-point coil). - impedance_ohm - `terminal_block`: Terminal block. Terminal block / distribution block / connection point. - terminals: Terminal numbers: 'X1.1-X1.12' - `junction_box`: Junction box. Junction / tap / pull box, cable joint, manhole. - kind(junction|pull|tap|manhole|vault|service_end) - `connector`: Connector. Pluggable connector (MC4, connection plug / socket, cable connector). - kind: 'MC4', 'Wieland', 'plug 3P+N+T 32 A'... - in_A - `earth_bar`: Earth bar. Main earthing terminal / bar, PE bar or equipotential bar. - kind(main_earth|pe_bar|equipotential|neutral_bar) ### container - `board`: Distribution board. Distribution board / cabinet / enclosure: container drawn as a dashed frame. - kind(main|distribution|sub|ac_box|dc_box|mcc|switchboard|enclosure|panelboard|pdu|substation) - in_A: Rated current of the board / busbar - ik_kA: Maximum Ik at the busbar - ik1_kA: Minimum Ik (Ik1) at the busbar - system(System) - earthing(Earthing): Earthing system specific to the board (downstream of a transformer, local IT...) - ways:int: Number of outgoing ways / modules - ip: Ingress protection rating: 'IP30', 'IP65 IK08' - form: Form of internal separation: '2b', '4a' - own_sheet:bool: Force rendering on a dedicated sheet - pen_split:bool: TN-C-S: the PEN conductor is split into PE + N at this board (by default, the first board of a TN-C-S installation) ### connector - `offpage`: Off-page reference. Off-page reference to / from another sheet or document (drawn as a cross-reference arrow). - target: Destination: 'sheet 2', 'DB Hall', 'doc. ELEC-04'... ### load - `lighting`+: Lighting - points:int: Number of lighting points - `socket`+: Socket outlets - points:int: Number of socket outlets - poles(2P|2P+T|3P|3P+T|3P+N|3P+N+T): Socket polarity (T = earth contact) - in_A: Socket rated current (16 A, 32 A) - socket_type: '2P+E 16 A', '3P+N+E 32 A', 'dedicated'... - `heating`+: Heating - pilot_wire:bool - `water_heater`+: Water heater - volume_L - `cooking`+: Cooking - kind(hob|oven|range|other) - `appliance`+: Appliance - kind(washing_machine|dishwasher|dryer|freezer|fridge|other) - `motor`+: Motor - in_A - rpm - phases(1|3) - `ev_charger`+: EV charger. Electric vehicle charging equipment (EVSE). - mode(2|3|4) - `ventilation`+: Ventilation - `shutter`+: Shutters - `load`+: Load. Generic load. - symbol_text - `spare`: Spare. Spare / free way (possibly pre-equipped: rating, poles). - in_A - poles(Poles) - frame_A ## Other objects - `product{}` (node): manufacturer, part_number, range, description, ean, quantity:int, url, accessories[] - `plc.modules[]` / `plc.onboard[]`: slot:int, kind(ModuleKind), part_number, product{}, label, channels:int, un_V, rating_A, signal, protocol, channel_labels - `enclosures[]`: id, kind(cabinet|cell|box|room|zone|substation|boundary|…), ref, label, cell_type, position:int, nodes[], parent, un_V, ip, form Addressable enclosure: cabinet, MV (HTA) cell, box, room, zone, property boundary. Unlike ``board``, it only contains the listed nodes. - `views[].frames[]`: label, nodes[] Enclosure frame drawn around a list of nodes (cabinet, box, switchgear cell) when it does not match a ``board`` subtree. ## Enumerations - Poles: 1P | 1P+N | 2P | 3P | 3P+N | 4P - Curve: B | C | D | K | Z | MA - RcdType: AC | A | F | B | A-SI | Hpi | G - Phase: L1 | L2 | L3 | L1L2 | L2L3 | L1L3 | L1L2L3 - Status: new | existing | spare | future | removed - Earthing: TT | TN | TN-C | TN-S | TN-C-S | IT - System: 1P+N | 2P | 3P | 3P+N | DC | split-phase - Material: Cu | Al - LinkKind: transfer | tie | bypass | parallel | infeed | earth | control | interlock | trip | measure | data | key - ModuleKind: cpu | coupler | power_feed | power_supply | di | do | ai | ao | relay_out | mixed_io | counter | temperature | power_measurement | comm | safety | motor | end | other ## Links Link outside the tree. * ``transfer``: 2nd source arriving on a transfer switch (``to`` = transfer_switch); * ``tie``: coupling between two busbars (``device`` = bus-tie device); * ``bypass`` / ``parallel``: additional power connection; * ``control`` / ``interlock`` / ``trip`` / ``measure``: control, interlocking, tripping and metering links (drawn dashed); * ``infeed`` (additional supply to a node: 2nd incomer, MV (HTA) ring, back-feed), ``earth`` (protective conductor / equipotential bonding), ``data`` (communication bus, TIC teleinfo, Modbus), ``key`` (key-lock interlocking, ``key`` = key identifier). fields: id, kind(LinkKind), from, to, label, device, cable{}, normally_open:bool, locks[], key, from_port, to_port, protocol, status(new|existing|future|removed|temporary) ## Interlocks and locks A node or link lists the keys it engages in `locks: ["K1"]`; `interlocks: [{key, keys, kind}]` declares how many members sharing a key may be closed at once (default 1 = mutually exclusive). `normal_state` (nodes) / `normally_open` (links) give the normal position. `interlocks[]` fields: key, keys:int, label, kind(trapped_key|mechanical|removable_link|electrical) Interlock declaration: the nodes and links whose ``locks`` contain ``key`` form one interlock. Trapped-key principle: with ``keys`` keys, at most ``keys`` members may be closed at the same time (1 = mutually exclusive positions: removable links, changeover jumpers, either/or supplies; 2 = "2 of 3" transformer / bus-tie scheme...). A key used in ``locks`` without a declaration has one key. ## Views (optional; rendering preferences) id, kind(single-line|multi-line), title, root, paper(A4|A3|A2|A1|A0), orientation(landscape|portrait), direction(down|up|right|left), pitch_mm, cartouche[](label|ref|protection|in_A|curve|icn_kA|idn_mA|…), folio_split(auto|none), min_scale, annotations:bool, tag_field(ref|part_number), conductor_marks:bool, frames[], title_block:bool, first_folio:int, total_folios:int, show_pe:bool, color(none|conductors|phase|source|status|voltage), palette, conductor_colors(iec|us), wire_marking{}, wire_marks:bool, overrides cartouche values: label, ref, protection, in_A, curve, icn_kA, idn_mA, rcd_type, poles, cable, section_mm2, length_m, p_kW, phase, room, points, circuit, ib_A, cos_phi, cable_type, cable_ref, install, frame_A, count, un_V ## Rule profiles (`profiles`; `core` always applies) - `core`: 8 rule(s) - `iec60364`: 1 rule(s) (iec60364.iz) - `nfc15100`: 9 rule(s) (nfc15100.dedicated-circuit, nfc15100.ev-rcd, nfc15100.heating, nfc15100.lighting-rating, nfc15100.points, nfc15100.rcd-30mA, nfc15100.rcd-circuits, nfc15100.rcd-count, nfc15100.rcd-type-A, nfc15100.section, nfc15100.selectivity) ## Common pitfalls - `children` is always a list of node objects; never put ids there. Links use ids, not refs. - Never write units in values (`"16 A"`): use the suffixed field (`in_A: 16`); RCD sensitivity is `idn_mA` (30, not 0.03). - `curve` belongs to breaker/rcbo, `rcd_type` to rcd/rcbo/main_breaker, `idn_mA` to residual-current devices; `poles` uses the Poles enum ("1P+N", not "2 poles"). - Single-phase circuits on a three-phase network: set `phase` (L1/L2/L3). - Cable cross-section goes in `cable.section_mm2`, cores in `cable.cores` without the section ("3G", "5G", "4x"). - A transfer switch receives its 2nd source through a link `{kind: "transfer", from: , to: }`; the 2nd source is another root of `sources`. - Give an explicit `id` to every node you will reference (links, patches). Keep ids stable when editing. - Auxiliary devices outside the power tree (relays, CTs, IMDs) go in `devices` and connect through links. ## Examples Minimal dwelling board: ```json {"uniwire":"1.0.0","profiles":["nfc15100"],"meta":{"title":"Small flat","lang":"en"},"installation":{"earthing":"TT","system":"1P+N","un_V":230},"templates":{"C16":{"type":"breaker","in_A":16,"curve":"C","poles":"1P+N"}},"sources":[{"type":"grid","id":"grid","children":[{"type":"main_breaker","id":"Q0","ref":"-Q0","in_A":45,"idn_mA":500,"selective":true,"children":[{"type":"board","id":"TD","ref":"TD","children":[{"type":"rcd","id":"F1","ref":"-F1","in_A":40,"idn_mA":30,"rcd_type":"A","children":[{"type":"breaker","id":"Q11","ref":"-Q11","use":"C16","cable":{"cores":"3G","section_mm2":1.5},"children":[{"type":"lighting","id":"L1","label":"Lighting","points":6}]},{"type":"breaker","id":"Q12","ref":"-Q12","in_A":20,"curve":"C","poles":"1P+N","cable":{"cores":"3G","section_mm2":2.5},"children":[{"type":"socket","id":"S1","label":"Sockets","points":8}]}]}]}]}]}]} ``` Normal/standby supply with transfer switch: ```json {"uniwire":"1.0.0","installation":{"earthing":"TN-S","system":"3P+N","un_V":400},"sources":[{"type":"grid","id":"grid","children":[{"type":"transfer_switch","id":"ATS","ref":"-QA1","in_A":125,"poles":"4P","mode":"automatic","children":[{"type":"board","id":"DB","ref":"DB1","children":[{"type":"breaker","id":"Q1","ref":"-Q1","in_A":32,"curve":"C","poles":"4P","cable":{"cores":"5G","section_mm2":6,"length_m":30},"children":[{"type":"motor","id":"M1","label":"Pump","p_kW":11}]},{"type":"breaker","id":"Q2","ref":"-Q2","in_A":16,"curve":"C","poles":"1P+N","phase":"L2","children":[{"type":"lighting","id":"L1","label":"Lighting"}]}]}]}]},{"type":"generator","id":"G1","ref":"G1","sn_kVA":60}],"links":[{"kind":"transfer","from":"G1","to":"ATS"}]} ```