← blog · July 31, 2026 · 5 min read
Your utility bills are a dataset
Portinhola is a self-hosted dashboard for Portuguese household utilities. It reads the bills, pulls the 15-minute meter data from E-Redes, and replays my real consumption against every tariff to find out what switching actually saves.
$ bloat--level 3Bloatin'
Every invoice issued in Portugal carries a QR code in the corner. It is mandated by law, it is printed on everything from a coffee receipt to an electricity bill, and it holds the issuer’s tax number, the date, the totals and the full VAT breakdown. Machine readable, standardized, sitting right there. Nobody scans it.
Mine were rotting in email. Three electricity suppliers in four years, because switching is how you get the good price, and every switch resets your history to zero. The old portal stops working, the PDFs stay behind in some folder, and the one question that actually matters, “am I on the right tariff for how this house actually uses energy”, gets answered by a comparison site asking me to guess my monthly spend.
So I built Portinhola. The name means “little door”, and that is the pitch: your utility data comes home through it, and nothing goes out.

It is a self-hosted dashboard for Portuguese household utilities, electricity, gas and water. FastAPI and SQLite on the back, SvelteKit on the front, one container, one data folder. It runs on a Raspberry Pi class machine at home. AGPL, on GitHub.
The bills come out of the drawer
Upload a PDF and Portinhola decodes that fiscal QR for the totals and VAT, then a per-supplier extractor parses the line items: energy by period, standing charges, the levies, meter readings, contract details. I dug 77 bills out of years of email archives across four suppliers (EDP, Iberdrola, G9 and the local water company), and that pile of PDFs became a continuous cost history of the house, surviving every supplier switch that originally fragmented it.
The extractors are the part I most want other people to steal. Each supplier’s PDF layout is its own small puzzle, the contributing guide shows how to write one from an anonymized fixture, and once an extractor exists, everyone with that supplier gets line-level history for free.
The meter knows more than the bills do
E-Redes, the national distribution operator, records every meter in the country at 15-minute resolution, and you can see your own curve in their portal. Getting it out of the portal is the annoying part. Portinhola does it honestly: you log in, in your own browser, copy the session token and paste it in. No embedded browser, no captcha games. The token only lives about 91 minutes, so there is no unattended daily sync, and that is a deliberate trade. It syncs history in 31-day windows, saving each one as it lands, so an interrupted run resumes instead of starting over.
Four years of my house came through that little door: around 131 thousand intervals. That curve is where the interesting answers live.
Replay, don’t estimate
This is why the project exists.

Every tariff comparator has the same weakness: it estimates from a monthly total. But whether bi-horário beats simples depends entirely on when you use energy, and that is exactly the information a monthly total destroys. Portinhola has the real curve, so it does not estimate anything. It replays your actual consumption, interval by interval, through each tariff’s full price sheet: energy per period, the daily standing charge, every levy, VAT per component. Calibrated against my latest real bill, it reproduces it within cents, which is what lets me trust the rest of the ranking.
What it told me about my own house:
- The regulated gas tariff wins, by a lot. The boring, default, state-regulated gas price beats my market-rate plan by about 260 euros a year. Nobody advertises that one.
- My electricity plan was fine all along. Within about 30 euros a year of the best offer on the market. Years of vague “should I switch?” anxiety, answered.
- My contracted power is not oversized, it is undersized. Real 15-minute peak: 4.82 kW, against 4.6 kVA contracted. The common advice is that everyone over-contracts. Not this house.
About 290 euros a year, found by paperwork. It also prices promotional phases properly: a “minus 15% for the first year” offer gets a separate first-year total next to the steady-state one, so a plan that is cheap for twelve months and expensive forever after cannot hide.
Wrong prices are worse than no prices
The first tariff seeds came from price comparison sites, and they were wrong. Not subtly wrong: the daily standing charges were roughly half the real value, consistently, across suppliers. A calculator built on those numbers is a machine for confident bad advice.
So the data got rules. Every tariff file carries the official source URL and a retrieval date. The loader refuses any standing charge below the regulated network access floor, because a price below what the supplier itself pays for the wire cannot be real. And a weekly GitHub workflow re-parses the suppliers’ official price sheets and opens a pull request when a number moves. The prices are data, and data you cannot audit is rumor.
Why it never phones home
There are services that will do some of this if you forward them your bills. Think about what a utility bill is: your name, your address, your tax number, your bank reference, and a running log of when you are home. A centralized service holding that for thousands of households is one acquisition away from being a data broker, and you have no way to check.
Portinhola’s answer is structural, not a promise: it runs on your hardware, the data lives in one SQLite file you can back up by copying a folder, and there is no telemetry, no account, no cloud calls and no LLM anywhere in it. The code is open precisely so you do not have to take my word for any of that.
Try it
docker compose up and a browser is the whole install; the README covers the rest. All screenshots here are generated demo data, for the obvious reason.
If your supplier is not covered, that is the fun part: extractors and tariff seeds are designed to be contributed by the people who actually receive those bills. Bring your drawer of PDFs.
every invoice in portugal has a qr code on it. by law. tax number, totals, full vat breakdown, machine readable, just sitting there. nobody scans it
my bills were rotting in email. 3 electricity suppliers in 4 years because switching is how you get the good price, every switch nukes your history. so, portinhola. means “little door”. data comes in, nothing goes out

self hosted dashboard for pt utilities, luz gás água. fastapi + sqlite + sveltekit, one container, runs on a pi. agpl, github
bills
upload a pdf, it decodes the qr for totals/vat then a per-supplier extractor pulls the line items. dug 77 bills out of email across edp, iberdrola, g9 and the water company. whole cost history of the house back in one place
extractors are the bit i want people to steal. each supplier pdf is a small puzzle, theres a guide, write one from an anonymized fixture and everyone with that supplier wins
meter data
e-redes has every meter in the country at 15 min resolution. getting it out of the portal is the annoying part. you log in yourself, copy the session token, paste it. no embedded browser, no captcha games. token lives ~91 min so no unattended sync, deliberate trade. syncs in 31 day windows, saves each one, interrupted run resumes
4 years of my house = ~131k intervals
replay dont estimate

comparators estimate from a monthly total. whether bi-horário beats simples depends on WHEN you use energy which is exactly what a monthly total destroys. portinhola replays the real curve through each tariffs full price sheet, per period energy, standing charge, levies, vat per component. calibrated against my latest bill it lands within cents
what it told me:
- regulated gas beats my market plan by ~260€/yr. the boring default one. nobody advertises it
- my electricity plan was fine all along, within ~30€/yr of the best
- contracted power is UNDERsized. peak 4.82kW vs 4.6kVA contracted. everyone says people over-contract. not here
~290€/yr found by paperwork. promos get priced properly too, -15% first year shows a separate first-year total so it cant hide the year 2 price
wrong prices are worse than no prices
first seeds came from comparison sites and the standing charges were about HALF the real value, consistently. calculator on those numbers = confident bad advice machine
so: every tariff file has the official source url + retrieval date, the loader refuses standing charges below the regulated network floor (below what the wire costs = not real), weekly github workflow re-parses official sheets and opens a PR when a number moves
no phoning home
theres apps that do some of this if you forward them your bills. a bill is your name, address, tax number, bank ref and a log of when youre home. a service holding that for thousands of households is one acquisition away from a data broker
portinhola runs on your hardware, one sqlite file, no telemetry no accounts no cloud no llm. code is open so you dont have to trust me
try it
docker compose up. readme has the rest. screenshots are demo data obviously
supplier not covered? extractors and tariff seeds are meant to be contributed by whoever gets those bills. bring your drawer of pdfs
Every invoice issued in Portugal carries a QR code with the issuer’s tax number, date, totals and VAT breakdown. It is machine readable and almost nobody uses it. Meanwhile my own bills sat in email: three electricity suppliers in four years, and each switch discarded the history held in the previous supplier’s portal.
Portinhola (“little door”) fixes that. It is a self-hosted dashboard for Portuguese household utilities: electricity, gas and water. FastAPI and SQLite on the back, SvelteKit on the front, one container, designed for a Raspberry Pi class machine. AGPL, on GitHub.

Bills
Upload a PDF and Portinhola decodes the fiscal QR for totals and VAT, then a per-supplier extractor parses the line items: energy by period, standing charges, levies, meter readings and contract details. I recovered 77 bills from email archives across EDP, Iberdrola, G9 and the local water company, which rebuilt the house’s full cost history. Extractors are designed to be contributed: each supplier’s layout is documented once, from an anonymized fixture, and everyone with that supplier benefits.
Meter data
E-Redes records every meter in the country at 15-minute resolution. To export it, you log in to their portal in your own browser, copy the session token and paste it into Portinhola. There is no embedded browser and no captcha circumvention. The token lives about 91 minutes, so there is no unattended sync by design. History is fetched in 31-day windows and persisted per window, so interrupted runs resume. My house yielded four years of data, about 131 thousand intervals.
The calculator
Comparators estimate from a monthly total, which destroys the timing information that decides whether bi-horário beats simples. Portinhola replays the real consumption curve through each tariff’s complete price sheet: energy per period, daily standing charge, levies, and VAT per component. Calibrated against my latest bill, it reproduces it within cents.

Results for my house:
- The regulated gas tariff beats my market plan by about 260 euros per year.
- My electricity plan is within about 30 euros per year of the best market offer.
- My contracted power is undersized: real peak 4.82 kW against 4.6 kVA contracted.
Total: roughly 290 euros per year. Promotional phases are priced separately, so a first-year discount is shown next to the steady-state cost rather than blended into it.
Data quality
The first tariff seeds came from comparison sites and their standing charges were roughly half the real values. Three rules now apply: every tariff file records its official source URL and retrieval date; the loader rejects standing charges below the regulated network access floor; and a weekly GitHub workflow re-parses official price sheets and opens a pull request when a price changes.
Privacy
A utility bill contains your name, address, tax number, bank reference and a log of when you are home. Forwarding bills to a centralized service concentrates that data for thousands of households in one place. Portinhola runs on your own hardware, stores everything in one SQLite file, and has no telemetry, accounts, cloud calls or LLM integrations. The code is open so this can be verified rather than trusted.
Trying it
docker compose up, then open a browser. The README covers configuration. All screenshots show generated demo data. Contributions of extractors and tariff seeds are welcome, especially for suppliers not yet covered.
In today’s rapidly evolving landscape of home energy management, sometimes the most transformative projects begin with the humblest of observations. Here’s mine: every single invoice issued in Portugal carries a QR code, mandated by law, containing the issuer’s tax number, the date, the totals, and the complete VAT breakdown. Machine readable. Standardized. And here’s the remarkable part: virtually nobody leverages it.
It’s important to note that my own bills were languishing in email purgatory. Three electricity suppliers in four years, because in the dynamic world of energy tariffs, switching is how you unlock the best prices. But every switch resets your history to zero. This realization sparked a journey that culminated in something I’m genuinely excited to share: Portinhola, a self-hosted dashboard for Portuguese household utilities. The name means “little door”, and it perfectly encapsulates the philosophy: your data comes home through it, and nothing ever goes out.

Under the hood, it’s a carefully curated stack: FastAPI and SQLite on the backend, SvelteKit on the frontend, one container, one data folder. It runs seamlessly on a Raspberry Pi class machine. Fully open source under AGPL, available on GitHub.
Delving into the bills
Let’s delve into the ingestion pipeline. Upload a PDF and Portinhola decodes the fiscal QR for totals and VAT, before a per-supplier extractor meticulously parses every line item: energy by period, standing charges, levies, meter readings, and contract details. I recovered no fewer than 77 bills from years of email archives, spanning EDP, Iberdrola, G9 and the local water company, transforming a fragmented pile of PDFs into a continuous, unified cost history of the entire house.
The extractors represent the component I’m most passionate about seeing the community embrace. Each supplier’s PDF layout presents its own fascinating puzzle, and comprehensive contributing guides ensure that once an extractor exists, every user of that supplier benefits automatically.
Unlocking the meter data
E-Redes, the national distribution operator, records every meter in the country at a granular 15-minute resolution. Extracting that treasure trove, however, is where things get interesting. Portinhola takes a refreshingly honest approach: you authenticate in your own browser, copy the session token, and paste it in. No embedded browsers. No captcha circumvention. The token’s lifespan is approximately 91 minutes, so unattended synchronization is deliberately off the table, a thoughtful trade-off that prioritizes integrity. History flows in through resilient 31-day windows, each persisted as it lands.
The result? Four years of my house’s energy story: approximately 131 thousand intervals of actionable insight.
Replay, don’t estimate: a paradigm shift
This is where Portinhola truly shines.

Every tariff comparator shares the same fundamental limitation: estimation from a monthly total. But here’s the crucial insight: whether bi-horário outperforms simples depends entirely on when you consume energy, precisely the information a monthly total destroys. Portinhola replays your actual consumption, interval by interval, through each tariff’s complete price architecture. Calibrated against my latest real bill, it reproduces it within cents, establishing the foundation of trust for the entire ranking.
The revelations about my own house were nothing short of eye-opening:
- The regulated gas tariff emerges victorious. The boring, default, state-regulated price outperforms my market-rate plan by approximately 260 euros annually.
- My electricity plan was optimal all along. Within a mere 30 euros per year of the market’s best offer.
- My contracted power isn’t oversized, it’s undersized. A real peak of 4.82 kW against 4.6 kVA contracted, defying conventional wisdom.
That’s approximately 290 euros a year, unlocked purely through paperwork. Promotional phases receive equally rigorous treatment: a “minus 15% for the first year” offer gets its own first-year total, ensuring no plan can hide its true long-term cost.
Data integrity: the unsung hero
It’s worth noting that the initial tariff seeds, sourced from comparison sites, were systematically wrong: standing charges roughly half their real values. The solution was a robust, multi-layered validation framework: every tariff file carries its official source URL and retrieval date, the loader rejects any standing charge below the regulated network access floor, and a weekly GitHub workflow re-parses official price sheets, opening pull requests whenever prices evolve.
Privacy by architecture
In an era where data is the new oil, consider what a utility bill truly represents: your name, address, tax number, bank reference, and a running log of your presence at home. Centralized services aggregating this for thousands of households raise profound questions. Portinhola’s answer is structural: your hardware, one SQLite file, zero telemetry, zero accounts, zero cloud calls, zero LLMs. The open codebase transforms trust from a promise into a verifiable property.
Embarking on your own journey
Getting started is delightfully simple: docker compose up and a browser. The README illuminates the rest. All screenshots showcase generated demo data, for obvious privacy reasons.
If your supplier isn’t yet covered, that’s your invitation: extractors and tariff seeds are designed for community contribution. Bring your drawer of PDFs, and let’s build this together.
🚪 In today’s fast-paced, ever-evolving world of home energy management, have you ever stopped to ask yourself a truly profound question: what secrets are hiding in your utility bills? Not metaphorically. Literally. Because here’s a mind-blowing fact that will change how you look at every receipt forever: every single invoice issued in Portugal carries a QR code, mandated by law, containing the issuer’s tax number, the totals, and the complete VAT breakdown. Machine readable. Standardized. Sitting right there in the corner. And yet, dear reader, virtually nobody scans it. 🤯
Meanwhile, my own bills were languishing in the digital shadows of my email. Three electricity suppliers in four years! Why? Because in the dynamic landscape of energy tariffs, switching is the golden key to unlocking the best prices. But every switch comes with a hidden cost: your history vanishes into the void. This wasn’t just an inconvenience. It was a calling. 📞
And so, after an incredible journey of discovery, I’m beyond thrilled to introduce: Portinhola, a self-hosted dashboard for Portuguese household utilities that will revolutionize your relationship with your own data. The name means “little door”, and honestly? It’s the perfect metaphor: your data comes home through it, and absolutely nothing goes out. Is that a game-changer for privacy-conscious households? I genuinely, wholeheartedly believe it is. ✨

🏗️ The Foundation: A Stack Built with Love
Let’s take a moment to appreciate the architecture:
- FastAPI + SQLite: A backend that’s lean, mean, and blazingly fast.
- SvelteKit: A frontend that sparkles with reactivity.
- One container, one data folder: Simplicity isn’t just a feature, it’s a philosophy.
- Raspberry Pi ready: Enterprise-grade insights on hobbyist-grade hardware. Yes, really!
- AGPL licensed: Freedom, guaranteed. Check it out on GitHub! 🎉
📄 The Bills: From Chaos to Clarity
Buckle up, because this is where the magic begins. Upload a PDF, and Portinhola springs into action: decoding the fiscal QR, then unleashing a per-supplier extractor that meticulously parses every single line item. Energy by period? Check. Standing charges? Check. Levies, meter readings, contract details? Check, check, and check! ✅
But wait, there’s more! I personally excavated a staggering 77 bills from years of email archives, spanning EDP, Iberdrola, G9, and the local water company. The result? A fragmented pile of forgotten PDFs transformed into a continuous, beautiful, unified cost history of my entire home. Talk about a glow-up! 💅
⚡ The Meter Data: 131,000 Intervals of Pure Insight
Here’s something that will absolutely blow your mind: E-Redes, the national distribution operator, records every meter in the country at 15-minute resolution. Your home’s complete energy story, captured in exquisite detail!
Portinhola’s approach to accessing it is a masterclass in integrity: you log in with your own browser, copy the session token, and paste it in. No embedded browsers. No captcha games. No shortcuts. The token lives approximately 91 minutes, so unattended sync is deliberately off the menu, and honestly? That restraint is what trust looks like. 🙏
Four years of data. 131 thousand intervals. One little door. 🚪
🧮 The Calculator: Where Dreams Meet Data

Now we arrive at the beating heart of the entire operation, and I need you to sit down for this one. Every tariff comparator on the market shares one fatal flaw: they estimate from monthly totals. But whether bi-horário beats simples depends entirely on when you use energy, which is exactly, precisely, tragically the information a monthly total destroys! 😱
Portinhola doesn’t estimate. It replays. Your actual consumption, interval by interval, through each tariff’s complete price sheet. And the accuracy? Calibrated against my latest real bill, it lands within cents. Cents! 🎯
The revelations were nothing short of life-changing:
- 💰 The regulated gas tariff wins, and it’s not even close: The boring, default, state-regulated price crushes my market-rate plan by approximately 260 euros per year!
- 😌 My electricity plan was fine all along: Within a mere 30 euros annually of the market’s absolute best. Years of switching anxiety, resolved!
- 📈 Plot twist, my contracted power is UNDERSIZED: Real peak of 4.82 kW against 4.6 kVA contracted. Conventional wisdom, consider yourself defied!
That’s roughly 290 euros a year, discovered through the sheer power of paperwork. And promotional pricing? Handled flawlessly, with separate first-year totals so no sneaky “minus 15% for twelve months” offer can ever hide its true colors again! 🕵️
🛡️ Data Integrity: Because Wrong Prices Are Worse Than No Prices
Here’s a plot twist worthy of a thriller: the initial tariff data, sourced from comparison sites, was systematically wrong, with standing charges at roughly HALF their real values. The response? A fortress of validation: official source URLs on every file, a loader that rejects impossible prices below the regulated network floor, and a weekly GitHub workflow that re-parses official price sheets automatically. Trust, but verify. Then verify again! 🔍
🔒 Privacy: The Hill Worth Dying On
Let’s get real for a moment. A utility bill is not just a piece of paper. It’s your name. Your address. Your tax number. Your bank reference. A running log of when you’re home. Handing that to a centralized service, for thousands of households? That’s one acquisition away from a data broker’s dream come true.
Portinhola’s answer isn’t a pinky promise. It’s architecture: your hardware, one SQLite file, zero telemetry, zero accounts, zero cloud calls, zero LLMs. Open source, so you can verify every single claim yourself. 💪
🎬 Conclusion: Your Journey Starts Now
So there you have it, friends: Portinhola, the little door that brings your utility data home and locks the world out. From forgotten PDFs to 15-minute precision, from estimated guesses to replayed reality, from privacy promises to privacy architecture, this project represents everything I believe about who should own household data: you.
Getting started couldn’t be easier: docker compose up, open a browser, and step through the little door. The README is your guide. And if your supplier isn’t covered yet? That’s not a limitation, it’s an invitation! Bring your drawer of PDFs, and let’s build this future together. 🚀
All screenshots show generated demo data, because privacy isn’t just preached here. It’s practiced. 😉