various esphome yaml tidyups

This commit is contained in:
root
2024-06-06 11:08:40 +12:00
parent 29c092232b
commit 8851f8da5e
5 changed files with 493 additions and 387 deletions

View File

@@ -1,17 +1,20 @@
#############################################
#############################################
# HiLink LD2410 mmWave sensor, with BME280 Temp/Hum/Pres Sensor on an ESP32
# HiLink LD2410 mmWave sensor, with BME280 Temp/Hum/Pres Sensor and PIR on an ESP32
# https://github.com/patrick3399/Hi-Link_mmWave_Radar_ESPHome/tree/main
# https://github.com/patrick3399/Hi-Link_mmWave_Radar_ESPHome/blob/main/LD1125H/ESP32-LD1125H-Complete.yaml
#
# https://esphome.io/components/sensor/ld2410.html
# https://www.simplysmart.house/blog/presence-detection-ld2410-home-assistant
#
# The B and c versions of this device can use Bluetooth, but we are not using it here.
#############################################
#############################################
#############################################
# Variable Substitutions
# VARIABLE SUBSTITUTIONS
# Give the device a useful name & description here
# and change values accordingly.
#############################################
substitutions:
devicename: "esp-occupancystair"
@@ -19,8 +22,23 @@ substitutions:
description_comment: "D1 Mini ESP32 with LD2410 mmWave for internal stairwell and environment sensors for under house"
api_key: !secret esp-occupancystair_api_key #unfortunately you can't use substitutions in secrets names
ota_pass: !secret esp-occupancystair_ota_pass #unfortunately you can't use substitutions in secrets names
wifi_ssid: !secret wifi_ssid
wifi_password: !secret wifi_password
fallback_ap_password: !secret fallback_ap_password
#Add these if we are giving it a static ip, or remove them in the Wifi section
#static_ip_address: !secret esp-occupancystair_static_ip
#static_ip_gateway: !secret esp-occupancystair_gateway
#static_ip_subnet: !secret esp-occupancystair_subnet
mqtt_server: !secret mqtt_server
mqtt_username: !secret mqtt_username
mqtt_password: !secret mqtt_password
mqtt_topic: "esphome" #main topic for the mqtt server, call it what you like
update_time: 30s #update time for for temp sensors etc
#web_server_username: !secret web_server_username
#web_server_password: !secret web_server_password
update_time: 30s #update time for for general temp sensors etc
#############################################
# ESPHome
@@ -33,7 +51,6 @@ esphome:
#priority: -200
#then:
#############################################
# ESP Platform and Framework
# https://esphome.io/components/esp32.html
@@ -52,7 +69,7 @@ esp32:
i2c:
sda: GPIO19
scl: GPIO21
scan: True
scan: True
frequency: 100kHz #10, 50, 100, 200, 800 are possible settings, 100kHz was reliable for me
#############################################
@@ -86,16 +103,16 @@ ota:
# https://esphome.io/components/wifi.html
#############################################
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ssid: ${wifi_ssid}
password: ${wifi_password}
#power_save_mode: LIGHT #https://esphome.io/components/wifi.html#wifi-power-save-mode
#manual_ip: #optional static IP address
#static_ip: 192.168.x.x
#gateway: 192.168.X.x
#subnet: 255.255.255.0
#static_ip: ${static_ip_address}
#gateway: ${static_ip_gateway}
#subnet: ${static_ip_subnet}
ap: #Details for fallback hotspot (captive portal) in case wifi connection fails https://esphome.io/components/wifi.html#access-point-mode
ssid: $devicename fallback AP
password: !secret fallback_ap_password
ssid: ${devicename} fallback AP
password: ${fallback_ap_password}
ap_timeout: 5min #default is 1min
#############################################
@@ -105,8 +122,9 @@ wifi:
#############################################
web_server:
port: 80
# username: !secret web_server_username #probably a good idea to secure it
# password: !secret web_server_password
# auth:
# username: ${web_server_username} #probably a good idea to secure it
# password: ${web_server_password}
#############################################
# MQTT Monitoring
@@ -114,10 +132,10 @@ web_server:
# MUST also have api enabled if you enable MQTT
#############################################
mqtt:
broker: !secret mqtt_server
broker: ${mqtt_server}
topic_prefix: ${mqtt_topic}/${devicename}
username: !secret mqtt_username
password: !secret mqtt_password
username: ${mqtt_username}
password: ${mqtt_password}
#############################################
# Bluetooth
@@ -142,19 +160,10 @@ uart:
id: ld2410_uart
rx_pin: GPIO16 #For ESP32, you can use any pin, Recommend Use UART_2, Don't use UART_0, It might Cause Boot Fail or System Hang
tx_pin: GPIO17 #For ESP32, you can use any pin, Recommend Use UART_2, Don't use UART_0, It might Cause Boot Fail or System Hang
# rx_pin: GPIO1 #For ESP32, you can use any pin, Recommend Use UART_2, Don't use UART_0, It might Cause Boot Fail or System Hang
# tx_pin: GPIO0 #For ESP32, you can use any pin, Recommend Use UART_2, Don't use UART_0, It might Cause Boot Fail or System Hang
baud_rate: 256000 # default for LD2410 is 25600, 8, 0, NONE
data_bits: 8
stop_bits: 1
parity: NONE
# debug:
# direction: BOTH
# dummy_receiver: false
# after:
# delimiter: "\n"
# sequence:
# - lambda: UARTDebug::log_string(direction, bytes);
#############################################
# General esp status LED
@@ -166,7 +175,6 @@ status_led:
ignore_strapping_warning: True #https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
inverted: false
#############################################
# LD2410 Sensors
# https://esphome.io/components/sensor/ld2410.html
@@ -366,12 +374,13 @@ sensor:
name: g8 still energy
# The ld2410 switch allows you to control your LD2410 Sensor.
#Bluetooth switch is only useful of you have a B or C model
switch:
- platform: ld2410
engineering_mode:
name: ${friendly_name} LD2140 Engineering Mode
bluetooth:
name: ${friendly_name} LD2140 Control Bluetooth
#bluetooth:
#name: ${friendly_name} LD2140 Control Bluetooth
#The ld2410 binary sensors to get presence notification
binary_sensor:
@@ -407,11 +416,12 @@ button:
name: Query Parameters
#The ld2410 text sensor allows you to get information about your LD2410 Sensor.
#Bluetooth sensor is only useful of you have a B or C model
text_sensor:
- platform: ld2410
version:
name: ${friendly_name} LD2140 Firmware Version
mac_address:
name: ${friendly_name} LD2140 BT MAC Address
#mac_address:
#name: ${friendly_name} LD2140 BT MAC Address