62 lines
1.4 KiB
YAML
62 lines
1.4 KiB
YAML
# Board: Generic ESP32-C3 Board (Generic)
|
|
# Definition: definitions/boards/generic-esp32c3/manifest.yaml
|
|
|
|
esphome:
|
|
name: the-saloon
|
|
friendly_name: the-saloon
|
|
|
|
esp32:
|
|
variant: ESP32S3
|
|
framework:
|
|
type: esp-idf
|
|
|
|
logger:
|
|
|
|
api:
|
|
encryption:
|
|
key: "hOwepopyk9l0dnp8M+UBkLfhIIel75DOlYCtwJG8tvI="
|
|
|
|
ota:
|
|
- platform: esphome
|
|
|
|
wifi:
|
|
ssid: !secret wifi_ssid
|
|
password: !secret wifi_password
|
|
ap:
|
|
ssid: the-saloon Fallback Hotspot
|
|
password: "JrEe6jVLK36I"
|
|
|
|
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;
|
|
}); |