forked from Lyr3x/Roode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
peopleCounter.yaml
144 lines (129 loc) · 3.18 KB
/
peopleCounter.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
substitutions:
devicename: roode8266
friendly_name: $devicename
external_components:
refresh: always
source:
type: git
url: https://github.com/Lyr3x/Roode
ref: master
esphome:
name: $devicename
platform: ESP8266
board: d1_mini
wifi:
networks:
- ssid: !secret ssid1
password: !secret ssid1_password
use_address: $devicename
fast_connect: True
power_save_mode: none
domain: .local
captive_portal:
api:
password: !secret api_password
reboot_timeout: 60min
services:
- service: set_counter
variables:
newCount: int
then:
- lambda: "id(roode_platform)->sendCounter(newCount);"
- service: reset_counter
then:
- lambda: "id(roode_platform)->sendCounter(0);"
- service: recalibrate
then:
- lambda: "id(roode_platform)->recalibration();"
ota:
password: !secret ota_password
web_server:
port: 80
auth:
username: admin
password: !secret web_password
# Enable logging
logger:
level: INFO
i2c:
sda: 4
scl: 5
roode:
id: roode_platform
i2c_address: 0x29
update_interval: 10ms
calibration: true
roi_height: 16
roi_width: 6
max_threshold_percentage: 80
roi_calibration: false
invert_direction: true
restore_values: true
switch:
- platform: restart
name: $friendly_name Restart
binary_sensor:
- platform: status
name: $friendly_name Status
- platform: roode
presence_sensor:
name: $friendly_name presence
sensor:
- platform: roode
id: hallway
people_counter_sensor:
id: peopleCounter
name: $friendly_name people counter
distance_sensor:
name: $friendly_name distance
filters:
- delta: 10.0
max_threshold_zone0:
name: $friendly_name max zone 0
max_threshold_zone1:
name: $friendly_name max zone 1
min_threshold_zone0:
name: $friendly_name min zone 0
min_threshold_zone1:
name: $friendly_name min zone 1
roi_height:
name: $friendly_name ROI height
roi_width:
name: $friendly_name ROI width
- platform: wifi_signal
name: $friendly_name RSSI
update_interval: 60s
- platform: uptime
name: Uptime Sensor
id: uptime_sensor
update_interval: 60s
internal: true
on_raw_value:
then:
- text_sensor.template.publish:
id: uptime_human
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 ? String(days) + "d " : "") +
(hours ? String(hours) + "h " : "") +
(minutes ? String(minutes) + "m " : "") +
(String(seconds) + "s")
).c_str();
text_sensor:
- platform: roode
version:
name: $friendly_name version
- platform: roode
entry_exit_event:
name: $friendly_name last direction
- platform: template
name: $friendly_name Uptime Human Readable
id: uptime_human
icon: mdi:clock-start