Public Access
128 lines
2.5 KiB
YAML
128 lines
2.5 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
|
|
|
|
# Enable logging
|
|
logger:
|
|
level: DEBUG
|
|
baud_rate: 115200
|
|
hardware_uart: UART0
|
|
|
|
# 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: true # Set to false for production
|
|
update_interval: 5s
|
|
|
|
# Hardware Configuration
|
|
usb_vendor_id: 0x051d # APC vendor ID (0x051d)
|
|
usb_product_id: 0x0002 # APC Back-UPS ES series
|
|
|
|
# usb_vendor_id: 0x0764 # CyberPower (0x0764)
|
|
# 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
|
|
|
|
# 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
|