Hi everyone ![]()
I’d like to share a personal project I’ve been using daily:
a virtual battery system built entirely within Home Assistant , using only YAML.
Small disclaimer: I’m French, and this post has been “assisted” by a translation tool… so if something sounds slightly odd, please blame the baguette, not the concept ![]()
![]()
Goal
The idea is to simulate a virtual energy storage system based on real data:
- track energy flows
- simulate charge / discharge behavior
- compute realistic energy costs
All with full transparency and no dependency on external services.
How it works
The project relies only on native Home Assistant features:
integration(Riemann) for power → energy conversiontemplate sensorsfor all logicutility_meterfor energy trackingrecorder+ SQL for drift correction
It also requires HA Linky as the main data source for consumption.
The project can work with other data sources, but it is currently designed and validated with HA Linky.
What it provides
- A realistic virtual battery level
- Energy cost estimation aligned with real usage
- Ability to compare with virtual storage providers
- Better understanding of self-consumption
About drift
One of the main challenges with this kind of system is measurement drift.
In this project, drift is automatically corrected , ensuring long-term reliability.
Repository
The repo includes:
- full YAML logic
- sensors and configuration
- documentation to get started
Setup
The project is fully usable as-is , but requires:
- adapting entities to your setup
- a working HA Linky integration
- some familiarity with Home Assistant
Not plug & play, but fully customizable.
Philosophy
The goal is not to build a ready-made integration, but to provide:
- a solid and transparent foundation
- a system you fully control
- something you can adapt to your own needs
Feedback
If you try it, I’d be happy to hear your feedback or ideas ![]()
Thanks!