Ld2410 ble - hlk-ld2410b

For non working UART, this worked for me:

swapped over to using RX = GPIO13/D7 and TX=GPIO15/D8

Hello, need change local to English on Phone, then app will be English.

Yes, i figured it out, thanks!
Luckily i have an iPad in english, so i use app there and i don’t need to switch language on my phone each time i want to change something.

Thanks “florok” that also worked for me. Strange. But not complaining. Was away for a while but glad to be back and have this sorted out. Thanks again.

Same with me

Full yaml for various hi-link models with external components urls and *.h file for full functionality via ESPHome. Obviously pins may vary depending on ESP32 variant used. Just thought I would put it here for reference.

1 Like

Hey guys,

Just odered a few of these to play with, have a couple of questions?

  • So is the BT distance, really only 30CM?
  • What is the speed of the device in HA?
  • I cant seem to find anything on orientation? What’s best for looking down a hallway?
  • Has anyone used something like this though a lounge to detect presence?
  • Has anyone used the distance in their automations? < 100CM start WLED lights left to right > start them right to left?

Thanks :slight_smile:

It did not work with my pie built in BT.
But when I use a ESP32 from about the same distance it works fine.
The pie is in a cabinet, could be a reason.

But anyways 4-5 m works fine for me with the ESP.
Have not finished my project yet so I can’t answer the other questions

Oh that far, awesome!

Id seen someone post a max distance of 30cm, but what you’re saying seems far more reasonable :slight_smile:

  • Has anyone used the distance in their automations? < 100CM start WLED lights left to right > start them right to left?

Should be able to use a value template for this. No idea how to do the value template yet LOL, but that’s the option. I want to make a WLED strip direction based on distance detected. If it works, should look really cool.

Thanks for answering :slight_smile:

I’m connecting via Bluetooth and it’s about 25’ away. On occasions it loses connection I restart the Bluetooth service and the hi-link device. And that seems to resolve the issue. I’m thinking I might restart those 2 items once A-day just to prevent any further problems.

The setup I have is the Sensor is On the ceiling joist at the bottom ofThe basement stares so it sees My feet 1st at the top of the stairs Using motion and moving target it usually takes about a second to trigger.

I did find that the static target hovers around 3 when nobody is around And when I’m in my kitchen Which is directly next to to the sensor it hovers around 5. And then when I step into the hallway to the basement it jumps to about 10. So I am using the static target to trigger at the top of my steps in the distance as I walk down the steps.

I am using distance to trigger the top of the stairs light Basement light independently. I Can upload my Node red flow if you would like

1 Like

Thanks mate,

I really appreciate you taking the time to write all that out :slight_smile:

25cm is a little concerning though :frowning: Its all a bit confusing, some people are saying you need an ESP super close others are saying 3m is fine.

Id love to see your flow if you want to share it :slight_smile:

The other thing I really want to know is the speed, like a second, two seconds?

Ta

EDIT

Actually re-reading, I’m very confused about your numbers LOL??

it about a Second Which for me is very acceptable. And from my understanding is pretty standard for Is radar style detectors. Also I have a couple of the things going on This flow. Such as I start a countdown timer if the switch was turned on manually Or that nodered was restarted

[{"id":"d4ef2069c11f58f9","type":"subflow","name":"basement motion occupancy","info":"","category":"","in":[],"out":[{"x":720,"y":160,"wires":[{"id":"eafcb6a9e730299a","port":0}]},{"x":720,"y":280,"wires":[{"id":"eafcb6a9e730299a","port":1}]}],"env":[],"meta":{},"color":"#DDAA99","status":{"x":520,"y":220,"wires":[{"id":"206c2c1253004e79","port":0},{"id":"6fc450abed15ee08","port":0}]}},{"id":"3fa4d37fbea6d23a","type":"server-state-changed","z":"d4ef2069c11f58f9","name":"","server":"bfa36bc5.58b5d8","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.basement_stairs_motion","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entityState"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":220,"y":180,"wires":[["6fc450abed15ee08"]]},{"id":"43f5d61cd31a7a76","type":"server-state-changed","z":"d4ef2069c11f58f9","name":"","server":"bfa36bc5.58b5d8","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.basement_stairs_occupancy","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entityState"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":230,"y":240,"wires":[["206c2c1253004e79"]]},{"id":"6fc450abed15ee08","type":"api-current-state","z":"d4ef2069c11f58f9","name":"","server":"bfa36bc5.58b5d8","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.basement_stairs_moving_target_distance","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":250,"y":100,"wires":[["eafcb6a9e730299a"]]},{"id":"206c2c1253004e79","type":"api-current-state","z":"d4ef2069c11f58f9","name":"","server":"bfa36bc5.58b5d8","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.basement_stairs_static_target_distance","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":260,"y":320,"wires":[["eafcb6a9e730299a"]]},{"id":"eafcb6a9e730299a","type":"switch","z":"d4ef2069c11f58f9","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"90","vt":"str"},{"t":"lte","v":"90","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":670,"y":220,"wires":[[],[]]},{"id":"8913b4ed2f603eb7","type":"tab","label":"basement/side entry motion","disabled":false,"info":"","env":[]},{"id":"9b4d3517358e43fc","type":"group","z":"8913b4ed2f603eb7","name":"basement","style":{"label":true,"fill":"#bfdbef"},"nodes":["1dca17727be43203","6020aaa4f764e9cf","6131c179cecbe204","0dd4c7ae5bec7165","c6062c22db540835","e118e8e4ae3f6dc1","fa4f1ec4b31a4233","9cb6bace8b8bedea","2e1fa8faa337a063","20bd9e17726d57e8"],"x":174,"y":399,"w":632,"h":302},{"id":"4aacc898866f9624","type":"group","z":"8913b4ed2f603eb7","name":"side entry","style":{"fill":"#bfdbef","label":true},"nodes":["56d98251198e2583","b928ff36d077a4b5","9295cb73d7f731fe","a823694eae90cba4","78f8487563698bad","f3c334d356aad31b","20f64ad5d0c03171","926c87850c55cefe","956148d47942857e","184ade68889c32f9"],"x":254,"y":-1,"w":592,"h":382},{"id":"1dca17727be43203","type":"debug","z":"8913b4ed2f603eb7","g":"9b4d3517358e43fc","name":"occupanice stairs","active":false,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":310,"y":440,"wires":[]},{"id":"56d98251198e2583","type":"change","z":"8913b4ed2f603eb7","g":"4aacc898866f9624","name":"top of stairs 1","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":100,"wires":[["b928ff36d077a4b5","9295cb73d7f731fe"]]},{"id":"9295cb73d7f731fe","type":"api-call-service","z":"8913b4ed2f603eb7","g":"4aacc898866f9624","name":"","server":"bfa36bc5.58b5d8","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":["be0f3b3feed4ffd410a278b7cd23e26e"],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":570,"y":80,"wires":[[]]},{"id":"a823694eae90cba4","type":"api-call-service","z":"8913b4ed2f603eb7","g":"4aacc898866f9624","name":"","server":"bfa36bc5.58b5d8","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":["be0f3b3feed4ffd410a278b7cd23e26e"],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":750,"y":140,"wires":[[]]},{"id":"6131c179cecbe204","type":"api-call-service","z":"8913b4ed2f603eb7","g":"9b4d3517358e43fc","name":"","server":"bfa36bc5.58b5d8","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":["4b525400b981de89a2cd07e6fdb6d801"],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":550,"y":480,"wires":[[]]},{"id":"0dd4c7ae5bec7165","type":"api-call-service","z":"8913b4ed2f603eb7","g":"9b4d3517358e43fc","name":"","server":"bfa36bc5.58b5d8","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":["4b525400b981de89a2cd07e6fdb6d801"],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":710,"y":540,"wires":[[]]},{"id":"78f8487563698bad","type":"debug","z":"8913b4ed2f603eb7","g":"4aacc898866f9624","name":"occupanice stairs","active":false,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":370,"y":40,"wires":[]},{"id":"0deeb9260731ba47","type":"subflow:d4ef2069c11f58f9","z":"8913b4ed2f603eb7","x":120,"y":140,"wires":[["56d98251198e2583","78f8487563698bad"],["1dca17727be43203","c6062c22db540835"]]},{"id":"c6062c22db540835","type":"change","z":"8913b4ed2f603eb7","g":"9b4d3517358e43fc","name":"bottem of stairs 1","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":500,"wires":[["6131c179cecbe204","6020aaa4f764e9cf"]]},{"id":"e118e8e4ae3f6dc1","type":"server-state-changed","z":"8913b4ed2f603eb7","g":"9b4d3517358e43fc","name":"basementStairsIR","server":"bfa36bc5.58b5d8","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.networkcontroller_basement_stairs_ir","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":300,"y":540,"wires":[["6131c179cecbe204","6020aaa4f764e9cf","fa4f1ec4b31a4233"]]},{"id":"fa4f1ec4b31a4233","type":"debug","z":"8913b4ed2f603eb7","g":"9b4d3517358e43fc","name":"stairs ir","active":false,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":520,"y":660,"wires":[]},{"id":"f3c334d356aad31b","type":"inject","z":"8913b4ed2f603eb7","g":"4aacc898866f9624","name":"triggeroff timer","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"5","topic":"","payload":"1","payloadType":"num","x":380,"y":300,"wires":[["b928ff36d077a4b5"]]},{"id":"9cb6bace8b8bedea","type":"inject","z":"8913b4ed2f603eb7","g":"9b4d3517358e43fc","name":"triggeroff timer","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"5","topic":"","payload":"1","payloadType":"num","x":300,"y":660,"wires":[["6020aaa4f764e9cf"]]},{"id":"2e1fa8faa337a063","type":"ha-device","z":"8913b4ed2f603eb7","g":"9b4d3517358e43fc","name":"basement stairs sw On","server":"bfa36bc5.58b5d8","version":0,"debugenabled":false,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"inputs":0,"deviceType":"trigger","device":"4b525400b981de89a2cd07e6fdb6d801","event":{"platform":"device","type":"turned_on","device_id":"4b525400b981de89a2cd07e6fdb6d801","entity_id":"light.basementstairsswitch","domain":"light","metadata":{"secondary":false}},"capabilities":[],"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":300,"y":600,"wires":[["20bd9e17726d57e8","6020aaa4f764e9cf"]]},{"id":"20bd9e17726d57e8","type":"debug","z":"8913b4ed2f603eb7","g":"9b4d3517358e43fc","name":"basement on","active":false,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":530,"y":600,"wires":[]},{"id":"20f64ad5d0c03171","type":"server-state-changed","z":"8913b4ed2f603eb7","g":"4aacc898866f9624","name":"side door","server":"bfa36bc5.58b5d8","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.networkcontroller_side_door","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":360,"y":140,"wires":[["9295cb73d7f731fe","b928ff36d077a4b5"]]},{"id":"926c87850c55cefe","type":"ha-device","z":"8913b4ed2f603eb7","g":"4aacc898866f9624","name":"side entry on","server":"bfa36bc5.58b5d8","version":0,"debugenabled":false,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"inputs":0,"deviceType":"trigger","device":"be0f3b3feed4ffd410a278b7cd23e26e","event":{"platform":"device","type":"turned_on","device_id":"be0f3b3feed4ffd410a278b7cd23e26e","entity_id":"light.sideentry","domain":"light","metadata":{"secondary":false}},"capabilities":[],"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":370,"y":340,"wires":[["b928ff36d077a4b5"]]},{"id":"956148d47942857e","type":"server-state-changed","z":"8913b4ed2f603eb7","g":"4aacc898866f9624","name":"static energy","server":"bfa36bc5.58b5d8","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.basement_stairs_static_target_energy","entityidfiltertype":"exact","outputinitially":false,"state_type":"num","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":350,"y":240,"wires":[["184ade68889c32f9"]]},{"id":"184ade68889c32f9","type":"switch","z":"8913b4ed2f603eb7","g":"4aacc898866f9624","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"8","vt":"num","v2":"14","v2t":"num"}],"checkall":"true","repair":false,"outputs":1,"x":370,"y":200,"wires":[["b928ff36d077a4b5","9295cb73d7f731fe"]]},{"id":"b928ff36d077a4b5","type":"controltimer","z":"8913b4ed2f603eb7","name":"","timerType":"delay","timerDurationUnit":"minute","timerDurationType":"num","timerDuration":1,"timerLoopTimeoutUnit":"second","timerLoopTimeoutType":"num","timerLoopTimeout":0,"loopTimeoutMessageType":"str","loopTimeoutMessage":"LOOP_TIMEOUT","timerMaxLoopIterationsType":"num","timerMaxLoopIterations":0,"loopMaxIterationsMessageType":"str","loopMaxIterationsMessage":"MAX_LOOP_ITERATIONS","isConsecutiveStartActionTimerResetAllowed":true,"isRunningTimerProgressVisible":true,"outputReceivedMessageOnTimerTrigger":true,"outputReceivedMessageOnTimerHalt":false,"startTimerOnReceivalOfUnknownMessage":true,"resetTimerOnReceivalOfUnknownMessage":true,"isDebugModeEnabled":true,"timerTriggeredMessageType":"str","timerTriggeredMessage":"1","timerHaltedMessageType":"str","timerHaltedMessage":"TIMER_HALTED","isStartActionEnabled":true,"isStopActionEnabled":true,"isResetActionEnabled":true,"isPauseActionEnabled":true,"isContinueActionEnabled":true,"actionPropertyNameType":"str","actionPropertyName":"payload","startActionNameType":"str","startActionName":"1","stopActionNameType":"str","stopActionName":"STOP","resetActionNameType":"str","resetActionName":"1","pauseActionNameType":"str","pauseActionName":"PAUSE","continueActionNameType":"str","continueActionName":"CONTINUE","x":580,"y":140,"wires":[["a823694eae90cba4"],[]]},{"id":"6020aaa4f764e9cf","type":"controltimer","z":"8913b4ed2f603eb7","name":"","timerType":"delay","timerDurationUnit":"minute","timerDurationType":"num","timerDuration":3,"timerLoopTimeoutUnit":"second","timerLoopTimeoutType":"num","timerLoopTimeout":0,"loopTimeoutMessageType":"str","loopTimeoutMessage":"LOOP_TIMEOUT","timerMaxLoopIterationsType":"num","timerMaxLoopIterations":0,"loopMaxIterationsMessageType":"str","loopMaxIterationsMessage":"MAX_LOOP_ITERATIONS","isConsecutiveStartActionTimerResetAllowed":true,"isRunningTimerProgressVisible":true,"outputReceivedMessageOnTimerTrigger":true,"outputReceivedMessageOnTimerHalt":false,"startTimerOnReceivalOfUnknownMessage":true,"resetTimerOnReceivalOfUnknownMessage":true,"isDebugModeEnabled":true,"timerTriggeredMessageType":"str","timerTriggeredMessage":"1","timerHaltedMessageType":"str","timerHaltedMessage":"TIMER_HALTED","isStartActionEnabled":true,"isStopActionEnabled":true,"isResetActionEnabled":true,"isPauseActionEnabled":true,"isContinueActionEnabled":true,"actionPropertyNameType":"str","actionPropertyName":"payload","startActionNameType":"str","startActionName":"1","stopActionNameType":"str","stopActionName":"STOP","resetActionNameType":"str","resetActionName":"1","pauseActionNameType":"str","pauseActionName":"PAUSE","continueActionNameType":"str","continueActionName":"CONTINUE","x":540,"y":540,"wires":[["0dd4c7ae5bec7165"],[]]},{"id":"bfa36bc5.58b5d8","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true,"credentials":{}}]

I’m using ESPHome and I’m getting around 500cm but that’s hooked up to a Seeed Xiao esp32s3, not Bluetooth. Pretty easy to setup, just need to download the sample yaml file and included *.h file from here and change pin numbers accordingly depending on the type of esp32. Honestly, since you have to get power to the 5v and ground pin it’s just 3 more pins (RX to TX, TX to RX and OUT cable to the miso pin) to connect and you can get a Seeed Xiao esp32c3 for 5 bucks or the newer ESP32’s for around 8 dollars… That or a OG esp32-wroom.

Regarding positioning, it depends, it’s small but vertical will give you probably a bit more range for horizontal will give a bit more degrees to the left and right, at least with the HLK-LD2410B, the C model is a little bit bigger as the pins are only 1.25mm apart with the HLK-LD2410B and I believe the C is 2.5mm which is the same distance between pins on a standard ESP32 but you can buy Dupont cables for the HLK-LD2410B that fit right on for 30 cents US from AliExpress. Just make sure to get the ones with pins to attach it unless you like soldiering in tight places.

1 Like

Thanks for that :slight_smile:

I’m testing with one so far and I’m using BT, but I have a temp BT proxy about 30cm away right now. And its staying connected for now.

They are a bit rubbish when it comes to using the BT which is pretty disappointing. I have another sensor that also has BT Proxy a little more then a 1m away (not line of sight though, round a corner) and it wont stay connected :frowning:

Anyway, Ill see how it goes over the next couple of days using BT, but may just solder them together.

Yeah, you get what you pay for and while they work better with ESPHome, they still aren’t the best and BT is kind of flaky and I have a BT proxy near it when I tested it using BT. I’m running this as my main MmWave/PIR sensor and it works great. The dfrobot mmwave sensor is the same sensor in the everything presense one, I’m just using a cheaper PIR because the EP1 has one that can detect up to 30ft or more and I don’t need that and it’s around 12 dollars for the Pit used in the EP1. You really need a 2d printer or know someone with one because it’s not pretty without the case but works just as good. Overall about 45 dollars US as you can only order a set of the PIR used, you can’t buy them individually but the dfrobot mmwave sensor is by far the most expensive part at roughly 30 dollars US.

How good are Jukka’s cases!

Made the same one LOL! I was having a hell of a problem with false positives on the PIR so I moved it next to the ESP and DFrobot mmWave.

I like the idea of the LD2410 because it has distance

I made a little value template

  - platform: template
    sensors:
      bedroom_hallway_direction:
        friendly_name: "Hallway Direction"
        value_template: >-
          {% if states('sensor.bedroom_hall_detection_distance') | float > 200 %}
            on
          {% else %}
            off
          {% endif %}

Set up a couple of automations on a 5m strip (WLED) in my hallway to run the wipe preset depending on which way I come in.

Still fine tuning it, but it does work :slight_smile:

1 Like

His cases are great! I’m sure you saw there were several options for cases and mounts in the link provided to tinkercatd. I will say they are a tight fit so I did add a little more size upwards on the cases where the ESP32, MmWave sensor and pir fit but you can cut out any of the ones you don’t want using tinkercatd or whatever program you use. Also, the cases for the ESP32 only are great for BT proxies with a regular 30 pin ESP32 like the one used in that article. I used the DORHEA 4PCS ESP32 ESP-32S. They fit perfectly but I don’t think a ESP32 with more pins would fit without some adjustments.

I did end.up adjusting the yaml for ESPHome for more controls based on the yaml for the EP1. Below is what I ended up with. I will say that those PIR’s do have some false positives so going add the yanl above to try and resolve that issue. Usually I get the false positives on the MmWave sensors regardless of which one is used… I actually ordered the same Panasonic PIR’s used in the EP1 so going to see how those work out but they are bigger so I’m going to have to adjust the case a bit more for it to fit. I need to remove the light part as I thought it would turn off the red led on the ESP32 but it actually turns on a different blue led which is off by default. I like having a switch for the blinking light on the dfrobot which was super annoying and didn’t want to but black paint or tape over it personally Since the EP1 uses a custom board with a temperature and light sensor it does actually turn a red light off on the EP1 board. I also like having the occupancy sensor that combines the pir and MmWave sensor so you can create automations on the pir, MmWave sensor, or the occupancy sensor which combines buth sensors to turn off or on.

substitutions:
  factory_reset_disabled: "true"
  uart_target_output_disabled: "true"
  uart_presence_output_disabled: "true"
  device_name: "dfrobot-pir"

esphome:
  name: dfrobot-pir
  friendly_name: dfrobot pir

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

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

ota:
  password: "hjhhhhhhhjhhhhhhh"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Dfrobot-Pir Fallback Hotspot"
    password: "122222211"

# MQTT client component
mqtt:
  broker: !secret mqtt_ip
  username: !secret mqtt_username
  password: !secret mqtt_password
  discovery: False # Only if you use the HA API usually
  id: mqtt_client

# fallback if WiFi fails
captive_portal:

light:
  - platform: status_led
    name: "ESP32 Status LED"
    pin: GPIO2

web_server:
  port: 80
  version: 2
  include_internal: true
  auth:
    username: hhhhh
    password: hhhhh

# Enable HTTP/HTTPS requests
http_request:
  # default ESPHome
  useragent: esphome/$device_name
  # request time out / default 5s
  timeout: 2s

# UART communication settings for mmWave sensor | Remember to set pins
uart:
  id: uart_bus
  # pin to send data from ESP
  tx_pin: GPIO25
  # pin to receive data to ESP
  rx_pin: GPIO33
  # baud rate for UART bus (required)
  baud_rate: 115200
  debug:
  # debug communication to both directions
    direction: BOTH
    # useful to debug all incoming communication
    dummy_receiver: true
    after:
      delimiter: "\n"
    sequence:
      - lambda: UARTDebug::log_string(direction, bytes);

switch:

  - platform: template
    name: "mmWave Sensor"
    id: "mmwave_sensor"
    entity_category: config
    optimistic: true
    restore_state: true
    turn_on_action:
      - uart.write: "sensorStart"
      - delay: 1s
    turn_off_action:
      - uart.write: "sensorStop"
      - delay: 1s    

  - platform: template
    name: "mmWave LED"
    id: "mmwave_led"
    entity_category: config
    optimistic: true
    restore_state: true
    turn_on_action:
      - switch.turn_off: mmwave_sensor
      - delay: 1s
      - uart.write: "setLedMode 1 0"
      - delay: 1s
      - uart.write: "saveConfig"
      - delay: 3s
      - switch.turn_on: mmwave_sensor
    turn_off_action:
      - switch.turn_off: mmwave_sensor
      - delay: 1s
      - uart.write: "setLedMode 1 1"
      - delay: 1s
      - uart.write: "saveConfig"
      - delay: 3s
      - switch.turn_on: mmwave_sensor

  - platform: template
    name: "uart_presence_output"
    id: "uart_presence_output"
    entity_category: config
    internal: ${uart_presence_output_disabled}
    optimistic: true
    restore_state: true
    turn_on_action:
      - switch.turn_off: mmwave_sensor
      - delay: 1s
      - uart.write: "setUartOutput 1 1"
      - delay: 1s
      - uart.write: "saveConfig"
      - delay: 3s
      - switch.turn_on: mmwave_sensor
    turn_off_action:
      - switch.turn_off: mmwave_sensor
      - delay: 1s
      - uart.write: "setUartOutput 1 0"
      - delay: 1s
      - uart.write: "saveConfig"
      - delay: 3s
      - switch.turn_on: mmwave_sensor

  - platform: template
    name: "uart_target_output"
    id: "uart_target_output"
    entity_category: config
    internal: ${uart_target_output_disabled}
    optimistic: true
    restore_state: true
    assumed_state: false
    turn_on_action:
      - switch.turn_off: mmwave_sensor
      - delay: 1s
      - uart.write: "setUartOutput 2 1 1 1"
      - delay: 1s
      - uart.write: "saveConfig"
      - delay: 3s
      - switch.turn_on: mmwave_sensor
    turn_off_action:
      - switch.turn_off: mmwave_sensor
      - delay: 1s
      - uart.write: "setUartOutput 2 0"
      - delay: 1s
      - uart.write: "saveConfig"
      - delay: 3s
      - switch.turn_on: mmwave_sensor      

binary_sensor:
  # mmWave Sensor | remember to set the pin
- platform: gpio
  name: dfrobot_mmwave
  id: mmwave
  device_class: occupancy  
  pin:
    number: GPIO27
    mode: INPUT_PULLDOWN
  # PIR Sensor | remember to set the pin
- platform: gpio
  name: dfrobot_pir
  id: pir_motion_sensor
  pin:
    number: GPIO18
    mode: INPUT_PULLDOWN
  # delay detection off by 3s
  filters:
    - delayed_off: 3s    
- platform: template
  name: occupancy
  id: occupancy
  device_class: occupancy    
  filters:
    - delayed_off: "10s"
  lambda: |-
    if ( id(mmwave).state or id(pir_motion_sensor).state) {
      return true;
    } 
    else if (id(mmwave).state == 0 and id(pir_motion_sensor).state == 0) {
      return false;
    } 
    else {
      return id(occupancy).state;
    }        


number:
  - platform: template
    name: mmWave Distance
    id: mmwave_distance
    entity_category: config
    min_value: 0
    max_value: 800
    initial_value: 315
    optimistic: true
    step: 15
    restore_value: true
    unit_of_measurement: cm
    mode: slider
    set_action:
      - switch.turn_off: mmwave_sensor
      - delay: 1s
      - uart.write: !lambda int cm = (int)ceil(x / 15.0);
          std::string cms = "detRangeCfg -1 0 " + to_string(cm);
          return std::vector<unsigned char>(cms.begin(), cms.end());
      - delay: 1s
      - uart.write: "saveCfg 0x45670123 0xCDEF89AB 0x956128C6 0xDF54AC89"
      - delay: 1s
      - switch.turn_on: mmwave_sensor

  - platform: template
    name: mmWave Off Latency
    id: mmwave_off_latency
    entity_category: config
    min_value: 1
    max_value: 60
    initial_value: 15
    optimistic: true
    step: 1
    restore_value: true
    unit_of_measurement: seconds
    mode: slider
    set_action:
      - switch.turn_off: mmwave_sensor
      - delay: 1s
      - uart.write: !lambda |-
          std::string mss = "setLatency " + to_string(id(mmwave_on_latency).state) + " " + to_string(id(mmwave_off_latency).state);
          return std::vector<unsigned char>(mss.begin(), mss.end());
      - delay: 1s
      - uart.write: "saveCfg 0x45670123 0xCDEF89AB 0x956128C6 0xDF54AC89"
      - delay: 1s
      - switch.turn_on: mmwave_sensor

  - platform: template
    name: mmWave On Latency
    id: mmwave_on_latency
    entity_category: config
    min_value: 0
    max_value: 60
    initial_value: 0
    optimistic: true
    step: 0.5
    restore_value: true
    unit_of_measurement: seconds
    mode: slider
    set_action:
      - switch.turn_off: mmwave_sensor
      - delay: 1s
      - uart.write: !lambda |-
          std::string mss = "setLatency " + to_string(id(mmwave_on_latency).state) + " " + to_string(id(mmwave_off_latency).state);
          return std::vector<unsigned char>(mss.begin(), mss.end());
      - delay: 1s
      - uart.write: "saveCfg 0x45670123 0xCDEF89AB 0x956128C6 0xDF54AC89"
      - delay: 1s
      - switch.turn_on: mmwave_sensor

  - platform: template
    name: mmWave Sensitivity
    id: mmwave_sensitivity
    entity_category: config
    min_value: 0
    max_value: 9
    initial_value: 7
    optimistic: true
    step: 1
    restore_value: true
    set_action:
      - switch.turn_off: mmwave_sensor
      - delay: 1s
      - uart.write:
          !lambda std::string mss = "setSensitivity " + to_string((int)x);
          return std::vector<unsigned char>(mss.begin(), mss.end());
      - delay: 1s
      - uart.write: "saveConfig"
      - delay: 1s
      - switch.turn_on: mmwave_sensor        

button:
# Restart the device
  - platform: restart
    name: restart_mmwave_final
# Switch for Safe Mode
  - platform: safe_mode
    internal: true
    name: use_safe_mode
  - platform: template
    name: "Restart mmWave Sensor"
    id: "restart_mmwave"
    entity_category: config
    internal: true
    on_press:
      - uart.write: "resetSystem"        

  - platform: template
    name: "Factory Reset mmWave"
    id: "factory_reset_mmwave"
    internal: ${factory_reset_disabled}
    entity_category: config
    on_press:
      - switch.turn_off: mmwave_sensor
      - delay: 1s
      - uart.write: "resetCfg"
      - delay: 3s
      - switch.turn_on: mmwave_sensor

This is down to the specific design of the D1 Mini board. If you have the version with the ESP8266 module soldered to the board, the HLK-LD2410B interface just lovely over the UART. If you have the version of board made with the Esperif chip and other discrete components, it will NOT work. Why? I have no idea.

Found this thread after I couldn’t get the device to show up:
image

Noted new firmware version, 2.0.4.23022511, in the “kit” version I’d bought.

Couldn’t figure out why my ESP32 (M5Stack Atom Lite) wasn’t finding it, despite having bluetooth_proxy enabled.

Turns out I had to:

  1. Change the ESP32 from framework type of “arduino” to esp-idf
  2. Remove the “captive_portal” entry
  3. Add the bluetooth_proxy entry AND set “active: true”

Immediately after restarting the ESP32, it showed up in Home Assistant integrations as a new device. Highly recommended because then it just needs to be “near enough” to the LD2410B / C, and it seems pretty simple to do that compared to my other options :grimacing:

Anyway hopefully that’s also helpful to anyone else who picks one of these nifty little devices up.

Now… Does anyone know how to disable those 2x LEDs?

I’ve got two of these that were upgraded to the ‘bad’ firmware that has disabled Bluetooth, so I can’t connect to them with my phone or with HA any more. I know from the Serial Communication manual that it’s possible to connect to these over serial and edit their settings that way, but honestly I’ve only been able to get gibberish out of Coolterm, it’s a little beyond the scope of my knowledge.

Is there anyone who can tell me how to fix these?