-
Notifications
You must be signed in to change notification settings - Fork 0
/
SHT35 temperature only sensor.yaml
90 lines (79 loc) · 1.87 KB
/
SHT35 temperature only sensor.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
substitutions:
device_name: sht-temperature-sensor
device_name_pretty: SHT Sensor
# change the below to be your WiFi SSID
ssid: SSID
# change the below to be your WiFi password
wifi_password: PASSWORD
# sleep duration
sleep_duration: 180s
#temperature sensor SDA pin
sda_pin: "18"
#temperature sensor SCL pin
scl_pin: "19"
esp32:
board: wemos_d1_mini32
framework:
type: arduino
# Enable Home Assistant API
api:
password: ""
ota:
password: ""
wifi:
ssid: "${ssid}"
password: "${wifi_password}"
fast_connect: true
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "${device_name_pretty}"
password: "${wifi_password}"
i2c:
- id: bus_sht
sda: ${sda_pin}
scl: ${scl_pin}
scan: false
deep_sleep:
id: deep_sleep_1
esphome:
name: $device_name
on_boot:
priority: -108
then:
- wait_until:
condition:
api.connected:
- component.update: temp_humidity_sensor
- delay: 500ms
- component.update: temp_humidity_sensor
- delay: 2000ms
#- component.update: temp_humidity_sensor
- if:
condition:
binary_sensor.is_off: prevent_sleep
then:
- deep_sleep.enter:
sleep_duration: ${sleep_duration}
binary_sensor:
- platform: homeassistant
entity_id: input_boolean.sht_sensor_prevent_sleep
id: prevent_sleep
on_press:
- deep_sleep.prevent: deep_sleep_1
on_release:
- deep_sleep.enter:
sleep_duration: ${sleep_duration}
sensor:
- platform: sht3xd
i2c_id: bus_sht
id: temp_humidity_sensor
address: 0x45
update_interval: never
temperature:
name: "${device_name_pretty} Temperature"
accuracy_decimals: 2
force_update: true
filters:
- offset: -0.21 # latest case
humidity:
name: "${device_name_pretty} Humidity"