esphome mi 1s lamp

This commit is contained in:
root
2024-09-04 22:46:30 +12:00
parent 74d1c18615
commit 83549c6c1e
26 changed files with 2934 additions and 929 deletions

View File

@@ -1,4 +1,3 @@
#############################################
#############################################
# HiLink LD1125H mmWave sensor, with BME280 Temp/Hum/Pres Sensor on an ESP32
@@ -24,7 +23,7 @@
#############################################
substitutions:
devicename: "esp-occupancyoffice"
friendly_name: "Office State"
friendly_name: "Office Occupancy & Environment"
description_comment: "D1 Mini ESP32 with LD1125H mmWave and environment sensors for downstairs office"
#if NOT using a secrets file, just replace these with the passwords etc (in quotes)
@@ -54,7 +53,9 @@ substitutions:
#############################################
esphome:
name: ${devicename}
friendly_name: ${friendly_name}
comment: ${description_comment} #appears on the esphome page in HA
min_version: 2024.6.0
on_boot: #LD1125H Initial Setting, will remember previous values (if set)
priority: -200
then:
@@ -84,23 +85,12 @@ esphome:
# https://esphome.io/components/esp32.html
#############################################
esp32:
#board: nodemcu-32s
board: esp32dev
framework:
#type: arduino
type: esp-idf #Suggest using the ESP-IDF Framework. Changing from arduino to esp-idf needs a cabled download to change partitions
version: recommended #recommended, latest or dev
#############################################
# i2s bus
# https://esphome.io/components/i2c.html
#############################################
i2c:
sda: GPIO19
scl: GPIO21
scan: True
frequency: 100kHz #10, 50, 100, 200, 800 are possible settings, 100kHz was reliable for me
#############################################
# ESPHome external or custom components to use
# https://esphome.io/components/external_components.html
@@ -129,14 +119,26 @@ logger:
api:
encryption:
key: ${api_key}
on_client_connected:
- esp32_ble_tracker.start_scan:
continuous: true
on_client_disconnected:
- esp32_ble_tracker.stop_scan:
#############################################
# Enable Over the Air Update Capability
# https://esphome.io/components/ota.html?highlight=ota
#############################################
ota:
safe_mode: true #Safe mode will detect boot loops
password: ${ota_pass}
- platform: esphome
password: ${ota_pass}
#############################################
# Safe Mode
# Safe mode will detect boot loops
# https://esphome.io/components/safe_mode
#############################################
safe_mode:
#############################################
# Wifi Settings
@@ -155,10 +157,10 @@ wifi:
#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
ap: #Details for fallback hotspot in case wifi connection fails https://esphome.io/components/wifi.html#access-point-mode
ssid: ${devicename} fallback AP
password: ${fallback_ap_password}
ap_timeout: 5min #default is 1min
ap_timeout: 30min #Time until it brings up fallback AP. default is 1min
#############################################
# Web Portal for display and monitoring
@@ -182,20 +184,17 @@ mqtt:
username: ${mqtt_username}
password: ${mqtt_password}
#############################################
# Bluetooth
# https://esphome.io/components/bluetooth_proxy.html
# https://esphome.io/components/esp32_ble_tracker.html
# Remember that this takes a LOT of processing. On the
# ESP32, enable the IDF framework, and disable the
# Web server component. Changing to the IDF framework
# needs to be via cable not OTA to change the
# partition setup.
#############################################
#bluetooth_proxy:
# active: true
#esp32_ble_tracker:
#############################################
# i2c bus
# https://esphome.io/components/i2c.html
# 10, 50, 100, 200, 800 are possible settings
# for frequency, 50kHz is default
#############################################
i2c:
sda: GPIO19
scl: GPIO21
scan: True #look for devices on boot up and report
frequency: 50kHz
#############################################
# UART Serial
@@ -211,6 +210,24 @@ uart:
stop_bits: 1
parity: NONE
#############################################
# Bluetooth
# https://esphome.io/components/bluetooth_proxy.html
# https://esphome.io/components/esp32_ble_tracker.html
# Remember that this takes a LOT of processing. On the
# ESP32, enable the IDF framework, and disable the
# Web server component. Changing to the IDF framework
# needs to be via cable not OTA to change the
# partition setup.
#############################################
bluetooth_proxy:
active: true
cache_services: true
esp32_ble_tracker:
scan_parameters:
continuous: false
#############################################
# Global Variables for use in automations etc
# https://esphome.io/guides/automations.html?highlight=globals#global-variables
@@ -374,8 +391,10 @@ sensor:
oversampling: 2x
address: 0x76
update_interval: ${update_time}
- platform: uptime
name: ${friendly_name} Uptime
- platform: template
name: ${friendly_name} LD1125H Distance
id: LD1125H_Distance