Git Product home page Git Product logo

mmwave-presense-sensor-d1-mini-dfrobot-'s People

Contributors

igiannakas 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  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  avatar

mmwave-presense-sensor-d1-mini-dfrobot-'s Issues

Settings wont be saved

I have a problem with saving the settings.
Once I reload the page, the settings I made are gone. Either in HA or the webinterface.

Running on the latest esphome version: 2022.12.7

Distance

Have you came across a way to mesure distance from the sensor ?

A esp32 d1 mini is perfect

Hi, i tried a esp32 d1 mini, with 2 rows of pins on either side. and i can connect the sensor directly. pin 21/22 for rx/tx, 16/17 for the IO1 (not used) and IO2 from the sensor and vcc and gnd...
esp32

Several steps missing in instructions

I run HomeAssistant OS (HAOS) and have ESPhome installed in HA. There is no real clear instructions anywhere on how to get the files in what spot to make all of this work.
I was able to actually hack it together and have it working... (Love it, works excellent).

Couple items to note: 1) I don't think anything references any part of the files in "Components". May want to remove this to make the whole package cleaner.
2) Before my cobbling together in HAOS(Esphome), I did try on my mac, and got some errors around wrong CPU
3) in HAOS, I had to create a NEW device, adopt it, then edit the YAML file and copy parts of the sensor.yaml over, place the header and packages files in my HAOS (ESPhome directory) config/esphome/headers and config/esphome/packages.
Here is an example of my device (yaml file in ESPhome): Notice when ESPhome adopted it and created the device, it identified my D1-mini as: esp01_1m. so I kept this


substitutions:
  # change device name to match your desired name
  device_name: garage-occupancy-sensor
  # change sensor name below to the one you want to see in Home Assistant
  device_name_pretty: Garage Occupancy Sensor
  # change the below to be your WiFi SSID
  ssid: SSIDNAME
  # change the below to be your WiFi password
  wifi_password: SSIDPASSWORD
  # UART Pin configured for a D1 Mini stacked setup
  uart_tx_pin: GPIO4
  # TX Pin configured for a D1 Mini stacked setup
  uart_rx_pin: GPIO5
  # RX Pin configured for a D1 Mini stacked setup
  gpio_pin: GPIO16

# include the yml file with the sensor configuration
packages:
  inclusions: !include packages/leapmmw_sensor.yml

esphome:
  name: "garage-sensor"

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:


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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-E81A78"
    password: "A5ilRQ6U13Ke"

captive_portal:
web_server:
  port: 80
  version: 2
  include_internal: true

not saving states

hi.
i have installed your nice code.

but i cannot get it to save the states i select.

as an example. i try to select a distance of 5Meters. if i do this via home assistant, it is not registered on the esphome web portal. and the same thing if i set it in the esphome portal. it is not reansferred to homeassistant.

i do see the code being sent to the d1mini. but i dont know if it is set.

lso. if i set the distance in the portal. the state does not change. this goes for both distance, latency and sensitivity

combine in one yaml

First of all, thank you for the detailed post. The way it worked for me was creating a folder called mmwave in the esphome directory just to organise things, inside I copied the 2 folders header and packages. I had to modify the path in the yaml to the mmwave/packages/leapmmw_sensor.yml and then edited the sensor yaml and change the header path to mmwave/header/leapmmw_sensor.h, I guess I could just puth both header and sensor in one folder.

I have 2 questions, Would it be posible to combine the sensor and header in one yaml that flases into the mini d1, and second, in case this is not posible, say you have 3 units, do I need to create 3 folders with 3 sensor.h and sensor.yml files, o could I just redirect all to the same path?

Can't change names of distance, latency, or sensitivity sensors

First of all, thank you for sharing this. Out of the box for one sensor it works amazingly well.

My issue is that I would like to run many of these. When I deploy the first one, my friendly name does not get used for the distance, latency, or sensitivity sensors. For instance, "distance" is just called "number.distance" as opposed to "number.sensor-name-distance". I tried updating the leapmmw_sensor.yml file by changing the names (while leaving the id as-is) but with the 3 mentioned sensors, once I change those names, they will no longer update in HA with values stored in the device. They just look empty, even after waiting a very long time.

I tested this by going back and one-by-one putting the original "names" back, and as I did that, the values started appearing in HA and working as expected.

I believe that the issue is the functions in the header file are referring to the Name, as opposed to the id.

For example from leapmmw_sensor.yml:

number:
  - platform: template
    name: ${device_name_pretty} Distance #original value: distance
    id: distance # do not change
    entity_category: config
    min_value: 0.15
    max_value: 9.45
    step: 0.15
    unit_of_measurement: M
    mode: box
    lambda: |-
      leapmmw(id(uart_bus)).getmmwConf("getRange");
      return {};
    set_action:
      - switch.turn_off: mmwave_sensor
      - delay: 2s
      - uart.write: !lambda
          std::string range = "setRange 0 " + str_sprintf("%.2f", x);
          return std::vector<unsigned char>(range.begin(), range.end());
      - delay: 3s
      - switch.turn_on: mmwave_sensor

and from leapmmw_sensor.h:

// leapMMW:/>getRange
          if (getline.substr(0, 18) == "leapMMW:/>getRange" || getline.substr(0, 8) == "getRange") {
            std::string getRange = line.substr(15, 4);
            if (getRange.empty()) {
              ESP_LOGD("custom", "Did not find a value for getRange");
            } else {
              ESP_LOGD("custom", "The value of getRange is: %f", parse_number<float>(getRange).value());
              publishNumber("distance", parse_number<float>(getRange).value());
            }
          }

Once I change the "name" in the yml file, the function publishNumber("distance", parse_number<float>(getRange).value()); no longer seems to work.

Is there a better way to have all of the entities associated with the device have names prefixed with the device name?

Thanks!

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.