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
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.
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
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
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.