Public Access
190 lines
4.1 KiB
YAML
190 lines
4.1 KiB
YAML
# UPS Simulation Testing Configuration (Standalone)
|
|
# Testing without physical hardware using simulation mode
|
|
# Use: esphome compile configs/testing/simulation_test_standalone.yaml
|
|
|
|
substitutions:
|
|
name: "ups-simulation-test"
|
|
friendly_name: "UPS Simulation Test"
|
|
simulation_mode: "true" # Enable simulation mode
|
|
log_level: "INFO"
|
|
|
|
esphome:
|
|
name: "${name}"
|
|
friendly_name: "${friendly_name}"
|
|
comment: "UPS simulation mode test (no hardware required)"
|
|
|
|
# Core ESP32 configuration
|
|
esp32:
|
|
board: esp32-s3-devkitc-1
|
|
framework:
|
|
type: esp-idf
|
|
|
|
# Reduced logging for simulation
|
|
logger:
|
|
level: ${log_level}
|
|
baud_rate: 115200
|
|
hardware_uart: UART0
|
|
logs:
|
|
ups_hid: INFO
|
|
|
|
# Network configuration (minimal for testing)
|
|
wifi:
|
|
ssid: "TestNetwork"
|
|
password: "TestPassword"
|
|
ap:
|
|
ssid: "${friendly_name} Fallback"
|
|
password: "TestAPPassword"
|
|
|
|
captive_portal:
|
|
|
|
# OTA updates
|
|
ota:
|
|
- platform: esphome
|
|
password: "TestOTAPassword"
|
|
|
|
# Web server for diagnostics
|
|
web_server:
|
|
port: 80
|
|
|
|
# External components
|
|
external_components:
|
|
- source:
|
|
type: local
|
|
path: ../../components
|
|
|
|
# Required platform components (fix compilation errors)
|
|
button:
|
|
|
|
# Override for simulation testing
|
|
ups_hid:
|
|
id: ups_monitor
|
|
update_interval: 5s # Fast updates for demo
|
|
protocol_timeout: 5s
|
|
auto_detect_protocol: true
|
|
simulation_mode: ${simulation_mode}
|
|
|
|
# Status LED configuration
|
|
light:
|
|
- platform: esp32_rmt_led_strip
|
|
chipset: WS2812
|
|
pin: GPIO48
|
|
num_leds: 1
|
|
rgb_order: GRB
|
|
name: "UPS Status LED"
|
|
id: ups_status_led
|
|
restore_mode: ALWAYS_OFF
|
|
|
|
# Essential binary sensors
|
|
binary_sensor:
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "UPS Online"
|
|
id: ups_online
|
|
type: online
|
|
device_class: connectivity
|
|
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "On Battery Power"
|
|
id: on_battery
|
|
type: on_battery
|
|
device_class: battery
|
|
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "Low Battery Warning"
|
|
id: low_battery
|
|
type: low_battery
|
|
device_class: battery
|
|
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "UPS Fault"
|
|
id: ups_fault
|
|
type: fault
|
|
device_class: problem
|
|
|
|
# Essential text sensors
|
|
text_sensor:
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "UPS Status"
|
|
id: ups_status_text
|
|
type: status
|
|
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "Detected Protocol"
|
|
id: ups_protocol
|
|
type: protocol
|
|
|
|
# Core UPS metrics - available on all protocols
|
|
sensor:
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "Battery Level"
|
|
id: battery_level
|
|
type: battery_level
|
|
unit_of_measurement: "%"
|
|
device_class: battery
|
|
state_class: measurement
|
|
accuracy_decimals: 0
|
|
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "Input Voltage"
|
|
id: input_voltage
|
|
type: input_voltage
|
|
unit_of_measurement: "V"
|
|
device_class: voltage
|
|
state_class: measurement
|
|
accuracy_decimals: 1
|
|
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "Output Voltage"
|
|
id: output_voltage
|
|
type: output_voltage
|
|
unit_of_measurement: "V"
|
|
device_class: voltage
|
|
state_class: measurement
|
|
accuracy_decimals: 1
|
|
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "Load Percentage"
|
|
id: load_percentage
|
|
type: load_percent
|
|
unit_of_measurement: "%"
|
|
device_class: power_factor
|
|
state_class: measurement
|
|
accuracy_decimals: 0
|
|
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "Runtime Remaining"
|
|
id: runtime_remaining
|
|
type: runtime
|
|
unit_of_measurement: "min"
|
|
device_class: duration
|
|
state_class: measurement
|
|
accuracy_decimals: 0
|
|
|
|
# Simulation validation script
|
|
script:
|
|
- id: simulation_demo
|
|
then:
|
|
- logger.log:
|
|
format: "SIMULATION DATA - Battery: %.1f%%, Load: %.1f%%, Input: %.1fV, Output: %.1fV"
|
|
args:
|
|
- "id(battery_level).state"
|
|
- "id(load_percentage).state"
|
|
- "id(input_voltage).state"
|
|
- "id(output_voltage).state"
|
|
level: INFO
|
|
|
|
# Demo data updates every 10 seconds
|
|
interval:
|
|
- interval: 10s
|
|
then:
|
|
- script.execute: simulation_demo |