Edit the-saloon.yaml
This commit is contained in:
parent
a3c64e6c3a
commit
38b3e77462
@ -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<float>() / 1048576.0f);
|
||||
id(nas_ram_percent).publish_state(root["percent"].as<float>());
|
||||
return true;
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user