Public Access
202 lines
4.4 KiB
YAML
202 lines
4.4 KiB
YAML
esphome:
|
|
name: ups-hid-monitor-minimal-test
|
|
friendly_name: "UPS HID Monitor"
|
|
comment: "Full test configuration for UPS HID Component with ESP32-S3"
|
|
|
|
esp32:
|
|
board: esp32-s3-devkitc-1
|
|
variant: esp32s3
|
|
framework:
|
|
type: esp-idf
|
|
version: 5.3.2
|
|
|
|
# Enable logging
|
|
logger:
|
|
level: DEBUG
|
|
baud_rate: 115200
|
|
hardware_uart: UART0
|
|
logs:
|
|
ups_hid: DEBUG
|
|
ups_hid.apc: DEBUG
|
|
ups_hid.apc_hid: DEBUG
|
|
ups_hid.generic: DEBUG
|
|
usb_host: DEBUG
|
|
esp32.usb_host: DEBUG
|
|
usb: DEBUG
|
|
usb-otg: DEBUG
|
|
HCD: DEBUG
|
|
USBH: DEBUG
|
|
|
|
# Enable Home Assistant API
|
|
api:
|
|
encryption:
|
|
key: !secret api_encryption_key
|
|
|
|
ota:
|
|
- platform: esphome
|
|
password: !secret ota_password
|
|
|
|
wifi:
|
|
ssid: !secret wifi_ssid
|
|
password: !secret wifi_password
|
|
ap:
|
|
ssid: "UPS-HID-Monitor"
|
|
password: !secret ap_password
|
|
|
|
captive_portal:
|
|
web_server:
|
|
|
|
# RGB LED for status indication
|
|
light:
|
|
- platform: esp32_rmt_led_strip
|
|
chipset: WS2812
|
|
pin: GPIO48
|
|
num_leds: 1
|
|
rgb_order: GRB
|
|
name: "UPS Status LED"
|
|
id: status_led
|
|
effects:
|
|
- strobe:
|
|
name: "Critical Strobe"
|
|
colors:
|
|
- state: true
|
|
brightness: 100%
|
|
red: 100%
|
|
green: 0%
|
|
blue: 0%
|
|
duration: 250ms
|
|
- state: false
|
|
duration: 250ms
|
|
# External components
|
|
external_components:
|
|
- source:
|
|
type: local
|
|
path: components
|
|
|
|
# UPS HID Component
|
|
ups_hid:
|
|
id: ups_monitor
|
|
simulation_mode: false # Test with real hardware
|
|
update_interval: 5s
|
|
|
|
# Component now auto-detects all USB devices and protocols
|
|
# Manual USB IDs only needed for troubleshooting:
|
|
# usb_vendor_id: 0x051d # APC vendor ID (uncomment if auto-detection fails)
|
|
# usb_product_id: 0x0002 # APC Back-UPS ES series
|
|
# usb_vendor_id: 0x0764 # CyberPower (uncomment if auto-detection fails)
|
|
# usb_product_id: 0x0501 # CP1500 AVR UPS
|
|
|
|
protocol_timeout: 10s
|
|
auto_detect_protocol: true
|
|
|
|
# Sensors
|
|
sensor:
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "UPS Battery Level"
|
|
id: ups_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: "UPS Runtime"
|
|
id: ups_runtime
|
|
type: runtime
|
|
unit_of_measurement: "min"
|
|
device_class: duration
|
|
state_class: measurement
|
|
accuracy_decimals: 0
|
|
|
|
# Test key missing dynamic values
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "Battery Charge Low Threshold"
|
|
id: battery_charge_low
|
|
type: battery_charge_low
|
|
unit_of_measurement: "%"
|
|
device_class: battery
|
|
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
|
|
state_class: measurement
|
|
accuracy_decimals: 0
|
|
|
|
# Binary Sensors
|
|
binary_sensor:
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "UPS On Battery"
|
|
id: ups_on_battery
|
|
type: on_battery
|
|
device_class: battery
|
|
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "UPS Fault"
|
|
id: ups_fault
|
|
type: fault
|
|
device_class: problem
|
|
|
|
# Text Sensors
|
|
text_sensor:
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "UPS Status"
|
|
id: ups_status
|
|
type: status
|
|
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "UPS Model"
|
|
id: ups_model
|
|
type: model
|
|
|
|
# Device Information Sensors (test APC implementation)
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "UPS Serial Number"
|
|
id: ups_serial_number
|
|
type: serial_number
|
|
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "UPS Firmware Version"
|
|
id: ups_firmware_version
|
|
type: firmware_version
|
|
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "UPS Beeper Status"
|
|
id: ups_beeper_status
|
|
type: ups_beeper_status
|
|
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "UPS Input Sensitivity"
|
|
id: ups_input_sensitivity
|
|
type: input_sensitivity
|
|
|
|
# Test key missing dynamic values
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "Battery Type"
|
|
id: battery_type
|
|
type: battery_type
|
|
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "UPS Test Result"
|
|
id: ups_test_result
|
|
type: ups_test_result
|