Hey,
I’ve got my LD2450 set and working with a d1 mini,
I am facing a few issues:
1. The zone doesn’t work as intended, Yes the zone creates perfectly but the zone status stays active and doesn’t change to inactive when no presence is detected in the specified zone.
2. After every restart either from esp8266 or HASS the zones reset to defaults and the multi-tracking toggle goes off.
3. Zones in Automation cannot be used as a trigger as they are always set to active.
Any help will be really appreciated, a newbie to HASS.
Here is my yaml for esp8266:
esphome:
name: bedroom-presence
friendly_name: Bedroom Presence
esp8266:
board: d1_mini
external_components:
- source: github://pr#5674
components: [ ld2450 ]
refresh: 0s
# Enable logging
logger:
baud_rate: 0
# Enable Home Assistant API
api:
encryption:
key: "***********************************"
ota:
- platform: esphome
password: "*********************************"
wifi:
ssid: ******** wifi_ssid
password: ******** wifi_password
ap:
ssid: "Bedroom-Presence"
password: "*********"
captive_portal:
uart:
id: ld2450_uart
tx_pin: GPIO1 # TX Pin (ESP8266 D1 Mini)
rx_pin: GPIO3 # RX Pin (ESP8266 D1 Mini)
baud_rate: 256000
parity: NONE
stop_bits: 1
ld2450:
uart_id: ld2450_uart
id: ld2450_sensor
throttle: 1000ms
binary_sensor:
- platform: ld2450
ld2450_id: ld2450_sensor
has_target:
name: "Presence"
has_moving_target:
name: "Moving Target"
has_still_target:
name: "Still Target"
- platform: template
name: "Zone 1 Active"
id: zone_1_active
lambda: |-
return (id(zone_1_x1).state != 0 || id(zone_1_y1).state != 0 ||
id(zone_1_x2).state != 0 || id(zone_1_y2).state != 0);
- platform: template
name: "Zone 2 Active"
id: zone_2_active
lambda: |-
return (id(zone_2_x1).state != 0 || id(zone_2_y1).state != 0 ||
id(zone_2_x2).state != 0 || id(zone_2_y2).state != 0);
- platform: template
name: "Zone 3 Active"
id: zone_3_active
lambda: |-
return (id(zone_3_x1).state != 0 || id(zone_3_y1).state != 0 ||
id(zone_3_x2).state != 0 || id(zone_3_y2).state != 0);
sensor:
- platform: ld2450
ld2450_id: ld2450_sensor
target_count:
name: "Presence Target Count"
still_target_count:
name: "Still Target Count"
moving_target_count:
name: "Moving Target Count"
target_1:
x:
name: "Target-1 X"
y:
name: "Target-1 Y"
speed:
name: "Target-1 Speed"
angle:
name: "Target-1 Angle"
distance:
name: "Target-1 Distance"
resolution:
name: "Target-1 Resolution"
target_2:
x:
name: "Target-2 X"
y:
name: "Target-2 Y"
speed:
name: "Target-2 Speed"
angle:
name: "Target-2 Angle"
distance:
name: "Target-2 Distance"
resolution:
name: "Target-2 Resolution"
target_3:
x:
name: "Target-3 X"
y:
name: "Target-3 Y"
speed:
name: "Target-3 Speed"
angle:
name: "Target-3 Angle"
distance:
name: "Target-3 Distance"
resolution:
name: "Target-3 Resolution"
number:
- platform: ld2450
ld2450_id: ld2450_sensor
presence_timeout:
name: "Presence Timeout"
zone_1:
x1:
name: "Zone-1 X1"
id: zone_1_x1
y1:
name: "Zone-1 Y1"
id: zone_1_y1
x2:
name: "Zone-1 X2"
id: zone_1_x2
y2:
name: "Zone-1 Y2"
id: zone_1_y2
zone_2:
x1:
name: "Zone-2 X1"
id: zone_2_x1
y1:
name: "Zone-2 Y1"
id: zone_2_y1
x2:
name: "Zone-2 X2"
id: zone_2_x2
y2:
name: "Zone-2 Y2"
id: zone_2_y2
zone_3:
x1:
name: "Zone-3 X1"
id: zone_3_x1
y1:
name: "Zone-3 Y1"
id: zone_3_y1
x2:
name: "Zone-3 X2"
id: zone_3_x2
y2:
name: "Zone-3 Y2"
id: zone_3_y2
switch:
- platform: ld2450
ld2450_id: ld2450_sensor
bluetooth:
name: "Bluetooth Control"
multi_target:
name: "Multi Target Tracking"
select:
- platform: ld2450
ld2450_id: ld2450_sensor
baud_rate:
name: "Baud Rate"
zone_type:
name: "Zone Type"
text_sensor:
- platform: ld2450
ld2450_id: ld2450_sensor
version:
name: "LD2450 Firmware"
mac_address:
name: "LD2450 BT MAC Address"
target_1:
direction:
name: "Target-1 Direction"
target_2:
direction:
name: "Target-2 Direction"
target_3:
direction:
name: "Target-3 Direction"