-
Notifications
You must be signed in to change notification settings - Fork 1
/
device_base_esp32_nonetwork.yaml
71 lines (62 loc) · 1.8 KB
/
device_base_esp32_nonetwork.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
esphome:
name: $friendly_name
platform: ESP32
board: nodemcu-32s
# wifi:
# ssid: !secret wifi_ssid
# password: !secret wifi_password
#logger:w
# api:
# ota:
# captive_portal:
# switch:
# - platform: restart
# id: restart1
# name: $friendly_name ESP32 Restart
# time:
# - platform: homeassistant
# on_time:
# # Every morning at 12:30am
# - seconds: 0
# minutes: 30
# hours: 0
# then:
# - switch.turn_on: restart1
# 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
# # Sensors that the ESPhome unit is capable of reporting
# sensor:
# - platform: wifi_signal
# name: "$friendly_name WiFi Signal"
# update_interval: 10min
# - platform: uptime
# internal: true
# id: uptime_sensor
# update_interval: 10min
# 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();