I'm having trouble getting the items based on UART working. The sensor itself is working, so the GPIO is working correctly. UART TX is also working; I'm able to turn the led on/off and adjusting the sensitivity seems to work as well. However, everything that relies on UART RX shows as unknown. Based on the logs, it seems to receiving exactly what it sends. My config and logs are below.
I'm using a Wemos D1 Mini32 with the DFRobot SEN0395 wired up with TX - IO22, RX - IO21, IO1 - IO17, IO2 - IO16, GND - GND, and V - VCC:
esphome:
name: living_room_mmwave_sensor
platform: ESP32
board: wemos_d1_mini32
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_pass
manual_ip:
static_ip: 192.168.5.45
gateway: 192.168.5.1
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Living Room mmWave Sensor"
password: !secret wifi_fallback_pass
captive_portal:
logger:
# Enable Home Assistant API
api:
password: !secret api_pass
encryption:
key: !secret api_key
ota:
password: !secret ota_pass
# Sensor Setup
substitutions:
device_name: leapmmw
# This will vary based on your board
uart_tx_pin: GPIO21
# This will vary based on your board
uart_rx_pin: GPIO22
# This will vary based on your board
gpio_pin: GPIO16
header_file: leapmmw_sensor.h
packages:
remote_package:
url: https://github.com/hjmcnew/esphome-hs2xx3a-custom-component
ref: release
# files: [packages/uart.yml, packages/leapmmw_sensor.yml]
# For additional debugging replace the above line with:
files: [packages/uart_debug.yml, packages/leapmmw_sensor.yml]
[15:39:17][C][wifi:491]: WiFi:
[15:39:17][C][wifi:353]: Local MAC: 94:B5:55:2C:76:4C
[15:39:17][C][wifi:354]: SSID: [redacted]
[15:39:17][C][wifi:355]: IP Address: 192.168.5.45
[15:39:17][C][wifi:357]: BSSID: [redacted]
[15:39:17][C][wifi:358]: Hostname: 'living_room_mmwave_sensor'
[15:39:17][C][wifi:360]: Signal strength: -62 dB ▂▄▆█
[15:39:17][C][wifi:364]: Channel: 1
[15:39:17][C][wifi:365]: Subnet: 255.255.255.0
[15:39:17][C][wifi:366]: Gateway: 192.168.5.1
[15:39:17][C][wifi:367]: DNS1: 0.0.0.0
[15:39:17][C][wifi:368]: DNS2: 0.0.0.0
[15:39:17][C][logger:275]: Logger:
[15:39:17][C][logger:276]: Level: DEBUG
[15:39:17][C][logger:277]: Log Baud Rate: 115200
[15:39:17][C][logger:278]: Hardware UART: UART0
[15:39:17][C][logger:280]: Level for 'sensor': INFO
[15:39:17][C][uart.arduino_esp32:107]: UART Bus:
[15:39:17][C][uart.arduino_esp32:108]: TX Pin: GPIO21
[15:39:17][C][uart.arduino_esp32:109]: RX Pin: GPIO22
[15:39:17][C][uart.arduino_esp32:111]: RX Buffer Size: 256
[15:39:17][C][uart.arduino_esp32:113]: Baud Rate: 115200 baud
[15:39:17][C][uart.arduino_esp32:114]: Data Bits: 8
[15:39:17][C][uart.arduino_esp32:115]: Parity: NONE
[15:39:17][C][uart.arduino_esp32:116]: Stop bits: 1
[15:39:17][C][template.sensor:023]: Template Sensor 'target_1_distance_m'
[15:39:17][C][template.sensor:023]: State Class: ''
[15:39:17][C][template.sensor:023]: Unit of Measurement: ''
[15:39:17][C][template.sensor:023]: Accuracy Decimals: 1
[15:39:17][C][template.sensor:024]: Update Interval: 60.0s
[15:39:17][C][template.sensor:023]: Template Sensor 'target_2_distance_m'
[15:39:17][C][template.sensor:023]: State Class: ''
[15:39:17][C][template.sensor:023]: Unit of Measurement: ''
[15:39:17][C][template.sensor:023]: Accuracy Decimals: 1
[15:39:17][C][template.sensor:024]: Update Interval: 60.0s
[15:39:18][C][template.sensor:023]: Template Sensor 'target_3_distance_m'
[15:39:18][C][template.sensor:023]: State Class: ''
[15:39:18][C][template.sensor:023]: Unit of Measurement: ''
[15:39:18][C][template.sensor:023]: Accuracy Decimals: 1
[15:39:18][C][template.sensor:024]: Update Interval: 60.0s
[15:39:18][C][template.sensor:023]: Template Sensor 'target_4_distance_m'
[15:39:18][C][template.sensor:023]: State Class: ''
[15:39:18][C][template.sensor:023]: Unit of Measurement: ''
[15:39:18][C][template.sensor:023]: Accuracy Decimals: 1
[15:39:18][C][template.sensor:024]: Update Interval: 60.0s
[15:39:18][C][template.sensor:023]: Template Sensor 'target_1_SNR'
[15:39:18][C][template.sensor:023]: State Class: ''
[15:39:18][C][template.sensor:023]: Unit of Measurement: ''
[15:39:18][C][template.sensor:023]: Accuracy Decimals: 1
[15:39:18][C][template.sensor:024]: Update Interval: 60.0s
[15:39:18][C][template.sensor:023]: Template Sensor 'target_2_SNR'
[15:39:18][C][template.sensor:023]: State Class: ''
[15:39:18][C][template.sensor:023]: Unit of Measurement: ''
[15:39:18][C][template.sensor:023]: Accuracy Decimals: 1
[15:39:18][C][template.sensor:024]: Update Interval: 60.0s
[15:39:18][C][template.sensor:023]: Template Sensor 'target_3_SNR'
[15:39:18][C][template.sensor:023]: State Class: ''
[15:39:18][C][template.sensor:023]: Unit of Measurement: ''
[15:39:18][C][template.sensor:023]: Accuracy Decimals: 1
[15:39:18][C][template.sensor:024]: Update Interval: 60.0s
[15:39:18][C][template.sensor:023]: Template Sensor 'target_4_SNR'
[15:39:18][C][template.sensor:023]: State Class: ''
[15:39:18][C][template.sensor:023]: Unit of Measurement: ''
[15:39:18][C][template.sensor:023]: Accuracy Decimals: 1
[15:39:18][C][template.sensor:024]: Update Interval: 60.0s
[15:39:18][C][template.sensor:023]: Template Sensor 'num_targets'
[15:39:18][C][template.sensor:023]: State Class: ''
[15:39:18][C][template.sensor:023]: Unit of Measurement: ''
[15:39:18][C][template.sensor:023]: Accuracy Decimals: 0
[15:39:18][C][template.sensor:024]: Update Interval: 60.0s
[15:39:18][C][template.switch:058]: Template Switch 'show_target_stats'
[15:39:18][C][template.switch:059]: Restore State: NO
[15:39:18][C][template.switch:060]: Optimistic: YES
[15:39:18][C][template.switch:058]: Template Switch 'mmwave_sensor'
[15:39:18][C][template.switch:059]: Restore State: NO
[15:39:18][C][template.switch:060]: Optimistic: YES
[15:39:18][C][template.switch:058]: Template Switch 'led'
[15:39:18][C][template.switch:059]: Restore State: NO
[15:39:18][C][template.switch:060]: Optimistic: YES
[15:39:18][C][template.number:050]: Template Number 'distance'
[15:39:18][C][template.number:050]: Unit of Measurement: 'M'
[15:39:18][C][template.number:051]: Optimistic: NO
[15:39:18][C][template.number:052]: Update Interval: 60.0s
[15:39:18][C][template.number:050]: Template Number 'latency'
[15:39:18][C][template.number:050]: Unit of Measurement: 's'
[15:39:18][C][template.number:051]: Optimistic: NO
[15:39:18][C][template.number:052]: Update Interval: 60.0s
[15:39:18][C][template.number:050]: Template Number 'sensitivity'
[15:39:18][C][template.number:051]: Optimistic: NO
[15:39:18][C][template.number:052]: Update Interval: 60.0s
[15:39:18][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'mmwave_presence_detection'
[15:39:18][C][gpio.binary_sensor:015]: Device Class: 'motion'
[15:39:18][C][gpio.binary_sensor:016]: Pin: GPIO16
[15:39:18][C][safe_mode_switch:026]: Safe Mode Switch 'use_safe_mode'
[15:39:18][C][safe_mode_switch:026]: Icon: 'mdi:restart-alert'
[15:39:18][C][restart.button:017]: Restart Button 'Restart_ESP_leapmmw'
[15:39:18][C][captive_portal:088]: Captive Portal:
[15:39:18][C][mdns:094]: mDNS:
[15:39:18][C][mdns:095]: Hostname: living_room_mmwave_sensor
[15:39:18][C][ota:085]: Over-The-Air Updates:
[15:39:18][C][ota:086]: Address: 192.168.5.45:3232
[15:39:18][C][ota:089]: Using Password.
[15:39:18][C][api:138]: API Server:
[15:39:18][C][api:139]: Address: 192.168.5.45:6053
[15:39:18][C][api:141]: Using noise encryption: YES
[15:39:25][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:39:44][D][uart_debug:158]: >>> "getSensitivity\r"
[15:39:44][D][uart_debug:158]: <<< "getSensitivity\r"
[15:39:47][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:39:50][D][uart_debug:158]: >>> "getLatency\r"
[15:39:50][D][uart_debug:158]: <<< "getLatency\r"
[15:40:00][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:40:04][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:40:04][D][uart_debug:158]: >>> "getRange\r"
[15:40:05][D][uart_debug:158]: <<< "getRange\r"
[15:40:10][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:40:11][D][api:102]: Accepted ::FFFF:C0A8:13F
[15:40:11][D][api.connection:861]: Home Assistant 2022.8.7 (::FFFF:C0A8:13F): Connected successfully
[15:40:12][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:40:20][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:40:25][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:40:33][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:40:35][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:40:41][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:40:44][D][uart_debug:158]: >>> "getSensitivity\r"
[15:40:44][D][uart_debug:158]: <<< "getSensitivity\r"
[15:40:48][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:40:50][D][uart_debug:158]: >>> "getLatency\r"
[15:40:50][D][uart_debug:158]: <<< "getLatency\r"
[15:41:04][D][uart_debug:158]: >>> "getRange\r"
[15:41:05][D][uart_debug:158]: <<< "getRange\r"
[15:41:05][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:41:27][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:41:33][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:41:44][D][uart_debug:158]: >>> "getSensitivity\r"
[15:41:44][D][uart_debug:158]: <<< "getSensitivity\r"
[15:41:44][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:41:50][D][uart_debug:158]: >>> "getLatency\r"
[15:41:50][D][uart_debug:158]: <<< "getLatency\r"
[15:41:54][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:41:57][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:42:03][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:42:04][D][uart_debug:158]: >>> "getRange\r"
[15:42:05][D][uart_debug:158]: <<< "getRange\r"
[15:42:05][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:42:11][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:42:19][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:42:25][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:42:35][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:42:44][D][uart_debug:158]: >>> "getSensitivity\r"
[15:42:44][D][uart_debug:158]: <<< "getSensitivity\r"
[15:42:45][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:42:50][D][uart_debug:158]: >>> "getLatency\r"
[15:42:50][D][uart_debug:158]: <<< "getLatency\r"
[15:42:58][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:43:04][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:43:05][D][uart_debug:158]: >>> "getRange\r"
[15:43:05][D][uart_debug:158]: <<< "getRange\r"
[15:43:28][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:43:39][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:43:44][D][uart_debug:158]: >>> "getSensitivity\r"
[15:43:44][D][uart_debug:158]: <<< "getSensitivity\r"
[15:43:50][D][uart_debug:158]: >>> "getLatency\r"
[15:43:50][D][uart_debug:158]: <<< "getLatency\r"
[15:43:50][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:44:04][D][uart_debug:158]: >>> "getRange\r"
[15:44:05][D][uart_debug:158]: <<< "getRange\r"
[15:44:13][I][ota:105]: Boot seems successful, resetting boot loop counter.
[15:44:13][D][esp32.preferences:113]: Saving 1 preferences to flash...
[15:44:13][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[15:44:44][D][uart_debug:158]: >>> "getSensitivity\r"
[15:44:44][D][uart_debug:158]: <<< "getSensitivity\r"
[15:44:50][D][uart_debug:158]: >>> "getLatency\r"
[15:44:50][D][uart_debug:158]: <<< "getLatency\r"
[15:45:05][D][uart_debug:158]: >>> "getRange\r"
[15:45:05][D][uart_debug:158]: <<< "getRange\r"
[15:45:15][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:45:23][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:45:34][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:45:40][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:45:44][D][uart_debug:158]: >>> "getSensitivity\r"
[15:45:44][D][uart_debug:158]: <<< "getSensitivity\r"
[15:45:50][D][uart_debug:158]: >>> "getLatency\r"
[15:45:50][D][uart_debug:158]: <<< "getLatency\r"
[15:46:04][D][uart_debug:158]: >>> "getRange\r"
[15:46:05][D][uart_debug:158]: <<< "getRange\r"
[15:46:44][D][uart_debug:158]: >>> "getSensitivity\r"
[15:46:44][D][uart_debug:158]: <<< "getSensitivity\r"
[15:46:50][D][uart_debug:158]: >>> "getLatency\r"
[15:46:50][D][uart_debug:158]: <<< "getLatency\r"
[15:47:04][D][uart_debug:158]: >>> "getRange\r"
[15:47:05][D][uart_debug:158]: <<< "getRange\r"
[15:47:44][D][uart_debug:158]: >>> "getSensitivity\r"
[15:47:44][D][uart_debug:158]: <<< "getSensitivity\r"
[15:47:50][D][uart_debug:158]: >>> "getLatency\r"
[15:47:50][D][uart_debug:158]: <<< "getLatency\r"