yaml layout updates to v1.x
This commit is contained in:
@@ -1,55 +1,83 @@
|
||||
##########################################################################################
|
||||
##########################################################################################
|
||||
# DOWNSTAIRS DISHWASHER POWER MONITOR
|
||||
#
|
||||
# Controlled by a Athom Smart Plug V1
|
||||
# package_import_url: github://athom-tech/athom-configs/athom-smart-plug.yaml
|
||||
#
|
||||
#:########################################################################################:#
|
||||
# TITLE: DOWNSTAIRS DISHWASHER POWER MONITOR
|
||||
# zorruno.com layout v1.1 2026
|
||||
#:########################################################################################:#
|
||||
# REPO:
|
||||
# https://home.fox.co.nz/gitea/zorruno/zorruno-homeassistant/src/branch/master/esphome/esp-downstdishwasher.yaml
|
||||
#:########################################################################################:#
|
||||
# VERSIONS:
|
||||
# V1.4 2026-02-25 Updated yaml to zorruno layout V1.1
|
||||
# V1.3 2025-08-27 Changed to Athom V2
|
||||
# V1.2 2025-06-15 Changed to Athom V1
|
||||
# V1.1 2025-06-12 Tidyups and packages added
|
||||
#
|
||||
##########################################################################################
|
||||
##########################################################################################
|
||||
#:########################################################################################:#
|
||||
# HARDWARE:
|
||||
# Athom Smart Plug V2 (ESP8285) with power monitoring
|
||||
# - Power monitoring handled by: common/athompowermonv2_common.yaml
|
||||
#:########################################################################################:#
|
||||
# OPERATION NOTES:
|
||||
# - Power monitoring smart plug for the downstairs dishwasher.
|
||||
# - Uses common WiFi, API, MQTT, SNTP, and diagnostics packages.
|
||||
# - "Power On State" select controls restore behavior using the restore_mode global:
|
||||
# - Always Off
|
||||
# - Always On
|
||||
# - Restore Previous State
|
||||
#:########################################################################################:#
|
||||
# OFFLINE NOTES:
|
||||
# a) Home Assistant OFFLINE, but Network and MQTT ONLINE
|
||||
# - Device continues measuring power locally.
|
||||
# - MQTT topics (if used elsewhere) and network remain available; HA entities will be unavailable until HA returns.
|
||||
# b) MQTT OFFLINE (but WiFi/Network and HA API ONLINE)
|
||||
# - Device remains controllable/visible from Home Assistant via API.
|
||||
# - MQTT functionality from common_mqtt (publishes/subscribes) will not work while MQTT is down.
|
||||
# c) Entire WiFi/Network OFFLINE
|
||||
# - No HA API and no MQTT control available.
|
||||
# - Device continues operating locally using last stored settings.
|
||||
# - Accurate time is NOT needed (SNTP not needed) for core plug operation.
|
||||
#:########################################################################################:#
|
||||
|
||||
##########################################################################################
|
||||
# SPECIFIC DEVICE VARIABLE SUBSTITUTIONS
|
||||
|
||||
#:########################################################################################:#
|
||||
# SUBSTITUTIONS: Specific device variable substitutions
|
||||
# If NOT using a secrets file, just replace these with the passwords etc (in quotes)
|
||||
##########################################################################################
|
||||
#:########################################################################################:#
|
||||
substitutions:
|
||||
# Device Naming
|
||||
device_name: "esp-downstdishwasher"
|
||||
friendly_name: "Downstairs Dishwasher Power"
|
||||
description_comment: "Downstairs Dishwasher Power :: Athom Smart Plug Power V2"
|
||||
device_area: "Downstairs Flat" # Allows ESP device to be automatically linked to an 'Area' in Home Assistant.
|
||||
|
||||
description_comment: "Downstairs Dishwasher Power :: Athom Smart Plug Power V2 (Layout V1.1)"
|
||||
device_area: "Downstairs Flat" # Allows ESP device to be automatically linked to an 'Area' in Home Assistant.
|
||||
|
||||
# Project Naming
|
||||
project_name: "Athom Technology.Smart Plug V2" # Project Details
|
||||
project_version: "v1.3" # Project V denotes release of yaml file, allowing checking of deployed vs latest version
|
||||
project_name: "Athom Technology.Smart Plug V2"
|
||||
project_version: "v1.4"
|
||||
|
||||
# Passwords (unfortunately you can't use substitutions inside secrets names)
|
||||
api_key: !secret esp-api_key
|
||||
ota_pass: !secret esp-ota_pass
|
||||
ota_pass: !secret esp-ota_pass
|
||||
static_ip_address: !secret esp-downstdishwasher_ip
|
||||
|
||||
# If we are changing IP addresses, you must update the current IP address here, otherwise it remains
|
||||
# Don't forget to switch it back when changed.
|
||||
current_ip_address: ${static_ip_address}
|
||||
|
||||
# Device General Settings
|
||||
log_level: "NONE" # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
|
||||
update_interval: "60s" # update time for for general sensors etc
|
||||
log_level: "NONE" # NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
|
||||
update_interval: "60s" # update time for general sensors etc
|
||||
|
||||
# Device Specific Settings
|
||||
# Athom Power Monitor Plug V2
|
||||
relay_icon: "mdi:power-socket-au"
|
||||
current_limit: "10" # Current Limit in Amps. AU Plug = 10. IL, BR, EU, UK, US Plug = 16.
|
||||
relay_icon: "mdi:power-socket-au"
|
||||
current_limit: "10" # Current Limit in Amps. AU Plug = 10. IL, BR, EU, UK, US Plug = 16.
|
||||
sensor_update_interval: "10s"
|
||||
relay_restore_mode: RESTORE_DEFAULT_ON
|
||||
hide_energy_sensor: "true"
|
||||
|
||||
##########################################################################################
|
||||
|
||||
#:########################################################################################:#
|
||||
# PACKAGES: Included Common Packages
|
||||
# https://esphome.io/components/packages.html
|
||||
##########################################################################################
|
||||
# Comment some of these out where not needed, eg MQTT, Web portal, SNTP, General Sensors
|
||||
##########################################################################################
|
||||
#:########################################################################################:#
|
||||
packages:
|
||||
#### WIFI, Network (Static/DHCP/IPV6 etc), Fallback AP, Safemode ####
|
||||
common_wifi: !include
|
||||
@@ -58,6 +86,7 @@ packages:
|
||||
local_device_name: "${device_name}"
|
||||
local_static_ip_address: "${static_ip_address}"
|
||||
local_ota_pass: "${ota_pass}"
|
||||
local_current_ip_address: "${current_ip_address}"
|
||||
|
||||
#### HOME ASSISTANT API (choose encryption or no encryption options) ####
|
||||
common_api: !include
|
||||
@@ -71,18 +100,18 @@ packages:
|
||||
file: common/mqtt_common.yaml
|
||||
vars:
|
||||
local_device_name: "${device_name}"
|
||||
|
||||
|
||||
#### WEB PORTAL ####
|
||||
#common_webportal: !include common/webportal_common.yaml
|
||||
|
||||
|
||||
#### SNTP (Only use if you want/need accurate timeclocks) ####
|
||||
common_sntp: !include common/sntp_common.yaml
|
||||
common_sntp: !include common/sntp_common.yaml
|
||||
|
||||
#### DIAGNOSTICS Sensors ####
|
||||
diag_basic: !include common/include_basic_diag_sensors.yaml
|
||||
diag_more: !include common/include_more_diag_sensors.yaml
|
||||
diag_debug: !include common/include_debug_diag_sensors.yaml
|
||||
#diag_resetcount: !include common/include_resetcount_diag_sensors.yaml
|
||||
diag_basic: !include common/include_basic_diag_sensors.yaml
|
||||
diag_more: !include common/include_more_diag_sensors.yaml
|
||||
diag_debug: !include common/include_debug_diag_sensors.yaml
|
||||
#diag_resetcount: !include common/include_resetcount_diag_sensors.yaml
|
||||
|
||||
# Device Specific included packages
|
||||
# Athom Power Monitor Plug
|
||||
@@ -96,15 +125,16 @@ packages:
|
||||
power_plug_type: "${relay_icon}"
|
||||
hide_energy_sensor: "${hide_energy_sensor}"
|
||||
|
||||
##########################################################################################
|
||||
# ESPHome
|
||||
|
||||
#:########################################################################################:#
|
||||
# ESPHOME:
|
||||
# https://esphome.io/components/esphome.html
|
||||
##########################################################################################
|
||||
#:########################################################################################:#
|
||||
esphome:
|
||||
name: "${device_name}"
|
||||
friendly_name: "${friendly_name}"
|
||||
comment: "${description_comment}" #Appears on the esphome page in HA
|
||||
area: "${device_area}"
|
||||
comment: "${description_comment}" # Appears on the esphome page in HA
|
||||
area: "${device_area}"
|
||||
name_add_mac_suffix: false
|
||||
min_version: 2024.6.0
|
||||
project:
|
||||
@@ -116,27 +146,27 @@ esphome:
|
||||
- select.set_index:
|
||||
id: power_mode
|
||||
index: !lambda |-
|
||||
return id(restore_mode)-1;
|
||||
return id(restore_mode) - 1;
|
||||
- lambda: |-
|
||||
switch(id(restore_mode))
|
||||
{
|
||||
case 1:{
|
||||
id(relay).turn_off();
|
||||
break;
|
||||
}
|
||||
case 2:{
|
||||
id(relay).turn_on();
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
break;
|
||||
}
|
||||
switch (id(restore_mode)) {
|
||||
case 1: {
|
||||
id(relay).turn_off();
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
id(relay).turn_on();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
##########################################################################################
|
||||
# ESP Platform and Framework
|
||||
# https://esphome.io/components/esp32.html
|
||||
##########################################################################################
|
||||
|
||||
#:########################################################################################:#
|
||||
# ESP PLATFORM AND FRAMEWORK:
|
||||
# https://esphome.io/components/esp8266.html
|
||||
#:########################################################################################:#
|
||||
esp8266:
|
||||
board: esp8285
|
||||
restore_from_flash: true # mainly for calculating cumulative energy, but not that important here
|
||||
@@ -148,18 +178,20 @@ preferences:
|
||||
mdns:
|
||||
disabled: false
|
||||
|
||||
##########################################################################################
|
||||
# ESPHome LOGGING
|
||||
# https://esphome.io/components/logger.html
|
||||
##########################################################################################
|
||||
logger:
|
||||
level: "${log_level}"
|
||||
baud_rate: 0 #set to 0 for no logging via UART, needed if you are using it for other serial things (eg PZEM)
|
||||
|
||||
##########################################################################################
|
||||
# GLOBAL VARIABLES
|
||||
# https://esphome.io/guides/automations.html?highlight=globals#global-variables
|
||||
##########################################################################################
|
||||
#:########################################################################################:#
|
||||
# LOGGING: ESPHome Logging Enable
|
||||
# https://esphome.io/components/logger.html
|
||||
#:########################################################################################:#
|
||||
logger:
|
||||
level: "${log_level}"
|
||||
baud_rate: 0 # set to 0 for no logging via UART, needed if you are using it for other serial things (eg power monitor UART)
|
||||
|
||||
|
||||
#:########################################################################################:#
|
||||
# GLOBAL VARIABLES:
|
||||
# https://esphome.io/guides/automations.html#global-variables
|
||||
#:########################################################################################:#
|
||||
globals:
|
||||
# 0 = Always_Off. 1 = Restore_Power_Off. 2 = Always_On.
|
||||
- id: restore_mode
|
||||
@@ -167,14 +199,15 @@ globals:
|
||||
restore_value: yes
|
||||
initial_value: "2"
|
||||
|
||||
##########################################################################################
|
||||
# SELECT COMPONENT
|
||||
|
||||
#:########################################################################################:#
|
||||
# SELECT COMPONENT:
|
||||
# https://esphome.io/components/select/index.html
|
||||
##########################################################################################
|
||||
#:########################################################################################:#
|
||||
select:
|
||||
- platform: template
|
||||
name: "Power On State"
|
||||
id: "power_mode"
|
||||
id: power_mode
|
||||
optimistic: true
|
||||
icon: mdi:electric-switch
|
||||
options:
|
||||
@@ -184,4 +217,4 @@ select:
|
||||
on_value:
|
||||
then:
|
||||
- lambda: |-
|
||||
id(restore_mode)=i+1;
|
||||
id(restore_mode) = i + 1;
|
||||
Reference in New Issue
Block a user