esphome/tests/components/prometheus/common.yaml

90 lines
1.6 KiB
YAML
Raw Normal View History

esphome:
name: livingroomdevice
friendly_name: Living Room Device
area: Living Room
wifi:
ssid: MySSID
password: password1
sensor:
- platform: template
id: template_sensor1
lambda: |-
if (millis() > 10000) {
return 42.0;
} else {
return 0.0;
}
update_interval: 60s
2024-10-29 04:43:02 +01:00
text_sensor:
- platform: version
name: "ESPHome Version"
hide_timestamp: true
2024-10-29 04:43:02 +01:00
- platform: template
id: template_text_sensor1
lambda: |-
if (millis() > 10000) {
return {"Hello World"};
} else {
return {"Goodbye (cruel) World"};
}
update_interval: 60s
binary_sensor:
- platform: template
id: template_binary_sensor1
lambda: |-
if (millis() > 10000) {
return true;
} else {
return false;
}
switch:
- platform: template
id: template_switch1
lambda: |-
if (millis() > 10000) {
return true;
} else {
return false;
}
optimistic: true
fan:
- platform: template
id: template_fan1
cover:
- platform: template
id: template_cover1
lambda: |-
if (millis() > 10000) {
return COVER_OPEN;
} else {
return COVER_CLOSED;
}
lock:
- platform: template
id: template_lock1
lambda: |-
if (millis() > 10000) {
return LOCK_STATE_LOCKED;
} else {
return LOCK_STATE_UNLOCKED;
}
optimistic: true
prometheus:
include_internal: true
relabel:
template_sensor1:
id: hellow_world
name: Hello World
2024-10-29 04:43:02 +01:00
template_text_sensor1:
id: hello_text
name: Text Substitution