battery logging enabled

This commit is contained in:
Joshua King
2026-02-17 07:27:22 -05:00
parent 929f41674a
commit 00e06c80c6

View File

@@ -152,6 +152,10 @@ sensor:
device_class: voltage
state_class: measurement
accuracy_decimals: 3
on_value:
then:
- lambda: |-
ESP_LOGI("battery", "Voltage: %.3f V", x);
battery_level:
name: "Remote Battery Level"
id: remote_battery_level
@@ -163,6 +167,7 @@ sensor:
then:
- lambda: |-
const float pct = x;
ESP_LOGI("battery", "Level: %.0f%%", pct);
const bool valid = pct >= 0.0f && pct <= 100.0f;
// Infer charging from SOC trend when no dedicated charge-detect pin exists.