-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsensor_reader.yaml
57 lines (46 loc) · 1.04 KB
/
sensor_reader.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
esphome:
name: sensor_reader
platform: ESP32
board: esp32dev
includes:
- uart_read_line_sensor.h
#esp32:
# board: esp32dev
# framework:
# type: arduino
# Enable logging
logger:
level: VERBOSE #makes uart stream available in esphome logstream
baud_rate: 0 #disable logging over uart
# Enable Home Assistant API
api:
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esphome-Web-9D4140"
password: "kmPrJ6O27s62"
captive_portal:
uart:
id: sensor_reader
tx_pin: 18
rx_pin: 19
baud_rate: 9600
text_sensor:
- platform: custom
text_sensors:
id: "sensor_reader_uart"
name: "Soil Sensor Reader"
lambda: |-
auto sensor_measurements = new UartReadLineSensor(id(sensor_reader));
App.register_component(sensor_measurements);
return {sensor_measurements};
switch:
- platform: uart
name: "read sensor"
data: '1M!'
- platform: uart
name: "get measurement"
data: '1D0!'