From 38b3e77462d2ca108e46cabee6f426ab4810cf30 Mon Sep 17 00:00:00 2001 From: ESPHome Device Builder Date: Sun, 18 Oct 2026 14:55:00 +0200 Subject: [PATCH] Edit the-saloon.yaml --- the-saloon.yaml | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/the-saloon.yaml b/the-saloon.yaml index a32a808..5363143 100644 --- a/the-saloon.yaml +++ b/the-saloon.yaml @@ -26,4 +26,37 @@ wifi: ssid: the-saloon Fallback Hotspot password: "JrEe6jVLK36I" -captive_portal: +http_request: + timeout: 5s + +sensor: + - platform: template + id: nas_ram_free + name: "NAS RAM libre" + unit_of_measurement: "Mo" + accuracy_decimals: 0 + state_class: measurement + icon: mdi:memory + + - platform: template + id: nas_ram_percent + name: "NAS RAM utilisée" + unit_of_measurement: "%" + accuracy_decimals: 1 + state_class: measurement + icon: mdi:memory + +interval: + - interval: 60s + then: + - http_request.get: + url: http://192.168.1.50:61208/api/4/mem # <- IP de ton NAS + capture_response: true + on_response: + then: + - lambda: |- + json::parse_json(body, [](JsonObject root) -> bool { + id(nas_ram_free).publish_state(root["available"].as() / 1048576.0f); + id(nas_ram_percent).publish_state(root["percent"].as()); + return true; + }); \ No newline at end of file