microgrid.pt
Version 0.3 — concept page
Open, local-first distributed energy systems

Building the edge layer for programmable local energy.

microgrid.pt explores open, local-first control systems for distributed energy: solar, storage, smart loads, EV charging, energy sharing, and Petri-net-based settlement for interconnected local energy nodes.

We are interested in what sits between devices and the wider grid: the gateway that decides what to power, what to store, when to shed loads, when to charge or discharge, and how to communicate those choices upstream.

Inspired by internet-style architecture for energy systems, the goal is to move from isolated installations toward interoperable, resilient, neighborhood-scale energy coordination.

Local energy node overview

PV Battery Hybrid Inverter Loads EV / EVSE Grid Local Gateway control • metering • policy • communication • settlement events
The local gateway is intended to remain useful even without cloud connectivity: device integration, local policy execution, metering, and event generation should continue to work on-site.

Concept

The traditional electricity system was built around centralized generation and one-way delivery. That model becomes increasingly strained when energy is produced locally, when sites add storage and EVs, and when resilience during outages matters more.

A better model is emerging: each home, building, or site can become an intelligent energy node. It can optimize self-consumption, protect critical loads, respond to tariffs or grid stress, and eventually participate in coordinated local energy networks.

We are especially interested in the control layer: local autonomy first, upstream coordination second, open interfaces throughout.

What we are working on

Local energy gateway

An edge controller for a single site that can observe generation, storage, loads, and grid state, then make local decisions even when internet connectivity is unavailable.

Smart load orchestration

Priority-based control for appliances, water heating, HVAC, EV charging, and other flexible loads, with graceful load shedding when production drops or battery reserve must be protected.

Open protocol design

Interfaces between inverters, batteries, metering, smart breakers, EVSEs, and upstream systems should be open, inspectable, and implementable without unnecessary vendor lock-in.

Energy sharing and settlement

Beyond site-level optimization, the next step is local energy exchange between participants: one node may export surplus energy while another node imports and pays for that energy inside a shared local network.

That requires more than generation and consumption. It requires interval metering, attribution, contract constraints, transport and loss allocation, and a settlement model that remains deterministic and auditable.

  • Producer-side metering and export eligibility
  • Consumer-side metering and import attribution
  • Transport and local loss allocation
  • Contract rules such as price limits, reserve levels, and export constraints
  • Settlement events for billing, audit, and future automation
In this concept, physical power flow and financial attribution are treated as separate layers. Electricity follows network physics; payment follows measured and validated settlement rules.

Settlement model

Settlement is modeled as a deterministic, event-driven process to ensure transparent, auditable energy exchanges between participants.

Internally, formal modeling techniques (such as Petri nets) may be used to represent state transitions, constraints, and energy flow, but the external system is designed to remain simple, inspectable, and implementation-agnostic.

Architecture overview

Site / Node PV • Battery • Inverter Loads • EVSE • Meters Local policies • local control Gateway Raspberry Pi based edge node RS485 / Ethernet / radio HAT MQTT • device drivers • event export Upstream / Community Layer Coordinator • tariff signals Community exchange • grid interface Optional market and compliance layer Petri-net Settlement Engine Validated interval data → contract rule evaluation → capacity check → match loss and transport allocation → settlement event → payment / credit confirmation separate from real-time control, designed for auditability and deterministic accounting
Real-time control and interval settlement should not be treated as the same problem. The gateway handles local control loops; the settlement layer processes validated events and accounting logic.

Suggested separation of roles

  • Gateway hardware and edge integration
  • Protocol and control software
  • Settlement engine and billing logic
  • Community operator or legal vehicle
  • Optional regulated market / supplier interface

Current status

microgrid.pt is currently an early-stage concept and exploration project. The goal is to document ideas, prototype local control logic, evaluate device interoperability, and help shape practical technical language for distributed energy systems.

Over time this may include architectural notes, implementation experiments, pilot concepts, reference integrations, Petri-net settlement models, and protocol proposals for communication between site gateways, devices, and upstream coordinators.