diff --git a/gateway/include/devices.h b/gateway/include/devices.h index 342ab7d..494b156 100644 --- a/gateway/include/devices.h +++ b/gateway/include/devices.h @@ -38,16 +38,16 @@ namespace OilTank { .withModel("Pro Mini") .withArea("Basement") .withParent(gatewayDevice); - return Builder::instance(new Sensor{ "Depth", id }) + return Builder::instance(new Sensor{ "Level", id }) .asDevice(device) - .withDeviceClass("distance") - .withUnitMeasure("cm") - .withValueTemplate("{{ value_json.sensor.value }}") + .withUnitMeasure("%") + .withIcon("mdi:hydraulic-oil-level") + .withValueTemplate("{{ 100 - ((value_json.sensor.value-12)|float*100/120)|round(2) }}") .addSecondary( - Builder::instance(new Sensor{ "Level", id }) - .withUnitMeasure("%") - .withIcon("mdi:hydraulic-oil-level") - .withValueTemplate("{{ 100 - ((value_json.sensor.value-12)|float*100/120)|round(2) }}") + Builder::instance(new Sensor{ "Depth", id }) + .withDeviceClass("distance") + .withUnitMeasure("cm") + .withValueTemplate("{{ value_json.sensor.value }}") .build() ) .addDiagnostic(new VoltageSensor{id, "Battery voltage", "{{ value_json.sensor.diagnostic.voltage }}"})