diff --git a/include/devices.h b/include/devices.h index bb2068c..35acd0c 100644 --- a/include/devices.h +++ b/include/devices.h @@ -58,7 +58,7 @@ auto presenceTracker = Builder::instance(PRESENCE_SENSOR) .withParent(gatewayDevice)) .withValueTemplate("{{ value_json.sensor.state }}") .addDiagnostic(new VoltageSensor{PRESENCE_SENSOR, "Battery voltage", "{{ value_json.sensor.diagnostic.voltage }}"}) - .addDiagnostic(new BatterySensor{PRESENCE_SENSOR, "Battery level", "{{ ((value_json.sensor.diagnostic.voltage|float-2.5)|round(2)*100/2)|int }}"}) + .addDiagnostic(new BatterySensor{PRESENCE_SENSOR, "Battery level", "{{ ((value_json.sensor.diagnostic.voltage|float-2.7)|round(2)*100/0.6)|int }}"}) .withOffDelaySeconds(5*60) .withDeviceClass("presence") .build();