more esphome pmb 6 button switch updates

This commit is contained in:
root
2025-08-05 13:56:00 +12:00
parent ba4f7a19cc
commit 4c8df42b89

View File

@@ -22,7 +22,7 @@
# then hold down I00 button. I think GPIO12 connection is preventing the flash process.
# 2. OTA flash to an Existing Tasmota device is likely a bit hard with and ESP32 as they
# expect a signed Tasmota binary... and partition layout needs to be fixed anyway
# 3. EspHome warns on compiling: "legacy adc driver is deprecated, please migrate to use
# 3. ESPHome warns on compiling: "legacy adc driver is deprecated, please migrate to use
# esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode
# drivers respectively" [-Wcpp]" (I'm not bothered with this)
# 4. Normally I'd include SNTP for timing functions, and uptime diagnostics etc.
@@ -65,6 +65,10 @@ substitutions:
mqtt_password: !secret ha_mqtt_password
mqtt_topic: "esphome" # main topic for the mqtt server, call it what you like
# Web Server Settings
web_server_username: !secret web_server_username
web_server_password: !secret web_server_password
# Switch Naming
switch_1_name: "Red"
switch_2_name: "White"
@@ -81,8 +85,8 @@ substitutions:
# Device Settings
log_level: "INFO" # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
update_interval: "60s" # update time for for general sensors etc
pwm_freq: "1000Hz" # espHome default is 1000Hz, but will go much higher... (not much point for a switch LED)
ledc_bits: "12" # espHome default resolution is 12 bits
pwm_freq: "1000Hz" # ESPHome default is 1000Hz, but will go much higher... (not much point for a switch LED)
ledc_bits: "12" # ESPHome default resolution is 12 bits
# Network reconnect every x hours to ensure best access point
# This is my own script. No need to use if only one AP or it is always fixed.
@@ -105,7 +109,8 @@ substitutions:
ipv6_enable: "false"
##########################################################################################
# PACKAGES: Included Common Packages
# PACKAGES
# Included Common Packages from other files.
# https://esphome.io/components/packages.html
##########################################################################################
# NOTE: ALL COMMENTED AS FOR THIS TEST EVERYTHING IS IN ONE YAML FILE (except no SNTP)
@@ -136,7 +141,7 @@ substitutions:
# local_update_interval: "${update_interval}"
##########################################################################################
# Common Wifi Settings
# WIFI COMPONENT
# https://esphome.io/components/wifi.html
#
# Power Save mode (can reduce wifi reliability)
@@ -168,8 +173,8 @@ wifi:
#captive_portal: # extra fallback mechanism for when connecting if the configured WiFi fails
##########################################################################################
# Enable Over the Air Update Capability
# https://esphome.io/components/ota.html?highlight=ota
# ESPHome OTA UPDATES
# https://esphome.io/components/ota/esphome.html
##########################################################################################
ota:
- platform: esphome
@@ -177,14 +182,14 @@ ota:
version: 2
##########################################################################################
# Safe Mode
# SAFE MODE
# Safe mode will detect boot loops
# https://esphome.io/components/safe_mode
##########################################################################################
safe_mode:
##########################################################################################
# Network
# NETWORK COMPONENT
# global configuration for all types of networks
# https://esphome.io/components/network.html
##########################################################################################
@@ -225,7 +230,7 @@ script:
- script.execute: random_reconnect
##########################################################################################
# MQTT Monitoring
# MQTT CLIENT COMPONENT
# https://esphome.io/components/mqtt.html?highlight=mqtt
# MUST also have api enabled if you enable MQTT!
##########################################################################################
@@ -240,6 +245,19 @@ mqtt:
reboot_timeout: 0s # same for MQTT
##########################################################################################
# WEB SERVER COMPONENT
# https://esphome.io/components/web_server.html
# Web Portal for display and monitoring
# Turning this off is maybe a good idea to save resources, especially on an esp8266.
##########################################################################################
web_server:
port: 80
auth:
username: ${web_server_username} # probably a good idea to secure it
password: ${web_server_password}
##########################################################################################
# NATIVE API COMPONENT
# Enable the Home Assistant API
# https://esphome.io/components/api.html
##########################################################################################
@@ -249,17 +267,17 @@ api:
reboot_timeout: 0s # disables watchdog reboot on API failure
##########################################################################################
# ESPHome
# ESPHome CORE CONFIGURATION
# https://esphome.io/components/esphome.html
##########################################################################################
esphome:
name: ${device_name}
friendly_name: ${friendly_name}
comment: ${description_comment} # Appears on the esphome page in HA
comment: ${description_comment} # Appears on the ESPHome page in HA
area: ${device_area}
##########################################################################################
# ESP Platform and Framework
# ESP PLATFORM AND FRAMEWORK
# https://esphome.io/components/esp32.html
##########################################################################################
# Suggest using ESP-IDF Framework. Changes might need need to be cable flashed here to
@@ -312,8 +330,9 @@ globals:
initial_value: 'false'
##########################################################################################
# ESPHome Logging Enable
# LOGGER COMPONENT
# https://esphome.io/components/logger.html
# Logs all log messages through the serial port and through MQTT topics.
##########################################################################################
logger:
level: ${log_level} #INFO Level suggested, or DEBUG for testing
@@ -336,7 +355,7 @@ status_led:
##########################################################################################
# These are the input buttons on GPIO.
# No "mode: INPUT_PULLUP" needed as they have external pullups
# Switches pull to GND so "inverted:true" for espHome to report ON when pressed.
# Switches pull to GND so "inverted:true" for ESPHome to report ON when pressed.
# They will toggle the virtual relays when pressed (the vrelays will toggle the LEDs)
##########################################################################################
binary_sensor:
@@ -708,7 +727,7 @@ sensor:
device_class: ""
##########################################################################################
# Text Sensors
# TEXT SENSOR COMPONENT
# https://esphome.io/components/text_sensor/index.html
##########################################################################################
text_sensor:
@@ -739,14 +758,14 @@ text_sensor:
# BUTTON COMPONENT
# https://esphome.io/components/button/
##########################################################################################
# Diagnostic buttons ued here and non-active, activated if needed in HA
# Diagnostic buttons ued here and non-active by default, activated if needed in HA
##########################################################################################
button:
## DIAGNOSTIC ONLY BUTTONS BELOW ##
- platform: safe_mode
name: "Safe Mode Restart:"
entity_category: "diagnostic"
disabled_by_default: true
disabled_by_default: true # Need to activate them in HA
- platform: restart
name: "Restart:"
entity_category: "diagnostic"