-
Notifications
You must be signed in to change notification settings - Fork 1
/
multisensor.yaml
127 lines (113 loc) · 2.94 KB
/
multisensor.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
esphome:
name: multisensor1
platform: ESP32
board: esp32dev
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
logger:
api:
ota:
captive_portal:
substitutions:
friendly_name: multisensor1
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
i2c:
# defaults
# Sensors that the ESPhome unit is capable of reporting
sensor:
- platform: wifi_signal
name: $friendly_name WiFi Signal
update_interval: 60s
# https://esphome.io/components/sensor/tsl2591.html
- platform: tsl2591
name: "Ambient Light Sensor"
id: "tls2591"
# address: 0x29 # default
update_interval: 30s
# device_factor: 53
# glass_attenuation_factor: 14.4
# visible:
# name: "TSL2591 visible light"
# infrared:
# name: "TSL2591 infrared light"
# full_spectrum:
# name: "TSL2591 full spectrum light"
calculated_lux:
id: i_lux
name: "TSL2591 Lux"
# https://esphome.io/components/sensor/bme280.html
- platform: bme280
temperature:
name: "BME280 Temperature"
accuracy_decimals: 3
pressure:
name: "BME280 Pressure"
accuracy_decimals: 3
filters:
- offset: 15.4
humidity:
name: "BME280 Humidity"
accuracy_decimals: 3
address: 0x76
update_interval: 60s
- platform: uptime
internal: true
id: uptime_sensor
update_interval: 60s
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();
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
# binary_sensor:
# # Enables the SW-420 Vibration Sensor
# - platform: gpio
# name: $friendly_name Vibration Sensor
# pin:
# number: GPIO32
# mode: INPUT
# device_class: vibration
# filters:
# - delayed_on: 10ms
# - delayed_off: 5sec
# - platform: gpio
# pin: GPIO33
# name: $friendly_name PIR Sensor
# device_class: motion