-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmotionsensor.yaml
165 lines (150 loc) · 3.38 KB
/
motionsensor.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
```
esphome:
name: motionsensor
comment: Human Presence Sensor 24GHz PS-HPS
friendly_name: motionsensor
name_add_mac_suffix: True
platformio_options:
board_build.flash_mode: dio
project:
name: HomeMade.Human_Presence_Sensor
version: 1W
external_components:
- source: custom-components
esp32:
board: esp32-c3-devkitm-1
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "{your-encrption-key}"
ota:
password: "{your-password-here}"
wifi:
power_save_mode: NONE
ap:
ssid: "MOTION-SENSOR"
captive_portal:
web_server:
port: 80
binary_sensor:
- platform: status
name: Online
id: ink_ha_connected
- platform: ld2410
has_target:
name: Presence
has_moving_target:
name: Moving Target
has_still_target:
name: Still Target
sensor:
- platform: template
id: sys_esp_temperature
name: ESP Temperature
lambda: return temperatureRead();
unit_of_measurement: °C
device_class: TEMPERATURE
update_interval: 30s
entity_category: "diagnostic"
- platform: uptime
name: Uptime
id: sys_uptime
update_interval: 10s
- platform: wifi_signal
name: RSSI
id: wifi_signal_db
update_interval: 1s
entity_category: "diagnostic"
- platform: template
id: esp_memory
icon: mdi:memory
name: ESP Free Memory
lambda: return heap_caps_get_free_size(MALLOC_CAP_INTERNAL) / 1024;
unit_of_measurement: 'kB'
state_class: measurement
entity_category: "diagnostic"
- platform: ld2410
moving_distance:
name : Moving Distance
id: moving_distance
still_distance:
name: Still Distance
id: still_distance
moving_energy:
name: Move Energy
still_energy:
name: Still Energy
detection_distance:
name: Detection Distance
light:
name: Sun Light
time:
- platform: sntp
id: time_now
servers:
- ntp.aliyun.com
uart:
id: uart_bus
tx_pin: GPIO10
rx_pin: GPIO9
baud_rate: 256000
parity: NONE
stop_bits: 1
ld2410:
timeout: 150s
id: ld2410_radar
#max_move_distance : 6m
#max_still_distance: 0.75m
g0_move_threshold: 50
g0_still_threshold: 40
g1_move_threshold: 50
g1_still_threshold: 20
g2_move_threshold: 20
g2_still_threshold: 40
g3_move_threshold: 20
g3_still_threshold: 40
g4_move_threshold: 20
g4_still_threshold: 40
g5_move_threshold: 20
g5_still_threshold: 40
g6_move_threshold: 20
g6_still_threshold: 40
g7_move_threshold: 20
g7_still_threshold: 40
g8_move_threshold: 20
g8_still_threshold: 40
button:
- platform: template
name: "Enable LD2410 BLE"
entity_category: "config"
icon: mdi:bluetooth
on_press:
lambda: |-
id(ld2410_radar) -> ble_control(true);
- platform: template
name: "Disable LD2410 BLE"
entity_category: "config"
icon: mdi:bluetooth-off
on_press:
lambda: |-
id(ld2410_radar) -> ble_control(false);
- platform: template
name: "LD2410 Reboot"
icon: mdi:radar
entity_category: "config"
on_press:
lambda: |-
// auto* radar = LD2410Component::get(ld2410);
// radar -> roboot();
id(ld2410_radar) -> reboot();
- platform: restart
icon: mdi:power-cycle
name: "ESP Reboot"
- platform: factory_reset
disabled_by_default: True
name: Factory Reset
id: factory_reset_all