Skip to content

Add battery voltage, current, power, and temperature sensors - #11

Merged
jsight merged 5 commits into
mainfrom
pr9-battery-sensors
Jul 30, 2026
Merged

Add battery voltage, current, power, and temperature sensors#11
jsight merged 5 commits into
mainfrom
pr9-battery-sensors

Conversation

@jsight

@jsight jsight commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

Rebase of #9 (by @turbozv) onto current main, plus a small follow-up fix.

  • Adds Home Assistant sensors for battery pack telemetry: voltage, signed current, calculated power (voltage × current, positive charging / negative discharging), and temperature.
  • Discovered via the host_packet_data_jdb TSL property, consistent with existing struct-sensor patterns.
  • Handles missing/invalid/non-finite telemetry gracefully.
  • Verified E2E by the original author on a Pecron E2400LFP.
  • Follow-up: added missing strings.json translation entries for battery_voltage, battery_current, and battery_temperature (only battery_power had one in the original PR).

Closes #9.

Test plan

  • pytest — all 64 tests pass (43 existing + 21 new)
  • ruff check clean
  • Rebased cleanly onto current main (only trivial CHANGELOG conflict, resolved)

🤖 Generated with Claude Code

turbozv and others added 5 commits July 30, 2026 19:36
* fix: read battery packet measurements

* test: cover battery packet telemetry

* feat: add battery temperature sensor
battery_power got an entry but battery_voltage, battery_current, and
battery_temperature did not, so they were falling back to the
description name instead of the translation-driven path used by
every other sensor.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@jsight
jsight merged commit e3a0487 into main Jul 30, 2026
10 checks passed
@jsight
jsight deleted the pr9-battery-sensors branch July 30, 2026 23:40
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