Self-hosted charging analytics for Ford electric vehicles https://squidbytes.github.io/LightningROD/
  • Python 41.8%
  • HTML 37%
  • CSS 21%
  • Dockerfile 0.1%
Find a file
Aminorjourney 30c3b08d7d
Set websocket max size to 16MB
Fix: Increase WebSocket max_size to prevent 1009 frame too large error on large HA instances

The initial websocket connection had a default 1MB frame size limit, which works fine for smaller Home Assistant instances. 

However, larger HA installs with many entities can exceed this limit during the get_states call, causing a 1009 error and failed connection:
sent 1009 (message too big) frame exceeds limit of 1048576 bytes; no close frame received


I've increased the limit to 16MB in services/hass_client.py which should cover the vast majority of HA instances.

Potential future improvement: This could be made user-configurable via a .env variable (e.g. HA_WS_MAX_SIZE_MB=16) so users with exceptionally large instances can tune it themselves without touching the code.
2026-03-10 19:24:50 -07:00
.github/workflows feat: zensical github pages site 2026-02-28 22:44:57 -05:00
data fix(quick-3): fix CSV import failures — FK safety, is_free parser, sample CSV cleanup 2026-03-07 18:53:14 -05:00
db fix(migrate): resolve duplicate revision ID causing alembic cycle 2026-03-06 19:58:43 -05:00
docs docs: README and doc site gifs updated 2026-03-08 18:47:48 -04:00
scripts chore: DB seed script updated to mirror CSV import functionality 2026-03-07 18:41:41 -05:00
tests test(07-03): add failing tests for import_rows function 2026-03-01 16:06:33 -05:00
web Set websocket max size to 16MB 2026-03-10 19:24:50 -07:00
.dockerignore chore: docker files and various dot/support files 2026-02-28 22:37:06 -05:00
.env.example chore: docker files and various dot/support files 2026-02-28 22:37:06 -05:00
.gitignore feat(quick-2): rename and refine sample CSV to ev_charging_sample.csv 2026-03-07 18:19:52 -05:00
.nvmrc feat(09.4-01): install DaisyUI v5, configure Tailwind build pipeline, localize vendor assets 2026-03-04 20:59:54 -05:00
.python-version chore: docker files and various dot/support files 2026-02-28 22:37:06 -05:00
alembic.ini chore: docker files and various dot/support files 2026-02-28 22:37:06 -05:00
CHANGELOG.md docs(10): README and Changelog updated with hass info 2026-03-07 16:57:28 -05:00
config.py chore: docker files and various dot/support files 2026-02-28 22:37:06 -05:00
docker-compose.dev.yml chore: docker files and various dot/support files 2026-02-28 22:37:06 -05:00
docker-compose.yml chore: docker files and various dot/support files 2026-02-28 22:37:06 -05:00
Dockerfile fix(09.4): fix DaisyUI build pipeline and static file serving 2026-03-05 16:28:53 -05:00
entrypoint.sh chore: docker files and various dot/support files 2026-02-28 22:37:06 -05:00
input.css style(plotly): position modebar outside chart area via CSS 2026-03-06 19:59:10 -05:00
LICENSE chore: docker files and various dot/support files 2026-02-28 22:37:06 -05:00
main.py chore: docker files and various dot/support files 2026-02-28 22:37:06 -05:00
package-lock.json feat(09.4-01): install DaisyUI v5, configure Tailwind build pipeline, localize vendor assets 2026-03-04 20:59:54 -05:00
package.json feat(09.4-01): install DaisyUI v5, configure Tailwind build pipeline, localize vendor assets 2026-03-04 20:59:54 -05:00
pyproject.toml feat(10-02): add HA websocket client with auth, subscribe, and reconnect 2026-03-07 15:30:48 -05:00
README.md docs(v0.2): quick docs update with gifs for various pages 2026-03-07 20:20:23 -05:00
uv.lock fix(10-02): update uv.lock for websockets dependency 2026-03-07 16:18:38 -05:00
zensical.toml docs(10): README and Changelog updated with hass info 2026-03-07 16:57:28 -05:00

LightningROD

Self-hosted charging analytics for Ford electric vehicles. Track charging sessions, analyze costs, and monitor energy consumption with a web-based dashboard.

Built for the Ford F-150 Lightning, but should work with any Ford EV.

Important

This is a work in progress. Do not use this as the only data storage.

Supports automatic data ingestion from Home Assistant via ha-fordpass, CSV import, and manual entry.

Note

This is my own personal project I am using it for a fun side project, and for learning.

"The goal is to make this adaptable for different users and data types, but much of it is tailored to my specific data and storage methods."

If you would like to, please consider buying me a coffee.

"Buy Me A Coffee"

Documentation

Full documentation is available at the documentation site.

  • Installation -- Docker Compose setup and startup
  • Configuration -- Environment variables and in-app settings
  • Data Import -- CSV format, seed script, classification rules
  • Home Assistant -- Real-time FordPass data ingestion via WebSocket
  • Development -- Running outside of the Docker enviornment with reloading and database access
  • Architecture -- Project structure and patterns
  • Database -- Schema, models, migrations

Acknowledgments

  • ha-fordpass by marq24 -- Home Assistant integration for Ford vehicles
  • fordpass-ha by itchannel -- Home Assistant integration that started this journey
  • TeslaMate -- Inspiration for the project concept

Screenshots are from v0.1.5 and may not be up to date

Session List and drawer

sessionList v0.2

Cost Page

cost page v0.2

Energy Page

energy v0.2

Settings Page

main settings page v0.2

settings networks v0.2

settings csv import v0.2

Quick Start

git clone https://github.com/yourusername/LightningROD.git
cd LightningROD
cp .env.example .env
# Edit .env -- at minimum, set a real POSTGRES_PASSWORD
docker compose up --build -d

The app will be available at http://localhost:8000. Migrations run automatically on startup.

Reference the full documentation site.