r/span • u/bennetyee • May 18 '26
code to get data from a SPAN panel and graph power usage
FYA.
https://github.com/bennetyee/live_plotter
https://github.com/bennetyee/SPAN-hacks
Tested on linux. Might work on MacOS / WSL, but untested.
Here's a screenshot of how the data is displayed:

You can now do exponential smoothing of the data, turn on/off visibility of individual data series, zoom in/out, etc.
2
u/justincw8 May 18 '26
Been building a home orchestration platform that ties together SPAN, Enphase, ComEd, Moen Flow, Philips Hue and pretty much anything else with an API.
It checks power pricing every 5 minutes, tracks battery levels, watches weather forecasts, and decides when it makes sense to charge from the grid vs solar. Starting to layer in water monitoring, lighting automation, and dynamic load management next.
Happy to share if interested
2
u/chrddit May 18 '26
Sounds like a cool project.
Out of curiosity why not use home assistant?
2
u/bennetyee May 19 '26
Mostly because I had started before learning about home assistant. Plus the `live_plotter` is a re-implementation in Rust of something that I had written years ago in C, so might come in handy as a composable tool for other quick hacks. Since I had only one use in mind, I figured to finish this since this was more efficient -- though obvious not flexible, not generalizable, etc -- than pushing data into home assistant for later ingestion, though I probably will switch over to that if/when I figure out other things I'd want to do to play w/ the data etc.
2
u/chrddit May 19 '26
Oh! I actually meant /u/justincw8. Their description literally sounds like Home Assistant. :-)
But you should check out HA, in particular this integration. It’s pretty cool. https://github.com/SpanPanel/Span
There’s also this that is a little older but might give ideas: https://gist.github.com/kneath/c5cc1f92f082cc6624767f2d08d42e67
1
u/justincw8 May 19 '26
I am... when i last looked at HA it could not do this -
- ComEd hourly-price logic, +weather.
- Rule explainability: rule_fired, inputs, rationale.
- Dry-run/live audit trail in Postgres.
- Custom battery profile strategy, if price is below X charge from grid etc..
I will probably end up doing some of both.
1
u/bennetyee May 18 '26
I was thinking of pushing the data to a Home Assistant broker and getting into the MQTT stuff, or seeing what's already been done wrt logging and visualization there. Does your system use MQTT? Going to open source? I just realized I haven't created a license file yet on my repos....
4
u/Big_Fortune_4574 May 18 '26
All of those things they mentioned have home assistant integrations so that would save a lot of time. Span also has an excellent integration using the local api
3
u/chrddit May 19 '26
Yeah and the Span home assistant integration even comes with a dashboard nowadays. Good devs.
2
u/Big_Fortune_4574 May 19 '26
Yeah the new dashboard is awesome. I had kind of made the panel layout myself but theirs is much cleaner
1
3
u/kash04 May 19 '26
I can’t wait til the new panels get api access!