-
Notifications
You must be signed in to change notification settings - Fork 1
/
hello world esp32.yaml
86 lines (72 loc) · 1.93 KB
/
hello world esp32.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
substitutions:
friendly_name: pidcontrol
esphome:
name: $friendly_name
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
esp32:
board: nodemcu-32s
framework:
version: recommended
logger:
api:
ota:
text_sensor:
# Send IP Address
- platform: wifi_info
ip_address:
name: $friendly_name IP Address
# Send Uptime in raw seconds
- platform: template
name: $friendly_name Uptime
id: uptime_human
icon: mdi:clock-start
update_interval: 5s
# Sensors that the ESPhome unit is capable of reporting
# uart:
# rx_pin: GPIO12
# tx_pin: GPIO14
# baud_rate: 9600
sensor:
# - platform: pmsx003
# type: PMSX003
# pm_1_0:
# name: "Particulate Matter <1.0µm Concentration"
# pm_2_5:
# name: "Particulate Matter <2.5µm Concentration"
# pm_10_0:
# name: "Particulate Matter <10.0µm Concentration"
- platform: wifi_signal
name: $friendly_name WiFi Signal
update_interval: 5s
- platform: uptime
internal: true
id: uptime_sensor
update_interval: 5s
on_raw_value:
then:
- text_sensor.template.publish:
id: uptime_human
# Custom C++ code to generate the result
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();
binary_sensor:
- platform: status
name: "Node Status"
id: system_status
time:
- platform: homeassistant
id: esptime