updated percent calculation for oil tank battery after minimum voltage observed was 4,04

This commit is contained in:
Nicu Hodos 2025-06-20 09:40:33 +02:00
parent 7258ab9b56
commit 7720f8a7c1

View File

@ -52,7 +52,7 @@ Sensor* buildTankSensor(const char* id) {
.build()
)
.addDiagnostic(new VoltageSensor{id, "Battery voltage", "{{ value_json.sensor.diagnostic.voltage }}"})
.addDiagnostic(new BatterySensor{id, "Battery level", "{{ ((value_json.sensor.diagnostic.voltage|float-4.8)|round(2)*100/1.6)|int }}"})
.addDiagnostic(new BatterySensor{id, "Battery level", "{{ ((value_json.sensor.diagnostic.voltage|float-4.0)|round(2)*100/2.4)|int }}"})
.build();
}