Public Access
refactor(ups-hid): clean abstraction layers, strategy pattern for protocol selection and proper data structure
Signed-off-by: bullshit <coding@ow-software.pl>
This commit is contained in:
41 files changed
+4768
-3013
No files matched your search
+84
-30
@@ -1,56 +1,110 @@
|
||||
# UPS HID Configuration Management
|
||||
|
||||
This directory provides a modular, maintainable approach to UPS HID device configuration using ESPHome packages. Instead of maintaining large, complex configuration files, you can compose configurations from reusable components.
|
||||
This directory provides a modular, maintainable approach to UPS HID device configuration using ESPHome packages with the new Protocol Factory system. Instead of maintaining large, complex configuration files, you can compose configurations from reusable components.
|
||||
|
||||
## Modular Configuration Packages
|
||||
## 📦 Modular Configuration Packages
|
||||
|
||||
### Core Packages
|
||||
### **Core Packages** (Always Required)
|
||||
|
||||
#### `base_ups.yaml`
|
||||
Essential foundation for all UPS devices:
|
||||
- ESP32-S3 hardware configuration
|
||||
- Network setup (WiFi, OTA, Web server)
|
||||
- UPS HID component initialization
|
||||
- Status LED with basic patterns
|
||||
- Essential binary sensors for LED automation
|
||||
- UPS HID component initialization with Protocol Factory
|
||||
- Status LED with smart patterns
|
||||
- Essential binary sensors: `online`, `on_battery`, `low_battery`, `fault`
|
||||
- Essential text sensors: `status` (as "UPS Status"), `protocol` (as "Detected Protocol")
|
||||
|
||||
#### `essential_sensors.yaml`
|
||||
Core monitoring sensors available on all UPS protocols:
|
||||
- Battery level, input/output voltage, load percentage
|
||||
- Runtime remaining, basic device information
|
||||
- System monitoring (uptime, WiFi signal)
|
||||
Core monitoring sensors (5 sensors) available on all protocols:
|
||||
- **Sensors**: `battery_level`, `input_voltage`, `output_voltage`, `load_percent`, `runtime`
|
||||
- **Text Sensors**: `manufacturer`, `model`
|
||||
- **Binary Sensors**: `charging`, `overload`
|
||||
- **System Monitoring**: uptime, WiFi signal, IP address, ESPHome version
|
||||
- Compatible with APC, CyberPower, and Generic protocols
|
||||
|
||||
### **Optional Enhancement Packages**
|
||||
|
||||
#### `extended_sensors.yaml`
|
||||
Advanced sensors for feature-rich devices:
|
||||
- Battery voltage (actual and nominal)
|
||||
- Input transfer limits and frequency
|
||||
- UPS configuration parameters
|
||||
- Power calculations and analysis
|
||||
- Optimized for CyberPower devices
|
||||
Advanced monitoring (17 additional sensors) for feature-rich devices:
|
||||
|
||||
**Enhanced Voltage Monitoring**:
|
||||
- `battery_voltage`, `battery_voltage_nominal`, `input_voltage_nominal`
|
||||
- `input_transfer_low`, `input_transfer_high`, `frequency`
|
||||
|
||||
**Power & Configuration**:
|
||||
- `ups_realpower_nominal`, `ups_delay_shutdown`, `ups_delay_start`, `ups_delay_reboot`
|
||||
|
||||
**Dynamic Timer Monitoring** (negative values = no active countdown):
|
||||
- `ups_timer_shutdown`, `ups_timer_start`, `ups_timer_reboot`
|
||||
- `battery_runtime_low`
|
||||
|
||||
**Extended Device Information**:
|
||||
- `serial_number`, `firmware_version`, `ups_beeper_status`, `input_sensitivity`
|
||||
- `ups_mfr_date`, `battery_status`, `ups_firmware_aux`
|
||||
|
||||
**Smart Template**: Calculated load power using HID nominal power when available
|
||||
|
||||
#### `ups_controls.yaml`
|
||||
Interactive control functionality:
|
||||
- Beeper control (enable/disable/mute/test)
|
||||
- Battery testing (quick/deep/stop)
|
||||
- Panel testing (start/stop)
|
||||
- Test result monitoring
|
||||
Complete control functionality (10 buttons + test monitoring):
|
||||
|
||||
### Device-Specific Packages
|
||||
**Beeper Control**: `enable`, `disable`, `mute`, `test`
|
||||
**UPS Testing**: `battery_quick`, `battery_deep`, `battery_stop`, `ups_test`, `ups_stop`
|
||||
**Test Monitoring**: `ups_test_result` text sensor
|
||||
|
||||
### **Device-Specific Optimization Packages**
|
||||
|
||||
#### `device_types/apc_backups_es.yaml`
|
||||
APC Back-UPS ES series optimizations:
|
||||
- Slower update intervals (APC devices need more time)
|
||||
- APC-specific power calculations (405W nominal)
|
||||
- Enhanced protocol debugging
|
||||
- Device-specific status monitoring
|
||||
- Slower update intervals (15s - APC devices need more time)
|
||||
- APC-specific power calculations (405W nominal for ES 700)
|
||||
- Enhanced protocol debugging (`ups_hid.apc: DEBUG`)
|
||||
- Fixed device-specific script references
|
||||
|
||||
#### `device_types/cyberpower_cp1500.yaml`
|
||||
CyberPower CP1500 series optimizations:
|
||||
- Fast update intervals (CyberPower responds quickly)
|
||||
- Advanced threshold monitoring
|
||||
- Extended device information
|
||||
- Rich sensor data utilization
|
||||
- Fast update intervals (10s - CyberPower responds quickly)
|
||||
- **Additional sensor**: `battery_charge_low` threshold
|
||||
- **Enhanced power calculation**: Uses HID nominal power when available (900W default)
|
||||
- **Device-specific text sensor**: `battery_mfr_date` (separate from UPS date)
|
||||
- Rich monitoring script with comprehensive status logging
|
||||
|
||||
---
|
||||
|
||||
## 📊 **Complete Sensor Summary**
|
||||
|
||||
### **Package Composition Options:**
|
||||
|
||||
| Configuration Level | Packages Included | Total Sensors | Use Case |
|
||||
|-------------------|------------------|--------------|----------|
|
||||
| **Minimal** | `base_ups` + `essential_sensors` | **9 sensors** | Basic monitoring |
|
||||
| **Complete** | + `extended_sensors` + `ups_controls` | **27 sensors + 10 controls** | Full featured |
|
||||
| **Device-Optimized** | + device-specific package | **28+ sensors + 10 controls** | Production ready |
|
||||
|
||||
### **Sensor Breakdown by Type:**
|
||||
|
||||
#### **Numeric Sensors** (22 total available):
|
||||
- **Essential (5)**: battery_level, input_voltage, output_voltage, load_percent, runtime
|
||||
- **Extended (17)**: All enhanced voltage/power/timer/threshold monitoring
|
||||
|
||||
#### **Text Sensors** (10 total available):
|
||||
- **Base (2)**: status, protocol *(in base_ups.yaml)*
|
||||
- **Essential (2)**: manufacturer, model
|
||||
- **Extended (6)**: serial_number, firmware_version, ups_beeper_status, input_sensitivity, ups_mfr_date, battery_status, ups_firmware_aux
|
||||
- **Controls (1)**: ups_test_result *(in ups_controls.yaml)*
|
||||
- **Device-Specific (+1)**: battery_mfr_date *(CyberPower only)*
|
||||
|
||||
#### **Binary Sensors** (6 total):
|
||||
- **Base (4)**: online, on_battery, low_battery, fault
|
||||
- **Essential (2)**: charging, overload
|
||||
|
||||
#### **Button Controls** (10 total, all in ups_controls.yaml):
|
||||
- **Beeper (4)**: enable, disable, mute, test
|
||||
- **Testing (6)**: battery_quick, battery_deep, battery_stop, ups_test, ups_stop
|
||||
|
||||
#### **Smart Templates** (2 calculated sensors):
|
||||
- **Generic**: UPS Load Power (uses HID data when available)
|
||||
- **Device-Specific**: Device-optimized power calculations
|
||||
|
||||
## Testing Configurations
|
||||
|
||||
|
||||
@@ -64,7 +64,8 @@ ups_hid:
|
||||
id: ups_monitor
|
||||
update_interval: ${update_interval}
|
||||
protocol_timeout: ${protocol_timeout}
|
||||
auto_detect_protocol: true
|
||||
protocol: auto
|
||||
fallback_nominal_voltage: 230V # European standard (IEC 60038) for better international compatibility
|
||||
simulation_mode: ${simulation_mode}
|
||||
|
||||
# Status LED configuration
|
||||
|
||||
@@ -16,7 +16,7 @@ ups_hid:
|
||||
id: ups_monitor
|
||||
update_interval: ${update_interval}
|
||||
protocol_timeout: ${protocol_timeout}
|
||||
auto_detect_protocol: true
|
||||
protocol: apc
|
||||
simulation_mode: ${simulation_mode}
|
||||
# Uncomment if auto-detection fails:
|
||||
# usb_vendor_id: 0x051D
|
||||
|
||||
@@ -16,7 +16,7 @@ ups_hid:
|
||||
id: ups_monitor
|
||||
update_interval: ${update_interval}
|
||||
protocol_timeout: ${protocol_timeout}
|
||||
auto_detect_protocol: true
|
||||
protocol: cyberpower
|
||||
simulation_mode: ${simulation_mode}
|
||||
# Uncomment if auto-detection fails:
|
||||
# usb_vendor_id: 0x0764
|
||||
@@ -29,9 +29,9 @@ logger:
|
||||
ups_hid: DEBUG
|
||||
ups_hid.cyberpower: DEBUG
|
||||
|
||||
# CyberPower-specific threshold sensors
|
||||
# CyberPower-specific sensors (complement extended_sensors.yaml)
|
||||
sensor:
|
||||
# Battery threshold monitoring (available on CyberPower)
|
||||
# CyberPower-specific battery threshold (not in extended pack)
|
||||
- platform: ups_hid
|
||||
ups_hid_id: ups_monitor
|
||||
name: "Battery Charge Low Threshold"
|
||||
@@ -42,72 +42,37 @@ sensor:
|
||||
state_class: measurement
|
||||
accuracy_decimals: 0
|
||||
|
||||
- platform: ups_hid
|
||||
ups_hid_id: ups_monitor
|
||||
name: "Battery Runtime Low Threshold"
|
||||
id: battery_runtime_low
|
||||
type: battery_runtime_low
|
||||
unit_of_measurement: "min"
|
||||
device_class: duration
|
||||
# CyberPower power calculation with actual HID nominal power
|
||||
- platform: template
|
||||
name: "UPS Load Power (CyberPower)"
|
||||
id: ups_load_power_cp
|
||||
unit_of_measurement: "W"
|
||||
device_class: power
|
||||
state_class: measurement
|
||||
accuracy_decimals: 0
|
||||
accuracy_decimals: 1
|
||||
lambda: |-
|
||||
if (!std::isnan(id(load_percentage).state)) {
|
||||
float cp_max_power = 900.0; // CP1500 default: 900W
|
||||
|
||||
// Use HID nominal power if available (from extended sensors)
|
||||
if (!std::isnan(id(ups_realpower_nominal).state)) {
|
||||
cp_max_power = id(ups_realpower_nominal).state;
|
||||
}
|
||||
|
||||
return (cp_max_power * id(load_percentage).state) / 100.0;
|
||||
}
|
||||
return NAN;
|
||||
update_interval: 30s
|
||||
|
||||
# CyberPower-specific timer values
|
||||
- platform: ups_hid
|
||||
ups_hid_id: ups_monitor
|
||||
name: "UPS Timer Reboot"
|
||||
id: ups_timer_reboot
|
||||
type: ups_timer_reboot
|
||||
unit_of_measurement: "s"
|
||||
device_class: duration
|
||||
state_class: measurement
|
||||
accuracy_decimals: 0
|
||||
|
||||
- platform: ups_hid
|
||||
ups_hid_id: ups_monitor
|
||||
name: "UPS Timer Shutdown"
|
||||
id: ups_timer_shutdown
|
||||
type: ups_timer_shutdown
|
||||
unit_of_measurement: "s"
|
||||
device_class: duration
|
||||
state_class: measurement
|
||||
accuracy_decimals: 0
|
||||
|
||||
- platform: ups_hid
|
||||
ups_hid_id: ups_monitor
|
||||
name: "UPS Timer Start"
|
||||
id: ups_timer_start
|
||||
type: ups_timer_start
|
||||
unit_of_measurement: "s"
|
||||
device_class: duration
|
||||
state_class: measurement
|
||||
accuracy_decimals: 0
|
||||
|
||||
# CyberPower-specific enhanced device info
|
||||
# CyberPower-specific text sensors (complement extended_sensors.yaml)
|
||||
text_sensor:
|
||||
- platform: ups_hid
|
||||
ups_hid_id: ups_monitor
|
||||
name: "Battery Status"
|
||||
id: battery_status
|
||||
type: battery_status
|
||||
|
||||
- platform: ups_hid
|
||||
ups_hid_id: ups_monitor
|
||||
name: "Battery Type"
|
||||
id: battery_type
|
||||
type: battery_type
|
||||
|
||||
# Separate battery vs UPS manufacture dates (CyberPower provides both)
|
||||
- platform: ups_hid
|
||||
ups_hid_id: ups_monitor
|
||||
name: "Battery Manufacture Date"
|
||||
id: battery_mfr_date
|
||||
type: battery_mfr_date
|
||||
|
||||
- platform: ups_hid
|
||||
ups_hid_id: ups_monitor
|
||||
name: "UPS Manufacture Date"
|
||||
id: ups_mfr_date
|
||||
type: ups_mfr_date
|
||||
icon: "mdi:calendar-battery"
|
||||
|
||||
# CyberPower-specific monitoring scripts
|
||||
script:
|
||||
@@ -120,7 +85,7 @@ script:
|
||||
- "id(battery_voltage).state"
|
||||
- "id(battery_voltage_nominal).state"
|
||||
- "id(load_percentage).state"
|
||||
- "id(ups_load_power).state"
|
||||
- "id(ups_load_power_cp).state"
|
||||
- "id(ups_realpower_nominal).state"
|
||||
- "id(input_voltage).state"
|
||||
- "id(runtime_remaining).state"
|
||||
|
||||
@@ -79,6 +79,7 @@ text_sensor:
|
||||
id: ups_model
|
||||
type: model
|
||||
|
||||
|
||||
- platform: wifi_info
|
||||
ip_address:
|
||||
name: "IP Address"
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
# Protocol Selection Demo Configuration
|
||||
# Demonstrates the new manual protocol selection feature
|
||||
|
||||
substitutions:
|
||||
name: "ups-protocol-demo"
|
||||
friendly_name: "Protocol Demo"
|
||||
simulation_mode: "true"
|
||||
|
||||
esphome:
|
||||
name: "${name}"
|
||||
friendly_name: "${friendly_name}"
|
||||
comment: "Demonstration of manual protocol selection"
|
||||
|
||||
# Use base configuration package
|
||||
packages:
|
||||
base_ups: !include ../base_ups.yaml
|
||||
essential: !include ../essential_sensors.yaml
|
||||
|
||||
# Protocol Selection Examples
|
||||
ups_hid:
|
||||
id: ups_monitor
|
||||
update_interval: 10s
|
||||
protocol_timeout: 15s
|
||||
simulation_mode: ${simulation_mode}
|
||||
|
||||
# Protocol Options (uncomment one to test):
|
||||
protocol: auto # Default: Auto-detect based on USB vendor ID
|
||||
# protocol: apc # Force APC HID Protocol
|
||||
# protocol: cyberpower # Force CyberPower HID Protocol
|
||||
# protocol: generic # Force Generic HID Protocol
|
||||
|
||||
# Enhanced logging to see protocol selection
|
||||
logger:
|
||||
level: DEBUG
|
||||
logs:
|
||||
ups_hid: DEBUG
|
||||
|
||||
# Demo script to show active protocol
|
||||
script:
|
||||
- id: protocol_demo
|
||||
then:
|
||||
- logger.log:
|
||||
format: "PROTOCOL DEMO - Active Protocol: %s"
|
||||
args:
|
||||
- "id(ups_protocol).state.c_str()"
|
||||
level: INFO
|
||||
|
||||
# Run demo every 60 seconds
|
||||
interval:
|
||||
- interval: 60s
|
||||
then:
|
||||
- script.execute: protocol_demo
|
||||
@@ -95,6 +95,61 @@ sensor:
|
||||
state_class: measurement
|
||||
accuracy_decimals: 0
|
||||
|
||||
- platform: ups_hid
|
||||
ups_hid_id: ups_monitor
|
||||
name: "UPS Delay Reboot"
|
||||
id: ups_delay_reboot
|
||||
type: ups_delay_reboot
|
||||
unit_of_measurement: "s"
|
||||
device_class: duration
|
||||
state_class: measurement
|
||||
accuracy_decimals: 0
|
||||
|
||||
# Enhanced dynamic timer sensors (countdown when active)
|
||||
- platform: ups_hid
|
||||
ups_hid_id: ups_monitor
|
||||
name: "UPS Timer Shutdown"
|
||||
id: ups_timer_shutdown
|
||||
type: ups_timer_shutdown
|
||||
unit_of_measurement: "s"
|
||||
device_class: duration
|
||||
state_class: measurement
|
||||
accuracy_decimals: 0
|
||||
# Negative values indicate no active countdown
|
||||
|
||||
- platform: ups_hid
|
||||
ups_hid_id: ups_monitor
|
||||
name: "UPS Timer Start"
|
||||
id: ups_timer_start
|
||||
type: ups_timer_start
|
||||
unit_of_measurement: "s"
|
||||
device_class: duration
|
||||
state_class: measurement
|
||||
accuracy_decimals: 0
|
||||
# Negative values indicate no active countdown
|
||||
|
||||
- platform: ups_hid
|
||||
ups_hid_id: ups_monitor
|
||||
name: "UPS Timer Reboot"
|
||||
id: ups_timer_reboot
|
||||
type: ups_timer_reboot
|
||||
unit_of_measurement: "s"
|
||||
device_class: duration
|
||||
state_class: measurement
|
||||
accuracy_decimals: 0
|
||||
# Negative values indicate no active countdown
|
||||
|
||||
# Enhanced battery threshold monitoring
|
||||
- platform: ups_hid
|
||||
ups_hid_id: ups_monitor
|
||||
name: "Battery Runtime Low Threshold"
|
||||
id: battery_runtime_low
|
||||
type: battery_runtime_low
|
||||
unit_of_measurement: "min"
|
||||
device_class: duration
|
||||
state_class: measurement
|
||||
accuracy_decimals: 0
|
||||
|
||||
# Calculated power consumption
|
||||
- platform: template
|
||||
name: "UPS Load Power"
|
||||
@@ -141,4 +196,26 @@ text_sensor:
|
||||
ups_hid_id: ups_monitor
|
||||
name: "Input Sensitivity"
|
||||
id: input_sensitivity
|
||||
type: input_sensitivity
|
||||
type: input_sensitivity
|
||||
|
||||
- platform: ups_hid
|
||||
ups_hid_id: ups_monitor
|
||||
name: "UPS Manufacture Date"
|
||||
id: ups_manufacture_date
|
||||
type: ups_mfr_date
|
||||
icon: "mdi:calendar-clock"
|
||||
|
||||
- platform: ups_hid
|
||||
ups_hid_id: ups_monitor
|
||||
name: "Battery Status"
|
||||
id: battery_status
|
||||
type: battery_status
|
||||
icon: "mdi:battery-heart"
|
||||
|
||||
# Additional enhanced text sensors from protocols
|
||||
- platform: ups_hid
|
||||
ups_hid_id: ups_monitor
|
||||
name: "Firmware Auxiliary"
|
||||
id: firmware_aux
|
||||
type: ups_firmware_aux
|
||||
icon: "mdi:chip"
|
||||
@@ -0,0 +1,66 @@
|
||||
# European Voltage Defaults
|
||||
# Configuration template for European electrical standards (IEC 60038)
|
||||
# Use this as a base for European installations
|
||||
|
||||
substitutions:
|
||||
# European electrical standards
|
||||
nominal_voltage: "230V" # Standard European single-phase voltage (IEC 60038)
|
||||
frequency: "50Hz" # European frequency standard
|
||||
|
||||
# Regional timezone examples (adjust for your location)
|
||||
timezone: "Europe/Berlin" # Germany
|
||||
# timezone: "Europe/London" # United Kingdom
|
||||
# timezone: "Europe/Paris" # France
|
||||
# timezone: "Europe/Rome" # Italy
|
||||
# timezone: "Europe/Madrid" # Spain
|
||||
|
||||
# Base UPS configuration with European defaults
|
||||
ups_hid:
|
||||
id: ups_monitor
|
||||
update_interval: 30s
|
||||
protocol_timeout: 15s
|
||||
protocol: auto
|
||||
fallback_nominal_voltage: ${nominal_voltage}
|
||||
simulation_mode: false
|
||||
|
||||
# Time configuration with European timezone
|
||||
time:
|
||||
- platform: sntp
|
||||
id: sntp_time
|
||||
timezone: ${timezone}
|
||||
servers:
|
||||
- "pool.ntp.org"
|
||||
- "time.nist.gov"
|
||||
|
||||
# Logging optimized for European users
|
||||
logger:
|
||||
level: INFO
|
||||
logs:
|
||||
ups_hid: INFO
|
||||
|
||||
# WiFi configuration template
|
||||
wifi:
|
||||
# Configure your WiFi credentials
|
||||
ssid: !secret wifi_ssid
|
||||
password: !secret wifi_password
|
||||
|
||||
# European WiFi channel optimization (1-13 allowed in EU)
|
||||
channel: 6
|
||||
|
||||
# Enable fast connect for better reconnection
|
||||
fast_connect: true
|
||||
|
||||
# Access point fallback (if main WiFi fails)
|
||||
ap:
|
||||
ssid: "${friendly_name} AP"
|
||||
password: !secret ap_password
|
||||
|
||||
# Optional: Home Assistant API with encryption
|
||||
api:
|
||||
encryption:
|
||||
key: !secret api_encryption_key
|
||||
|
||||
# Optional: Over-the-air updates
|
||||
ota:
|
||||
- platform: esphome
|
||||
password: !secret ota_password
|
||||
@@ -0,0 +1,65 @@
|
||||
# North American Voltage Defaults
|
||||
# Configuration template for North American electrical standards (NEMA)
|
||||
# Use this as a base for US/Canada installations
|
||||
|
||||
substitutions:
|
||||
# North American electrical standards
|
||||
nominal_voltage: "120V" # Standard North American single-phase voltage
|
||||
frequency: "60Hz" # North American frequency standard
|
||||
|
||||
# Regional timezone examples (adjust for your location)
|
||||
timezone: "America/New_York" # Eastern Time
|
||||
# timezone: "America/Chicago" # Central Time
|
||||
# timezone: "America/Denver" # Mountain Time
|
||||
# timezone: "America/Los_Angeles" # Pacific Time
|
||||
|
||||
# Base UPS configuration with North American defaults
|
||||
ups_hid:
|
||||
id: ups_monitor
|
||||
update_interval: 30s
|
||||
protocol_timeout: 15s
|
||||
protocol: auto
|
||||
fallback_nominal_voltage: ${nominal_voltage}
|
||||
simulation_mode: false
|
||||
|
||||
# Time configuration with North American timezone
|
||||
time:
|
||||
- platform: sntp
|
||||
id: sntp_time
|
||||
timezone: ${timezone}
|
||||
servers:
|
||||
- "pool.ntp.org"
|
||||
- "time.nist.gov"
|
||||
|
||||
# Logging optimized for North American users
|
||||
logger:
|
||||
level: INFO
|
||||
logs:
|
||||
ups_hid: INFO
|
||||
|
||||
# WiFi configuration template
|
||||
wifi:
|
||||
# Configure your WiFi credentials
|
||||
ssid: !secret wifi_ssid
|
||||
password: !secret wifi_password
|
||||
|
||||
# North American WiFi channel optimization (1-11 allowed in US/Canada)
|
||||
channel: 6
|
||||
|
||||
# Enable fast connect for better reconnection
|
||||
fast_connect: true
|
||||
|
||||
# Access point fallback (if main WiFi fails)
|
||||
ap:
|
||||
ssid: "${friendly_name} AP"
|
||||
password: !secret ap_password
|
||||
|
||||
# Optional: Home Assistant API with encryption
|
||||
api:
|
||||
encryption:
|
||||
key: !secret api_encryption_key
|
||||
|
||||
# Optional: Over-the-air updates
|
||||
ota:
|
||||
- platform: esphome
|
||||
password: !secret ota_password
|
||||
@@ -23,7 +23,7 @@ ups_hid:
|
||||
id: ups_monitor
|
||||
update_interval: 5s
|
||||
protocol_timeout: 10s
|
||||
auto_detect_protocol: true
|
||||
protocol: auto
|
||||
simulation_mode: ${simulation_mode}
|
||||
|
||||
# Enhanced logging for testing
|
||||
|
||||
@@ -25,7 +25,7 @@ ups_hid:
|
||||
id: ups_monitor
|
||||
update_interval: 5s
|
||||
protocol_timeout: 10s
|
||||
auto_detect_protocol: true
|
||||
protocol: auto
|
||||
simulation_mode: ${simulation_mode}
|
||||
|
||||
# Beeper-focused logging
|
||||
|
||||
@@ -38,7 +38,7 @@ ups_hid:
|
||||
id: ups_monitor
|
||||
update_interval: 10s
|
||||
protocol_timeout: 5s
|
||||
auto_detect_protocol: true
|
||||
protocol: auto
|
||||
simulation_mode: true
|
||||
|
||||
# Required platform components (fix compilation errors)
|
||||
|
||||
@@ -26,7 +26,7 @@ ups_hid:
|
||||
id: ups_monitor
|
||||
update_interval: 5s # Fast updates for demo
|
||||
protocol_timeout: 5s
|
||||
auto_detect_protocol: true
|
||||
protocol: auto
|
||||
simulation_mode: ${simulation_mode}
|
||||
|
||||
# Reduced logging for simulation
|
||||
|
||||
Reference in new issue
Block a user