|
|
|
|
@ -4,7 +4,8 @@
|
|
|
|
|
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
|
|
|
|
|
# -------------------------------------------------------------------
|
|
|
|
|
# Infrastructure Partial - UPS Power
|
|
|
|
|
# Garage and Office NUT status with current readings and trends.
|
|
|
|
|
# Related Issue: 1936
|
|
|
|
|
# Garage and both Office NUT devices with current readings and trends.
|
|
|
|
|
# -------------------------------------------------------------------
|
|
|
|
|
# Notes: Raw NUT status data drives the shared on-battery rollup.
|
|
|
|
|
# Notes: All graphs use 24-hour windows and explicit threshold colors.
|
|
|
|
|
@ -23,14 +24,14 @@
|
|
|
|
|
columns: full
|
|
|
|
|
layout_type: custom:grid-layout
|
|
|
|
|
layout:
|
|
|
|
|
grid-template-columns: repeat(3, minmax(0, 1fr))
|
|
|
|
|
grid-template-columns: repeat(4, minmax(0, 1fr))
|
|
|
|
|
grid-auto-flow: row
|
|
|
|
|
grid-auto-rows: min-content
|
|
|
|
|
grid-gap: 12px
|
|
|
|
|
margin: 0
|
|
|
|
|
mediaquery:
|
|
|
|
|
"(max-width: 900px)":
|
|
|
|
|
grid-template-columns: repeat(1, minmax(0, 1fr))
|
|
|
|
|
grid-template-columns: repeat(2, minmax(0, 1fr))
|
|
|
|
|
cards:
|
|
|
|
|
- type: custom:button-card
|
|
|
|
|
template: bearstone_nav_back
|
|
|
|
|
@ -62,6 +63,16 @@
|
|
|
|
|
healthy_text: ONLINE
|
|
|
|
|
alert_text: CHECK
|
|
|
|
|
|
|
|
|
|
- type: custom:button-card
|
|
|
|
|
template: bearstone_infra_status_kpi
|
|
|
|
|
entity: sensor.office_ups_cyberpower_status
|
|
|
|
|
name: Office CyberPower ST Series
|
|
|
|
|
icon: mdi:battery-heart-variant
|
|
|
|
|
variables:
|
|
|
|
|
ok_state: Online
|
|
|
|
|
healthy_text: ONLINE
|
|
|
|
|
alert_text: CHECK
|
|
|
|
|
|
|
|
|
|
- type: custom:button-card
|
|
|
|
|
template: bearstone_infra_status_kpi
|
|
|
|
|
entity: binary_sensor.infra_ups_on_battery
|
|
|
|
|
@ -85,7 +96,7 @@
|
|
|
|
|
columns: full
|
|
|
|
|
layout_type: custom:grid-layout
|
|
|
|
|
layout:
|
|
|
|
|
grid-template-columns: repeat(2, minmax(0, 1fr))
|
|
|
|
|
grid-template-columns: repeat(3, minmax(0, 1fr))
|
|
|
|
|
grid-auto-flow: row
|
|
|
|
|
grid-auto-rows: min-content
|
|
|
|
|
grid-gap: 12px
|
|
|
|
|
@ -244,6 +255,81 @@
|
|
|
|
|
return Number.isFinite(value) ? `${value.toFixed(0)} V` : 'NO DATA';
|
|
|
|
|
]]]
|
|
|
|
|
|
|
|
|
|
- type: custom:vertical-stack-in-card
|
|
|
|
|
card_mod:
|
|
|
|
|
style: !include /config/dashboards/infrastructure/card_mod/infra_panel.yaml
|
|
|
|
|
cards:
|
|
|
|
|
- type: custom:button-card
|
|
|
|
|
template: bearstone_infra_panel_header_icon
|
|
|
|
|
name: Office CyberPower ST Series
|
|
|
|
|
icon: mdi:battery-heart-variant
|
|
|
|
|
|
|
|
|
|
- type: custom:button-card
|
|
|
|
|
template: bearstone_infra_list_row
|
|
|
|
|
entity: sensor.office_ups_cyberpower_status
|
|
|
|
|
name: Status
|
|
|
|
|
icon: mdi:battery-heart-variant
|
|
|
|
|
state_display: >
|
|
|
|
|
[[[ return String(entity?.state ?? 'NO DATA').toUpperCase(); ]]]
|
|
|
|
|
|
|
|
|
|
- type: custom:button-card
|
|
|
|
|
template: bearstone_infra_list_row
|
|
|
|
|
entity: sensor.office_ups_cyberpower_battery_charge
|
|
|
|
|
name: Battery
|
|
|
|
|
icon: mdi:battery-high
|
|
|
|
|
state_display: >
|
|
|
|
|
[[[
|
|
|
|
|
const value = Number(entity?.state);
|
|
|
|
|
return Number.isFinite(value) ? `${value.toFixed(0)}%` : 'NO DATA';
|
|
|
|
|
]]]
|
|
|
|
|
|
|
|
|
|
- type: custom:button-card
|
|
|
|
|
template: bearstone_infra_list_row
|
|
|
|
|
entity: sensor.office_ups_cyberpower_battery_runtime
|
|
|
|
|
name: Runtime
|
|
|
|
|
icon: mdi:timer-outline
|
|
|
|
|
state_display: >
|
|
|
|
|
[[[
|
|
|
|
|
const seconds = Number(entity?.state);
|
|
|
|
|
if (!Number.isFinite(seconds)) return 'NO DATA';
|
|
|
|
|
const hours = Math.floor(seconds / 3600);
|
|
|
|
|
const minutes = Math.floor((seconds % 3600) / 60);
|
|
|
|
|
return hours > 0 ? `${hours}h ${minutes}m` : `${minutes}m`;
|
|
|
|
|
]]]
|
|
|
|
|
|
|
|
|
|
- type: custom:button-card
|
|
|
|
|
template: bearstone_infra_list_row
|
|
|
|
|
entity: sensor.office_ups_cyberpower_load
|
|
|
|
|
name: Load
|
|
|
|
|
icon: mdi:gauge
|
|
|
|
|
state_display: >
|
|
|
|
|
[[[
|
|
|
|
|
const value = Number(entity?.state);
|
|
|
|
|
return Number.isFinite(value) ? `${value.toFixed(0)}%` : 'NO DATA';
|
|
|
|
|
]]]
|
|
|
|
|
|
|
|
|
|
- type: custom:button-card
|
|
|
|
|
template: bearstone_infra_list_row
|
|
|
|
|
entity: sensor.office_ups_cyberpower_input_voltage
|
|
|
|
|
name: Input Voltage
|
|
|
|
|
icon: mdi:sine-wave
|
|
|
|
|
state_display: >
|
|
|
|
|
[[[
|
|
|
|
|
const value = Number(entity?.state);
|
|
|
|
|
return Number.isFinite(value) ? `${value.toFixed(0)} V` : 'NO DATA';
|
|
|
|
|
]]]
|
|
|
|
|
|
|
|
|
|
- type: custom:button-card
|
|
|
|
|
template: bearstone_infra_list_row
|
|
|
|
|
entity: sensor.office_ups_cyberpower_output_voltage
|
|
|
|
|
name: Output Voltage
|
|
|
|
|
icon: mdi:flash-outline
|
|
|
|
|
state_display: >
|
|
|
|
|
[[[
|
|
|
|
|
const value = Number(entity?.state);
|
|
|
|
|
return Number.isFinite(value) ? `${value.toFixed(0)} V` : 'NO DATA';
|
|
|
|
|
]]]
|
|
|
|
|
|
|
|
|
|
# -------------------------------------------------------------------
|
|
|
|
|
# Battery and load trends
|
|
|
|
|
# -------------------------------------------------------------------
|
|
|
|
|
@ -257,7 +343,7 @@
|
|
|
|
|
columns: full
|
|
|
|
|
layout_type: custom:grid-layout
|
|
|
|
|
layout:
|
|
|
|
|
grid-template-columns: repeat(4, minmax(0, 1fr))
|
|
|
|
|
grid-template-columns: repeat(3, minmax(0, 1fr))
|
|
|
|
|
grid-auto-flow: row
|
|
|
|
|
grid-auto-rows: min-content
|
|
|
|
|
grid-gap: 12px
|
|
|
|
|
@ -320,6 +406,33 @@
|
|
|
|
|
card_mod:
|
|
|
|
|
style: !include /config/dashboards/infrastructure/card_mod/infra_card.yaml
|
|
|
|
|
|
|
|
|
|
- type: custom:mini-graph-card
|
|
|
|
|
name: Office CyberPower Battery
|
|
|
|
|
icon: mdi:battery-high
|
|
|
|
|
hours_to_show: 24
|
|
|
|
|
points_per_hour: 2
|
|
|
|
|
line_width: 2
|
|
|
|
|
smoothing: true
|
|
|
|
|
height: 80
|
|
|
|
|
show:
|
|
|
|
|
legend: false
|
|
|
|
|
labels: false
|
|
|
|
|
name: true
|
|
|
|
|
icon: true
|
|
|
|
|
state: true
|
|
|
|
|
color_thresholds:
|
|
|
|
|
- value: 0
|
|
|
|
|
color: '#c0392b'
|
|
|
|
|
- value: 20
|
|
|
|
|
color: '#f39c12'
|
|
|
|
|
- value: 50
|
|
|
|
|
color: '#43a047'
|
|
|
|
|
entities:
|
|
|
|
|
- entity: sensor.office_ups_cyberpower_battery_charge
|
|
|
|
|
name: Battery
|
|
|
|
|
card_mod:
|
|
|
|
|
style: !include /config/dashboards/infrastructure/card_mod/infra_card.yaml
|
|
|
|
|
|
|
|
|
|
- type: custom:mini-graph-card
|
|
|
|
|
name: Garage Load
|
|
|
|
|
icon: mdi:gauge
|
|
|
|
|
@ -374,6 +487,33 @@
|
|
|
|
|
card_mod:
|
|
|
|
|
style: !include /config/dashboards/infrastructure/card_mod/infra_card.yaml
|
|
|
|
|
|
|
|
|
|
- type: custom:mini-graph-card
|
|
|
|
|
name: Office CyberPower Load
|
|
|
|
|
icon: mdi:gauge
|
|
|
|
|
hours_to_show: 24
|
|
|
|
|
points_per_hour: 2
|
|
|
|
|
line_width: 2
|
|
|
|
|
smoothing: true
|
|
|
|
|
height: 80
|
|
|
|
|
show:
|
|
|
|
|
legend: false
|
|
|
|
|
labels: false
|
|
|
|
|
name: true
|
|
|
|
|
icon: true
|
|
|
|
|
state: true
|
|
|
|
|
color_thresholds:
|
|
|
|
|
- value: 0
|
|
|
|
|
color: '#43a047'
|
|
|
|
|
- value: 60
|
|
|
|
|
color: '#f39c12'
|
|
|
|
|
- value: 85
|
|
|
|
|
color: '#c0392b'
|
|
|
|
|
entities:
|
|
|
|
|
- entity: sensor.office_ups_cyberpower_load
|
|
|
|
|
name: Load
|
|
|
|
|
card_mod:
|
|
|
|
|
style: !include /config/dashboards/infrastructure/card_mod/infra_card.yaml
|
|
|
|
|
|
|
|
|
|
# -------------------------------------------------------------------
|
|
|
|
|
# Home Assistant power resilience dry run
|
|
|
|
|
# -------------------------------------------------------------------
|
|
|
|
|
|