Public Access
221 lines
5.6 KiB
YAML
221 lines
5.6 KiB
YAML
# Extended UPS Sensors Package
|
|
# Additional sensors for advanced monitoring (CyberPower optimized)
|
|
# Use with: packages: !include configs/extended_sensors.yaml
|
|
|
|
sensor:
|
|
# Advanced battery metrics
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "Battery Voltage"
|
|
id: battery_voltage
|
|
type: battery_voltage
|
|
unit_of_measurement: "V"
|
|
device_class: voltage
|
|
state_class: measurement
|
|
accuracy_decimals: 1
|
|
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "Battery Voltage Nominal"
|
|
id: battery_voltage_nominal
|
|
type: battery_voltage_nominal
|
|
unit_of_measurement: "V"
|
|
device_class: voltage
|
|
state_class: measurement
|
|
accuracy_decimals: 0
|
|
|
|
# Input power analysis
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "Input Voltage Nominal"
|
|
id: input_voltage_nominal
|
|
type: input_voltage_nominal
|
|
unit_of_measurement: "V"
|
|
device_class: voltage
|
|
state_class: measurement
|
|
accuracy_decimals: 0
|
|
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "Input Transfer Low"
|
|
id: input_transfer_low
|
|
type: input_transfer_low
|
|
unit_of_measurement: "V"
|
|
device_class: voltage
|
|
state_class: measurement
|
|
accuracy_decimals: 0
|
|
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "Input Transfer High"
|
|
id: input_transfer_high
|
|
type: input_transfer_high
|
|
unit_of_measurement: "V"
|
|
device_class: voltage
|
|
state_class: measurement
|
|
accuracy_decimals: 0
|
|
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "Input Frequency"
|
|
id: input_frequency
|
|
type: frequency
|
|
unit_of_measurement: "Hz"
|
|
state_class: measurement
|
|
accuracy_decimals: 1
|
|
|
|
# UPS configuration metrics
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "UPS Real Power Nominal"
|
|
id: ups_realpower_nominal
|
|
type: ups_realpower_nominal
|
|
unit_of_measurement: "W"
|
|
device_class: power
|
|
state_class: measurement
|
|
accuracy_decimals: 0
|
|
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "UPS Delay Shutdown"
|
|
id: ups_delay_shutdown
|
|
type: ups_delay_shutdown
|
|
unit_of_measurement: "s"
|
|
device_class: duration
|
|
state_class: measurement
|
|
accuracy_decimals: 0
|
|
|
|
- platform: ups_hid
|
|
ups_hid_id: ups_monitor
|
|
name: "UPS Delay Start"
|
|
id: ups_delay_start
|
|
type: ups_delay_start
|
|
unit_of_measurement: "s"
|
|
device_class: duration
|
|
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"
|
|
id: ups_load_power
|
|
unit_of_measurement: "W"
|
|
device_class: power
|
|
state_class: measurement
|
|
accuracy_decimals: 1
|
|
lambda: |-
|
|
if (!std::isnan(id(load_percentage).state)) {
|
|
float ups_max_power = 700.0; // Default fallback
|
|
|
|
// Use HID nominal power if available
|
|
if (!std::isnan(id(ups_realpower_nominal).state)) {
|
|
ups_max_power = id(ups_realpower_nominal).state;
|
|
}
|
|
|
|
return (ups_max_power * id(load_percentage).state) / 100.0;
|
|
}
|
|
return NAN;
|
|
update_interval: 30s
|
|
|
|
text_sensor:
|
|
# Extended device information
|
|
- 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: "Input Sensitivity"
|
|
id: 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" |