forked from nliaudat/floor-heating-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sensor_others.yaml
43 lines (37 loc) · 1.26 KB
/
sensor_others.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
sensor:
- platform: wifi_signal
name: "${friendly_name} WiFi Signal"
update_interval: 60s
- platform: uptime
name: "${friendly_name} Uptime"
id: uptime_sensor
update_interval: 60s
internal: true
on_raw_value:
then:
- text_sensor.template.publish:
id: uptime_human
state: !lambda |-
int seconds = round(id(uptime_sensor).raw_state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
return (
(days ? to_string(days) + "d " : "") +
(hours ? to_string(hours) + "h " : "") +
(minutes ? to_string(minutes) + "m " : "") +
(to_string(seconds) + "s")
).c_str();
- platform: internal_temperature
name: "${friendly_name} Internal Temperature"
accuracy_decimals: 1
device_class: "temperature"
unit_of_measurement: "°C"
text_sensor:
- platform: template
name: "${friendly_name} uptime"
id: uptime_human
icon: mdi:clock-start