Skip to content

data: estimate MeshCore battery percentage from voltage - #906

Open
nicjansma wants to merge 2 commits into
l5yth:mainfrom
nicjansma:meshcore-battery-estimate
Open

nicjansma wants to merge 2 commits into
l5yth:mainfrom
nicjansma:meshcore-battery-estimate

Conversation

@nicjansma

@nicjansma nicjansma commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

MeshCore telemetry provides a battery voltage but no batteryLevel (%) estimate (like Meshtastic does).

This adds a new MESHCORE_ESTIMATE_BATTERY=1 option that will estimate battery level based on voltage, if batteryLevel is not provided. It bakes in a curve similar to what Meshtastic uses https://github.com/meshtastic/firmware/blob/develop/src/Power.h#L24.

image

AI Disclosure

Developed with the assistance of Claude. Reviewed, verified, tested and tweaked by me.

@nicjansma
nicjansma force-pushed the meshcore-battery-estimate branch from e155c94 to 3245197 Compare September 16, 2026 01:29
@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@l5yth

l5yth commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Happy to accept that, however, we need to keep in mind that other battery types have other curves. I have seen people running nodes on 12V batteries.

@nicjansma

Copy link
Copy Markdown
Contributor Author

Great idea. I've made it configurable via MESHCORE_OCV_MILLIVOLTS env var.

@l5yth

l5yth commented Oct 6, 2026

Copy link
Copy Markdown
Owner

The problem is, you would have to define it per node, so a global override does not solve this.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants