From ff53fa983124d67e5a7a48104e5fa4658f773dc1 Mon Sep 17 00:00:00 2001 From: Nicu Hodos Date: Sat, 7 Jun 2025 10:42:44 +0200 Subject: [PATCH] add long term statistics for oil level and depth --- gateway/include/devices.h | 2 ++ gateway/platformio.ini | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gateway/include/devices.h b/gateway/include/devices.h index 494b156..ac68c03 100644 --- a/gateway/include/devices.h +++ b/gateway/include/devices.h @@ -41,12 +41,14 @@ namespace OilTank { return Builder::instance(new Sensor{ "Level", id }) .asDevice(device) .withUnitMeasure("%") + .withSensorStateClass(MEASUREMENT) .withIcon("mdi:hydraulic-oil-level") .withValueTemplate("{{ 100 - ((value_json.sensor.value-12)|float*100/120)|round(2) }}") .addSecondary( Builder::instance(new Sensor{ "Depth", id }) .withDeviceClass("distance") .withUnitMeasure("cm") + .withSensorStateClass(MEASUREMENT) .withValueTemplate("{{ value_json.sensor.value }}") .build() ) diff --git a/gateway/platformio.ini b/gateway/platformio.ini index c096e3f..6f8eb3f 100644 --- a/gateway/platformio.ini +++ b/gateway/platformio.ini @@ -33,7 +33,7 @@ framework = arduino lib_deps = ${env.lib_deps} arkhipenko/TaskScheduler@^3.8.5 - https://git.hodos.ro/libraries/ha-mqtt.git@^1.6.0 + https://git.hodos.ro/libraries/ha-mqtt.git@^1.7.0 https://git.hodos.ro/libraries/wifi.git@^2.0.0 upload_port = 192.168.6.161 upload_protocol = espota