/
esp32-custom-collector.yaml
112 lines (98 loc) · 2.72 KB
/
esp32-custom-collector.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
substitutions:
devicename: esp32-wp6003-ec2
friendly_name: ESP Collector 2 - Custom BLE Devices
esphome:
name: ${devicename}
platform: ESP32
board: m5stack-core-esp32
platformio_options:
upload_speed: 115200
includes:
- wp6003.h
wifi:
ssid: ${wifi_ssid}
password: ${wifi_pw}
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esp32-Wp6003 Fallback Hotspot"
password: ${esp32-ec2-ap_pw}
captive_portal:
# Enable logging
logger:
level: DEBUG
# Enable Home Assistant API
api:
ota:
sensor:
# Custom Sensors
- platform: custom
lambda: |-
auto livingroom_wp6003 = new WP6003("6003#060030393E2D4", 60000);
App.register_component(livingroom_wp6003);
return {livingroom_wp6003->temperature_sensor,
livingroom_wp6003->tvoc_sensor,
livingroom_wp6003->hcho_sensor,
livingroom_wp6003->co2_sensor,
livingroom_wp6003->error_sensor};
sensors:
- name: "Livingroom - WP6003 Temperature"
unit_of_measurement: °C
accuracy_decimals: 1
- name: "Livingroom - WP6003 TVOC"
unit_of_measurement: ppm
accuracy_decimals: 3
- name: "Livingroom - WP6003 HCHO"
unit_of_measurement: ppm
accuracy_decimals: 3
- name: "Livingroom - WP6003 CO2"
unit_of_measurement: ppm
accuracy_decimals: 0
- name: "Livingroom - WP6003 Connection Status"
accuracy_decimals: 0
# Custom Sensors
- platform: custom
lambda: |-
auto bedroom_wp6003 = new WP6003("6003#060030393E6B5", 60000);
App.register_component(bedroom_wp6003);
return {bedroom_wp6003->temperature_sensor,
bedroom_wp6003->tvoc_sensor,
bedroom_wp6003->hcho_sensor,
bedroom_wp6003->co2_sensor,
bedroom_wp6003->error_sensor};
sensors:
- name: "Bedroom - WP6003 Temperature"
unit_of_measurement: °C
accuracy_decimals: 1
- name: "Bedroom - WP6003 TVOC"
unit_of_measurement: ppm
accuracy_decimals: 3
- name: "Bedroom - WP6003 HCHO"
unit_of_measurement: ppm
accuracy_decimals: 3
- name: "Bedroom - WP6003 CO2"
unit_of_measurement: ppm
accuracy_decimals: 0
- name: "Bedroom - WP6003 Connection Status"
accuracy_decimals: 0
light:
- platform: fastled_clockless
chipset: WS2812B
pin: 27
num_leds: 25
rgb_order: GRB
id: status_led
name: ${friendly_name} - Light
color_correct: [0%, 0%, 50%]
effects:
- random:
- flicker:
- addressable_rainbow:
binary_sensor:
- platform: gpio
pin:
number: 39
inverted: true
name: ${friendly_name} - Button
on_press:
then:
- light.toggle: status_led