From 5fccc50c1ea981a7ea0deaaf8e12d2ecda182c70 Mon Sep 17 00:00:00 2001 From: Nicu Hodos Date: Sun, 16 Jun 2024 12:09:20 +0200 Subject: [PATCH] update calculation for oil tank --- gateway/include/devices.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gateway/include/devices.h b/gateway/include/devices.h index 589f7fb..56e509e 100644 --- a/gateway/include/devices.h +++ b/gateway/include/devices.h @@ -45,11 +45,11 @@ namespace OilTank { .addSecondary( Builder::instance(new Sensor{ "Level", id }) .withUnitMseasure("%") - .withValueTemplate("{{ 100 - ((value_json.sensor.value-7)|float*100/110)|round(2) }}") + .withValueTemplate("{{ 100 - ((value_json.sensor.value-12)|float*100/120)|round(2) }}") .build() ) .addDiagnostic(new VoltageSensor{id, "Battery voltage", "{{ value_json.sensor.diagnostic.voltage }}"}) - .addDiagnostic(new BatterySensor{id, "Battery level", "{{ ((states('sensor.oil_tank_battery_voltage')|float-3.6)|round(2)*100/1.6)|int }}"}) + .addDiagnostic(new BatterySensor{id, "Battery level", "{{ ((states('sensor.oil_tank_battery_voltage')|float-4.8)|round(2)*100/1.6)|int }}"}) .build(); } }