forked from tsunglung/esphome-ld2450
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathesphome-ld2450.yaml
105 lines (95 loc) · 2.65 KB
/
esphome-ld2450.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
substitutions:
devicename: ld2450
upper_devicename: "Hi-Link LD2450"
esphome:
name: ${devicename}
comment: ${upper_devicename}
includes:
- components/ld2450_uart.h
esp8266:
board: esp01_1m
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# reboot_timeout: 0s
ap:
password: "admin1234"
ap_timeout: 30s
# Enable logging
logger:
baud_rate: 0
# Enable Home Assistant API
api:
ota:
uart:
id: uart_ld2450
tx_pin: TX
rx_pin: RX
baud_rate: 256000
parity: NONE
stop_bits: 1
# debug:
# direction: BOTH
# dummy_receiver: false
custom_component:
- lambda: |-
return {new LD2450(id(uart_ld2450))};
components:
- id: ld2450
sensor:
- platform: custom
lambda: |-
auto uart_component = static_cast<LD2450 *>(ld2450);
return {uart_component->target1Resolution, uart_component->target1Speed, uart_component->target1X, uart_component->target1Y,
uart_component->target2Resolution, uart_component->target2Speed, uart_component->target2X, uart_component->target2Y,
uart_component->target3Resolution, uart_component->target3Speed, uart_component->target3X, uart_component->target3Y,
};
sensors:
- name: "Target1 Resolution"
unit_of_measurement: "nm"
accuracy_decimals: 0
icon: mdi:artboard
- name: "Target1 Speed"
unit_of_measurement: "cm/s"
accuracy_decimals: 0
icon: mdi:speedometer
- name: "Target1 X"
unit_of_measurement: "cm"
accuracy_decimals: 0
icon: mdi:map-marker-right
- name: "Target1 Y"
unit_of_measurement: "cm"
accuracy_decimals: 0
icon: mdi:map-marker-down
- name: "Target2 Resolution"
unit_of_measurement: "nm"
accuracy_decimals: 0
icon: mdi:artboard
- name: "Target2 Speed"
unit_of_measurement: "cm/s"
accuracy_decimals: 0
icon: mdi:speedometer
- name: "Target2 X"
unit_of_measurement: "cm"
accuracy_decimals: 0
icon: mdi:map-marker-right
- name: "Target2 Y"
unit_of_measurement: "cm"
accuracy_decimals: 0
icon: mdi:map-marker-down
- name: "Target3 Resolution"
unit_of_measurement: "nm"
accuracy_decimals: 0
icon: mdi:artboard
- name: "Target3 Speed"
unit_of_measurement: "cm/s"
accuracy_decimals: 0
icon: mdi:speedometer
- name: "Target3 X"
unit_of_measurement: "cm"
accuracy_decimals: 0
icon: mdi:map-marker-right
- name: "Target3 Y"
unit_of_measurement: "cm"
accuracy_decimals: 0
icon: mdi:map-marker-down