yaml layout updates to v1.x

This commit is contained in:
root
2026-02-25 21:05:21 +13:00
parent 61b0c64a1e
commit a8d2927274
44 changed files with 6521 additions and 4689 deletions
+81 -50
View File
@@ -1,23 +1,40 @@
##########################################################################################
##########################################################################################
#:########################################################################################:#
# TITLE: ARCADE CABINET 1 POWER (ATHOM SMART PLUG V1)
# zorruno.com layout v1.0 2026
#:########################################################################################:#
# VERSIONS:
# V1.0 Unknown date - Initial Version (date not present in source header)
#:########################################################################################:#
# HARDWARE:
# - Athom Smart Plug Power V1 (ESP8285 / ESP8266 family)
# - Load: MAME Arcade Cabinet 1 (Defender)
#:########################################################################################:#
# OPERATION NOTES:
# - Controls arcade cabinet mains power via Athom Smart Plug relay
# - Provides power monitoring via included Athom PowerMon V1 common package
# - Local power button toggles relay state
#:########################################################################################:#
# MQTT COMMANDS:
#
##########################################################################################
##########################################################################################
#:########################################################################################:#
# OFFLINE NOTES:
#
#:########################################################################################:#
##########################################################################################
# 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-arcademachine1"
friendly_name: "Arcade Cabinet 1"
description_comment: "MAME Arcade 1 (Defender) machine power :: Athom Smart Plug Power V1"
device_area: "Downstairs Flat" # Allows ESP device to be automatically linked to an 'Area' in Home Assistant.
description_comment: "MAME Arcade 1 (Defender) machine power :: Athom Smart Plug Power V1 (Layout V1.0)"
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 V1" # Project Details
project_name: "Athom Technology.Smart Plug V1" # Project Details
project_version: "v1.0" # Project V denotes release of yaml file, allowing checking of deployed vs latest version
# Passwords
@@ -34,13 +51,14 @@ substitutions:
update_interval: "10s" # update time for for general sensors etc
# Device Settings
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.
#:########################################################################################:#
# PACKAGES: Included Common Packages
# https://esphome.io/components/packages.html
##########################################################################################
#:########################################################################################:#
packages:
##################################################
# MANDATORY packages (won't compile without them!)
@@ -57,7 +75,7 @@ packages:
##################################################
# OPTIONAL packages (comment if you don't want them)
##################################################
##################################################
#### HOME ASSISTANT API (choose encryption or no encryption options) ####
common_api: !include
@@ -65,7 +83,7 @@ packages:
#file: common/api_common_noencryption.yaml
vars:
local_api_key: "${api_key}"
#### WEB PORTAL ####
common_webportal: !include
file: common/webportal_common.yaml
@@ -75,7 +93,7 @@ packages:
file: common/mqtt_common.yaml
vars:
local_device_name: "${device_name}"
#### SNTP (Only use if you want/need accurate timeclocks) ####
common_sntp: !include
file: common/sntp_common.yaml
@@ -100,56 +118,69 @@ packages:
local_friendly_name: "${friendly_name}"
local_current_limit: "${current_limit}"
##########################################################################################
# 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}"
name_add_mac_suffix: False
comment: "${description_comment}" # Appears on the esphome page in HA
area: "${device_area}"
name_add_mac_suffix: false
min_version: 2024.6.0
project:
name: "${project_name}"
version: "${project_version}"
##########################################################################################
# ESP Platform and Framework
# https://esphome.io/components/esp32.html
##########################################################################################
#:########################################################################################:#
# ESP PLATFORM AND FRAMEWORK:
# https://esphome.io/components/esp8266/
#:########################################################################################:#
esp8266:
board: esp8285
restore_from_flash: true # mainly for calculating cumulative energy, but not that important here
#framework:
# version: 2.7.4
#:########################################################################################:#
# PREFERENCES:
# https://esphome.io/components/preferences.html
#:########################################################################################:#
preferences:
flash_write_interval: 10min
mdns:
disabled: False # binary size saving
##########################################################################################
# ESPHome Logging Enable
#:########################################################################################:#
# MDNS:
# https://esphome.io/components/mdns.html
#:########################################################################################:#
mdns:
disabled: false # binary size saving
#:########################################################################################:#
# LOGGING: ESPHome Logging Enable
# https://esphome.io/components/logger.html
##########################################################################################
#:########################################################################################:#
logger:
level: "${log_level}" #INFO Level suggested, or DEBUG for testing
baud_rate: 0 #set to 0 for no logging via UART, needed if you are using it for other serial things (eg PZEM)
level: "${log_level}" # INFO Level suggested, or DEBUG for testing
baud_rate: 0 # set to 0 for no logging via UART, needed if you are using it for other serial things (eg PZEM)
#esp8266_store_log_strings_in_flash: false
#tx_buffer_size: 64
##########################################################################################
# BINARY SENSORS
#:########################################################################################:#
# BINARY SENSORS:
# https://esphome.io/components/binary_sensor/
##########################################################################################
#:########################################################################################:#
binary_sensor:
- platform: gpio
pin:
number: GPIO03
number: GPIO3
mode: INPUT_PULLUP
inverted: true
name: "Power Button"
@@ -162,28 +193,28 @@ binary_sensor:
then:
- lambda: |-
if (id(relay).state) {
// Relay is ON: turn it OFF and set mode to 2 (TIMER)
// Relay is ON: turn it OFF
id(relay).turn_off();
} else {
// Relay is OFF: turn it ON and set mode to 3 (BOOST)
// Relay is OFF: turn it ON
id(relay).turn_on();
}
- platform: template
name: "Relay Status"
lambda: |-
return id(relay).state;
#################################################################################################
# SWITCH COMPONENT
#:########################################################################################:#
# SWITCH COMPONENT:
# https://esphome.io/components/switch/
#################################################################################################
#:########################################################################################:#
switch:
- platform: gpio
name: "Power Output"
pin: GPIO14
id: relay
restore_mode: RESTORE_DEFAULT_OFF # Ensures the relay is restored (or off) at boot
#internal: true # Hides the switch from Home Assistant
icon: "${relay_icon}"
restore_mode: RESTORE_DEFAULT_OFF # Ensures the relay is restored (or off) at boot
#internal: true # Hides the switch from Home Assistant
icon: "${relay_icon}"