158 lines
3.3 KiB
YAML
158 lines
3.3 KiB
YAML
substitutions:
|
|
device_name: presence_sensor # Change the device name here
|
|
friendly_name: "Presense Sensor"
|
|
|
|
esphome:
|
|
name: ${device_name}
|
|
comment: "HMMD mmWave Sensor S3KM1110 - ${friendly_name}"
|
|
on_boot:
|
|
priority: 550.0
|
|
then:
|
|
- light.turn_on:
|
|
id: led
|
|
brightness: 100%
|
|
red: 100%
|
|
green: 0%
|
|
blue: 0%
|
|
|
|
esp32:
|
|
board: esp32-s3-devkitc-1
|
|
framework:
|
|
type: arduino
|
|
|
|
# Enable logging
|
|
logger:
|
|
hardware_uart: USB_CDC
|
|
|
|
# Optional: Enable Home Assistant API (uncomment to use)
|
|
# api:
|
|
# encryption:
|
|
# key: !secret api_encryption_key
|
|
|
|
mqtt:
|
|
broker: !secret mqtt_broker
|
|
port: !secret mqtt_port
|
|
username: !secret mqtt_username
|
|
password: !secret mqtt_password
|
|
reboot_timeout: 0s
|
|
discovery: true
|
|
birth_message:
|
|
topic: "${device_name}/status"
|
|
payload: "online"
|
|
will_message:
|
|
topic: "${device_name}/status"
|
|
payload: "offline"
|
|
on_connect:
|
|
then:
|
|
- light.turn_on:
|
|
id: led
|
|
brightness: 100%
|
|
red: 0%
|
|
green: 100%
|
|
blue: 0%
|
|
- delay: 3s
|
|
- light.turn_off:
|
|
id: led
|
|
|
|
ota:
|
|
- platform: esphome
|
|
password: !secret ota_password
|
|
|
|
wifi:
|
|
ssid: !secret wifi_ssid
|
|
password: !secret wifi_password
|
|
power_save_mode: none
|
|
|
|
manual_ip:
|
|
static_ip: !secret device_ip
|
|
gateway: !secret gateway_ip
|
|
subnet: !secret subnet
|
|
|
|
on_connect:
|
|
- light.turn_on:
|
|
id: led
|
|
brightness: 100%
|
|
red: 100%
|
|
green: 65%
|
|
blue: 0%
|
|
|
|
ap:
|
|
ssid: "${friendly_name}"
|
|
password: !secret ap_password
|
|
|
|
captive_portal:
|
|
|
|
light:
|
|
- platform: esp32_rmt_led_strip
|
|
rgb_order: RGB
|
|
pin: GPIO21
|
|
num_leds: 1
|
|
chipset: ws2812
|
|
id: led
|
|
rmt_channel: 0
|
|
|
|
# UART configuration
|
|
uart:
|
|
id: ld2420_uart
|
|
tx_pin: GPIO7
|
|
rx_pin: GPIO6
|
|
baud_rate: 115200
|
|
parity: NONE
|
|
stop_bits: 1
|
|
|
|
# LD2420 sensor configuration
|
|
ld2420:
|
|
|
|
text_sensor:
|
|
- platform: ld2420
|
|
fw_version:
|
|
name: "LD2420 Firmware"
|
|
- platform: wifi_info
|
|
ip_address:
|
|
name: "${friendly_name} IP Address"
|
|
|
|
sensor:
|
|
- platform: ld2420
|
|
moving_distance:
|
|
name: "${friendly_name} Motion Distance"
|
|
|
|
binary_sensor:
|
|
- platform: ld2420
|
|
has_target:
|
|
name: "${friendly_name} Presence"
|
|
id: has_target
|
|
|
|
select:
|
|
- platform: ld2420
|
|
operating_mode:
|
|
name: "${friendly_name} Operating Mode"
|
|
|
|
number:
|
|
- platform: ld2420
|
|
presence_timeout:
|
|
name: "${friendly_name} Presence Timeout (s)"
|
|
min_gate_distance:
|
|
name: "${friendly_name} Minimum Distance (Gate)"
|
|
max_gate_distance:
|
|
name: "${friendly_name} Maximum Distance (Gate)"
|
|
gate_select:
|
|
name: "${friendly_name} Gate Selection (Gate Number)"
|
|
still_threshold:
|
|
name: "${friendly_name} Still Threshold (Sensitivity)"
|
|
move_threshold:
|
|
name: "${friendly_name} Motion Threshold (Sensitivity)"
|
|
gate_move_sensitivity:
|
|
name: "${friendly_name} Motion Sensitivity (Factor)"
|
|
gate_still_sensitivity:
|
|
name: "${friendly_name} Still Sensitivity (Factor)"
|
|
|
|
button:
|
|
- platform: ld2420
|
|
apply_config:
|
|
name: "${friendly_name} Apply Config"
|
|
factory_reset:
|
|
name: "${friendly_name} Factory Reset"
|
|
restart_module:
|
|
name: "${friendly_name} Sensor Restart"
|
|
revert_config:
|
|
name: "${friendly_name} Revert Changes"
|