Coder Social home page Coder Social logo

uncle-yura / esphome-ld2450 Goto Github PK

View Code? Open in Web Editor NEW
54.0 8.0 13.0 57 KB

ESPHome LD2450 mmWave custom external component

License: GNU General Public License v3.0

Python 40.98% C++ 57.51% C 1.51%
esphome external-component ld2450 mmwave radar sensor

esphome-ld2450's People

Contributors

amcfague avatar uncle-yura avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esphome-ld2450's Issues

Cannot compile

I am getting the following error while compiling.

INFO ESPHome 2023.12.0
INFO Reading configuration /config/esphome/office.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing office (board: wemos_d1_mini32; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Dependency Graph
|-- AsyncTCP-esphome @ 2.0.1
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.1.0
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- noise-c @ 0.1.4
Compiling .pioenvs/office/src/esphome/components/ld2450/ld2450.cpp.o
src/esphome/components/ld2450/ld2450.cpp:3:10: fatal error: number/entry_point.h: No such file or directory
 #include "number/entry_point.h"
          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pioenvs/office/src/esphome/components/ld2450/ld2450.cpp.o] Error 1
========================== [FAILED] Took 5.60 seconds ==========================

Multiple LD2450s on one ESP?

Hello,
I would like to know if it's possible to use your component for more than one LD2450 on the same Esp32, and if yes, how.

Best regards

Aaron

Unable to detect more than one person

Only detects 1 person in the room even when there are multiple people in the room

esphome:
  name: pico-ld2450-01
  friendly_name: pico_ld2450_01

rp2040:
  board: rpipicow
  framework:
    # Required until https://github.com/platformio/platform-raspberrypi/pull/36 is merged
    platform_version: https://github.com/maxgerhardt/platform-raspberrypi.git

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "encryption_key"

ota:
  password: "ota_password"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot in case wifi connection fails
  ap:
    ssid: "Pico-Ld2450-01 Fallback Hotspot"
    password: "WZV4JdKzKoNk"

external_components:
  - source:
      type: git
      url: https://github.com/uncle-yura/esphome-ld2450
      ref: master
    components: [ ld2450 ]

uart:
  id: uart_bus
  tx_pin:
    number: GPIO16
  rx_pin:
    number: GPIO17
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

ld2450:
  uart_id: uart_bus
  update_interval: 1s
  invert_y: false
  invert_x: false

binary_sensor:
- platform: ld2450
  has_target:
    name: Presence
  has_moving_target:
    name: Moving Target
  has_still_target:
    name: Still Target
  presence_regions:
    - name: "Custom Presence Region 0"
      region_id: presence_region_0

text_sensor:
  - platform: ld2450
    version:
      name: "FW"
    mac_address:
      name: "MAC address"

button:
  - platform: restart
    name: "ESP Restart"
  - platform: ld2450
    factory_reset:
      name: "Factory reset"
    reboot:
      name: "Reboot"

switch:
  - platform: ld2450
    single_target:
      name: "Single target"
    bluetooth:
      name: "Bluetooth"

number:
- platform: ld2450
  rotate:
    restore_value: true
    initial_value: 0
    name: "Rotate angle"
  presence_timeout:
    name: "Presence timeout"
  presence_regions:
    - x0: 100
      y0: 100
      x1: 200
      y1: 200
      id: presence_region_0
  entry_points:
    - x: 0
      y: 0
  region_0:
    x0:
      name: R0X0
    y0:
      name: R0Y0
    x1:
      name: R0X1
    y1:
      name: R0Y1

  region_1:
    x0:
      name: R1X0
    y0:
      name: R1Y0
    x1:
      name: R1X1
    y1:
      name: R1Y1

  region_2:
    x0:
      name: R2X0
    y0:
      name: R2Y0
    x1:
      name: R2X1
    y1:
      name: R2Y1

select:
  - platform: ld2450
    baud_rate:
      name: "Baud rate"
    regions_type:
      name: "Regions type"

sensor:
- platform: ld2450
  target_count:
    name: Target count

  person_0:
    position_x:
      name: "P0X"  

    position_y:
      name: "P0Y"  

    speed:
      name: "S0"  

    resolution:
      name: "R0"  

  person_1:
    position_x:
      name: "P1X"  

    position_y:
      name: "P1Y"  

    speed:
      name: "S1"  

    resolution:
      name: "R1"  

  person_2:
    position_x:
      name: "P2X"  

    position_y:
      name: "P2Y"  

    speed:
      name: "S2"  

    resolution:
      name: "R2"

Target angel and distance

Thanks for your great work !
I would like to trigger actions in home asstistant depending on target distance and angle. The values are shown in the app.
Is it possible to get those values as sensor readings directly from the LD2450 ?

:-)

Multi-Conf

Здравствуйте.
Спасибо за код.

Можете добавить для работы с несколькими датчиками в init.py

MULTI_CONF = True?

Zones - Select region doesnt work

Hey, i am using your yaml with d1 mini and ld2450.

Sensor works expect zones and select regions.

I'm creating a region for example R0x0: 0 R0x1: 300 / R0y0: 0 R0y1: 300. After that i selecting Detect - Ignore and neither of two works.

image

My yaml.

esphome:
  name: mmwave-kitchen
  friendly_name: MMwave-Kitchen

external_components:
  - source:
      type: git
      url: https://github.com/uncle-yura/esphome-ld2450
      ref: master
    components: [ ld2450 ]

esp8266:
  board: d1_mini

# Enable logging
logger:
  baud_rate: 0

# Enable Home Assistant API
api:
  encryption:
    key: ""

ota:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password


  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "your-sensor-hotspot"
    password: "your-password"

captive_portal:   

uart:
  id: uart_bus
  tx_pin: 
    number: GPIO1
  rx_pin: 
    number: GPIO3
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

ld2450:
  uart_id: uart_bus
  update_interval: 1s
  invert_y: false
  invert_x: false

binary_sensor:
- platform: ld2450
  has_target:
    name: Presence
  has_moving_target:
    name: Moving Target
  has_still_target:
    name: Still Target
  presence_regions:
    - name: "Custom Presence Region 0"
      region_id: presence_region_0

text_sensor:
  - platform: ld2450
    version:
      name: "FW"
    mac_address:
      name: "MAC address"

button:
  - platform: restart
    name: "ESP Restart"
  - platform: ld2450
    factory_reset:
      name: "Factory reset"
    reboot:
      name: "Reboot"

switch:
  - platform: ld2450
    single_target:
      name: "Single target"
    bluetooth:
      name: "Bluetooth"

number:
- platform: ld2450
  rotate:
    restore_value: true
    initial_value: 0
    name: "Rotate angle"
  presence_timeout:
    name: "Presence timeout"
  presence_regions:
    - x0: 100
     y0: 100
      x1: 200
      y1: 200
      id: presence_region_0
  entry_points:
    - x: 0
      y: 0
  region_0:
    x0:
      name: R0X0
    y0:
      name: R0Y0
    x1:
      name: R0X1
    y1:
      name: R0Y1

  region_1:
    x0:
      name: R1X0
    y0:
      name: R1Y0
    x1:
      name: R1X1
    y1:
      name: R1Y1

  region_2:
    x0:
      name: R2X0
    y0:
      name: R2Y0
    x1:
      name: R2X1
    y1:
      name: R2Y1

select:
  - platform: ld2450
    baud_rate:
      name: "Baud rate"
    regions_type:
      name: "Regions type"

sensor:
- platform: ld2450
  target_count:
    name: Target count

  person_0:
    position_x:
      name: "P0X"  

    position_y:
      name: "P0Y"  

    speed:
      name: "S0"  

    resolution:
      name: "R0"  

  person_1:
    position_x:
      name: "P1X"  

    position_y:
      name: "P1Y"  

    speed:
      name: "S1"  

    resolution:
      name: "R1"  

  person_2:
    position_x:
      name: "P2X"  

    position_y:
      name: "P2Y"  

    speed:
      name: "S2"  

    resolution:
      name: "R2"

Set Custom Presence Region

Hey,
I'm quite stupid so I cant figure out how to use custom presence regions. I'd like to split up my room into multiple zones and use the ld2450 to detect and tell home assistant which one I'm in. How would I go about achieving this?

Turn off/on the radar?

Thank you for this nice esphome component!

Just one question: Is it possible to turn off/on the radar transmitter at runtime? (The easiest way probably would be if the UART protocol supports this. But I don't know if this is the case).

How to use zone 1,2,3 ?

Sorry for the dumb question, but how do i use the zones i can make with the app? Not the custom zones.
How do i get a binary sensor from them?
Regards Michael

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.