-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdesk.yaml
59 lines (50 loc) · 1.01 KB
/
desk.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
esphome:
name: name
platform: ESP32
board: nodemcu-32s
includes:
- src/desk/grove_sensor.h
libraries:
- "Grove Ultrasonic Ranger"
logger:
# level: INFO
api:
password: ""
ota:
safe_mode: false
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_pass
fast_connect: true
# deep_sleep:
# run_duration: 30s
# sleep_duration: 30s
sensor:
- platform: custom
lambda: |-
auto sensor = new GroveUltraSonic(1000, 5);
App.register_component(sensor);
return {sensor};
sensors:
name: distance
unit_of_measurement: cm
filters:
- sliding_window_moving_average:
window_size: 15
send_every: 15
id: sensor_distance
text_sensor:
- platform: template
name: position
lambda: |-
auto position = id(sensor_distance).state;
if (position < 65)
{
return {"down"};
}
else if (position > 123)
{
return{"up"};
}
return {"inbetween"};
update_interval: 15s