Skip to content

Commit 885e1dd

Browse files
author
fwmone
committed
## [0.1.4] - 2026-02-17
### Added - Added `battery_percent_rechargeable` sensor to provide a more realistic battery level estimation for rechargeable batteries (e.g. NiMH). - The new sensor derives remaining charge from pack voltage and is intended for monitoring and automations when using rechargeable cells. - Existing `battery_percent` sensor continues to reflect the vendor/device battery percentage logic. ### Changed - Clarified separation between vendor-reported battery percentage and voltage-based rechargeable battery estimation.
1 parent 0ed4306 commit 885e1dd

4 files changed

Lines changed: 45 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/).
77

8+
## [0.1.4] - 2026-02-17
9+
10+
### Added
11+
- Added `battery_percent_rechargeable` sensor to provide a more realistic
12+
battery level estimation for rechargeable batteries (e.g. NiMH).
13+
- The new sensor derives remaining charge from pack voltage and is intended
14+
for monitoring and automations when using rechargeable cells.
15+
- Existing `battery_percent` sensor continues to reflect the vendor/device
16+
battery percentage logic.
17+
18+
### Changed
19+
- Clarified separation between vendor-reported battery percentage and
20+
voltage-based rechargeable battery estimation.
21+
822
## [0.1.3] - 2026-02-15
923

1024
### Changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ When device_id is configured, the following sensors are created:
257257
- Battery
258258
- sensor.paperlesspaper_push_battery_voltage (V)
259259
- sensor.paperlesspaper_push_battery (%)
260+
- sensor.paperlesspaper_push_battery_rechargeable (%)
260261

261262
- Timestamps
262263
- sensor.paperlesspaper_push_last_reachable
@@ -276,11 +277,15 @@ You can trigger an immediate telemetry refresh via the service:
276277

277278
Battery percentage is derived from the reported raw battery voltage (`batLevel`).
278279

279-
Default mapping (4×AAA in series):
280+
Default mapping (4×AAA in series) for sensor.paperlesspaper_push_battery:
280281
- 6.2 V → 100%
281282
- 4.0 V → 0%
282283

283-
Values are clamped to the range and mapped linearly in between. So, yes, when using rechargeable NiMH batteries, the mapping is likely to show never 100%. Haven't tested it yet.
284+
Default mapping (4×AAA NiMH in series) for sensor.paperlesspaper_push_battery_rechargeable:
285+
- 5.3 V → 100%
286+
- 4.0 V → 0%
287+
288+
Values are clamped to the range and mapped linearly in between.
284289

285290
## Example for a Home Assistant dashboard integration
286291

custom_components/paperlesspaper_push/device_sensors.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,22 @@ def _battery_percent_from_mv(mv: int | None) -> Optional[int]:
4141

4242
return round((v - V_MIN) / (V_MAX - V_MIN) * 100)
4343

44+
def _battery_percent_nimh(mv: int | None) -> Optional[int]:
45+
if mv is None:
46+
return None
47+
48+
v = mv / 1000.0
49+
50+
# NiMH 4xAAA
51+
V_MIN = 4.0
52+
V_MAX = 5.3
53+
54+
if v >= V_MAX:
55+
return 100
56+
if v <= V_MIN:
57+
return 0
58+
59+
return round((v - V_MIN) / (V_MAX - V_MIN) * 100)
4460

4561
def _battery_voltage_v(mv: int | None) -> Optional[float]:
4662
if mv is None:
@@ -87,6 +103,13 @@ class _SensorDef:
87103
unit=PERCENTAGE,
88104
value_fn=lambda d: _battery_percent_from_mv(_get_bat_mv(d)),
89105
),
106+
_SensorDef(
107+
key="battery_percent_rechargeable",
108+
name="Battery (Rechargeable)",
109+
device_class=SensorDeviceClass.BATTERY,
110+
unit=PERCENTAGE,
111+
value_fn=lambda d: _battery_percent_nimh(_get_bat_mv(d)),
112+
),
90113
_SensorDef(
91114
key="last_reachable",
92115
name="Last Reachable",

custom_components/paperlesspaper_push/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"domain": "paperlesspaper_push",
33
"name": "paperlesspaper Push",
4-
"version": "0.1.3",
4+
"version": "0.1.4",
55
"documentation": "https://github.com/fwmone/paperlesspaper_push",
66
"issue_tracker": "https://github.com/fwmone/paperlesspaper_push/issues",
77
"requirements": [],

0 commit comments

Comments
 (0)