Public Access
feat(ups-hid): setting up testing infrastructure
Signed-off-by: bullshit <coding@ow-software.pl>
This commit is contained in:
22 files changed
+1657
-1243
No files matched your search
@@ -0,0 +1,66 @@
|
||||
# Example: APC Back-UPS ES 700 Configuration
|
||||
# Complete production configuration for APC UPS
|
||||
# Copy and customize this file for your APC device
|
||||
|
||||
substitutions:
|
||||
name: "apc-ups-monitor"
|
||||
friendly_name: "Office APC UPS"
|
||||
|
||||
# Device customization
|
||||
timezone: "America/Vienna" # Replace with your timezone
|
||||
|
||||
# Testing/production mode
|
||||
simulation_mode: "false" # Set to "true" for testing without hardware
|
||||
|
||||
esphome:
|
||||
name: "${name}"
|
||||
friendly_name: "${friendly_name}"
|
||||
comment: "APC Back-UPS ES 700 Monitor"
|
||||
|
||||
# Use modular configuration packages
|
||||
packages:
|
||||
# Core functionality
|
||||
base_ups: !include ../base_ups.yaml
|
||||
essential: !include ../essential_sensors.yaml
|
||||
|
||||
# Extended monitoring (optional - comment out if not needed)
|
||||
extended: !include ../extended_sensors.yaml
|
||||
|
||||
# Control buttons (optional - comment out if not needed)
|
||||
controls: !include ../ups_controls.yaml
|
||||
|
||||
# APC-specific optimizations
|
||||
apc_device: !include ../device_types/apc_backups_es.yaml
|
||||
|
||||
# Time component for accurate timestamps
|
||||
time:
|
||||
- platform: sntp
|
||||
id: sntp_time
|
||||
timezone: "${timezone}"
|
||||
|
||||
# Optional: Home Assistant API (uncomment to enable)
|
||||
# api:
|
||||
# encryption:
|
||||
# key: "your_32_character_encryption_key_here=="
|
||||
|
||||
# Optional: Notification automation examples
|
||||
script:
|
||||
- id: power_outage_alert
|
||||
then:
|
||||
- logger.log:
|
||||
format: "POWER OUTAGE DETECTED - Battery at %.1f%%, Runtime: %.1f minutes"
|
||||
args:
|
||||
- "id(battery_level).state"
|
||||
- "id(runtime_remaining).state"
|
||||
level: WARN
|
||||
# Add your notification logic here (e.g., Home Assistant service call)
|
||||
|
||||
- id: power_restored_alert
|
||||
then:
|
||||
- logger.log:
|
||||
format: "POWER RESTORED - UPS back online"
|
||||
level: INFO
|
||||
# Add your notification logic here
|
||||
|
||||
# Custom automations would be handled in Home Assistant
|
||||
# The base sensors from base_ups.yaml and essential_sensors.yaml provide all the data needed
|
||||
@@ -0,0 +1,91 @@
|
||||
# Example: CyberPower CP1500EPFCLCD Configuration
|
||||
# Complete production configuration for CyberPower UPS
|
||||
# Copy and customize this file for your CyberPower device
|
||||
|
||||
substitutions:
|
||||
name: "rack-ups-monitor"
|
||||
friendly_name: "Rack CyberPower UPS"
|
||||
|
||||
# Device customization
|
||||
timezone: "America/Vienna" # Replace with your timezone
|
||||
|
||||
# Testing/production mode
|
||||
simulation_mode: "false" # Set to "true" for testing without hardware
|
||||
|
||||
esphome:
|
||||
name: "${name}"
|
||||
friendly_name: "${friendly_name}"
|
||||
comment: "CyberPower CP1500EPFCLCD Monitor"
|
||||
|
||||
# Use modular configuration packages
|
||||
packages:
|
||||
# Core functionality
|
||||
base_ups: !include ../base_ups.yaml
|
||||
essential: !include ../essential_sensors.yaml
|
||||
|
||||
# Extended monitoring (recommended for CyberPower - rich sensor data)
|
||||
extended: !include ../extended_sensors.yaml
|
||||
|
||||
# Control buttons (recommended - CyberPower has excellent beeper support)
|
||||
controls: !include ../ups_controls.yaml
|
||||
|
||||
# CyberPower-specific optimizations
|
||||
cyberpower_device: !include ../device_types/cyberpower_cp1500.yaml
|
||||
|
||||
# Time component for accurate timestamps
|
||||
time:
|
||||
- platform: sntp
|
||||
id: sntp_time
|
||||
timezone: "${timezone}"
|
||||
|
||||
# Optional: Home Assistant API (uncomment to enable)
|
||||
# api:
|
||||
# encryption:
|
||||
# key: "your_32_character_encryption_key_here=="
|
||||
|
||||
# CyberPower-specific automation examples
|
||||
script:
|
||||
- id: battery_threshold_alert
|
||||
then:
|
||||
- logger.log:
|
||||
format: "BATTERY THRESHOLD ALERT - Current: %.1f%%, Low Threshold: %.1f%%, Runtime Low: %.1f min"
|
||||
args:
|
||||
- "id(battery_level).state"
|
||||
- "id(battery_charge_low).state"
|
||||
- "id(battery_runtime_low).state"
|
||||
level: WARN
|
||||
|
||||
- id: advanced_power_analysis
|
||||
then:
|
||||
- logger.log:
|
||||
format: "POWER ANALYSIS - Load: %.1f%% (%.0fW/%.0fW), Input: %.1fV (%.0fV nominal), Battery: %.1fV/%.0fV"
|
||||
args:
|
||||
- "id(load_percentage).state"
|
||||
- "id(ups_load_power).state"
|
||||
- "id(ups_realpower_nominal).state"
|
||||
- "id(input_voltage).state"
|
||||
- "id(input_voltage_nominal).state"
|
||||
- "id(battery_voltage).state"
|
||||
- "id(battery_voltage_nominal).state"
|
||||
level: INFO
|
||||
|
||||
# Enhanced monitoring with CyberPower's rich data
|
||||
interval:
|
||||
- interval: 300s # Every 5 minutes
|
||||
then:
|
||||
- script.execute: advanced_power_analysis
|
||||
|
||||
# Smart threshold monitoring
|
||||
binary_sensor:
|
||||
- platform: template
|
||||
name: "Battery Below Custom Threshold"
|
||||
id: battery_custom_threshold
|
||||
lambda: |-
|
||||
// Trigger alert when battery drops below configured low threshold
|
||||
if (!std::isnan(id(battery_level).state) && !std::isnan(id(battery_charge_low).state)) {
|
||||
return id(battery_level).state <= id(battery_charge_low).state;
|
||||
}
|
||||
return false;
|
||||
on_press:
|
||||
then:
|
||||
- script.execute: battery_threshold_alert
|
||||
Reference in new issue
Block a user