multiple esphome device updates and new devices

This commit is contained in:
root
2025-07-25 13:14:37 +12:00
parent d9ca44a9ee
commit ac887724a2
39 changed files with 3041 additions and 418 deletions

View File

@@ -83,19 +83,26 @@ substitutions:
evening_off_default: "1350" # Default in minutes from midnight. Default 22:30 => 1350 => 1440 is midnight
##########################################################################################
# Included Common Packages
# https://esphome.io/components/esphome.html
# PACKAGES: Included Common Packages
# https://esphome.io/components/packages.html
##########################################################################################
packages:
common_wifi: !include
file: common/network_common.yaml
vars:
local_device_name: "${device_name}"
local_static_ip_address: "${static_ip_address}"
local_ota_pass: "${ota_pass}"
common_api: !include
file: common/api_common.yaml
vars:
local_api_key: "${api_key}"
#common_webportal: !include
# file: common/webportal_common.yaml
common_mqtt: !include
file: common/mqtt_common.yaml
vars:
local_device_name: "${device_name}"
common_sntp: !include
file: common/sntp_common.yaml
common_general_sensors: !include
@@ -104,12 +111,6 @@ packages:
local_friendly_name: "${friendly_name}"
local_update_interval: "${update_interval}"
# Web and MQTT Packages
#common_webportal: !include
# file: common/webportal_common.yaml
common_mqtt: !include
file: common/mqtt_common.yaml
# Device Specific included packages
common_athompowermonV3: !include
file: common/athompowermonv3_common.yaml
@@ -134,6 +135,9 @@ esphome:
board_build.mcu: esp32c3
board_build.variant: esp32c3
board_build.flash_mode: dio
on_boot:
then:
- script.execute: evaluate_relay_state
##########################################################################################
# ESP Platform and Framework
@@ -184,31 +188,31 @@ globals:
# Morning On time (minutes from midnight),
- id: morning_on
type: int
restore_value: False
restore_value: true
initial_value: "${morning_on_default}"
# Morning Off time (minutes from midnight),
- id: morning_off
type: int
restore_value: False
restore_value: true
initial_value: "${morning_off_default}"
# Evening On time (minutes from midnight),
- id: evening_on
type: int
restore_value: False
restore_value: true
initial_value: "${evening_on_default}"
# Evening Off time (minutes from midnight),
- id: evening_off
type: int
restore_value: False
restore_value: true
initial_value: "${evening_off_default}"
# Boost Duration (minutes),
- id: boost_duration
type: int
restore_value: False
restore_value: true
initial_value: "${boost_duration_default}"
####################################################
@@ -220,28 +224,26 @@ globals:
####################################################
- id: operation_mode
type: int
restore_value: false
restore_value: true
initial_value: "2"
####################################################
# current_mins is set if SNTP is invalid.
# We assume user powers on the device at 12:00 noon
# => 12 * 60 = 720 minutes from midnight.
# Not restored, so it resets each boot.
####################################################
- id: current_mins
type: int
restore_value: false
restore_value: true
initial_value: "720" # 720 is 12:00 Noon
####################################################
# boost_timer: counts minutes in BOOST mode
# After 'boost_duration' minutes, revert to TIMER.
# Not restored, so each boot starts fresh at 0.
####################################################
- id: boost_timer
type: int
restore_value: false
restore_value: true
initial_value: "0"
##########################################################################################
@@ -576,6 +578,23 @@ button:
id(operation_mode) = 3;
# 2) immediately re-evaluate relay state
- script.execute: evaluate_relay_state
- platform: template
name: "Default timer settings"
id: default_timer_settings_button
icon: "mdi:restore"
on_press:
- lambda: |-
// Restore all timing globals to their YAML defaults
id(morning_on) = ${morning_on_default};
id(morning_off) = ${morning_off_default};
id(evening_on) = ${evening_on_default};
id(evening_off) = ${evening_off_default};
id(boost_duration)= ${boost_duration_default};
// Reset mode to TIMER and clear any running boost
id(operation_mode)= 2;
id(boost_timer) = 0;
ESP_LOGI("timer","Default timer settings applied");
- script.execute: evaluate_relay_state
#################################################################################################
# SELECT COMPONENT