You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
355 lines
16 KiB
355 lines
16 KiB
######################################################################
|
|
# @CCOSTAN - Follow Me on X
|
|
# For more info visit https://www.vcloudinfo.com/click-here
|
|
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
|
|
# -------------------------------------------------------------------
|
|
# Infrastructure Partial - Joanna Activity
|
|
# Latest 12 dispatches from BearClaw's rolling 24-hour runtime history.
|
|
# -------------------------------------------------------------------
|
|
# Notes: Rows intentionally read the dispatchActivity status attribute so the count and detail share one source of truth.
|
|
######################################################################
|
|
|
|
# -------------------------------------------------------------------
|
|
# Dispatch summary
|
|
# -------------------------------------------------------------------
|
|
- type: grid
|
|
column_span: 4
|
|
columns: 1
|
|
square: false
|
|
cards:
|
|
- type: custom:layout-card
|
|
grid_options:
|
|
columns: full
|
|
layout_type: custom:grid-layout
|
|
layout:
|
|
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(2, minmax(0, 1fr))
|
|
cards:
|
|
- type: custom:button-card
|
|
template: bearstone_infra_kpi
|
|
entity: sensor.joanna_all_dispatches_24h
|
|
name: All Jobs · 24H
|
|
icon: mdi:robot
|
|
|
|
- type: custom:button-card
|
|
template: bearstone_infra_kpi
|
|
entity: sensor.joanna_ha_dispatches_24h
|
|
name: HA Jobs · 24H
|
|
icon: mdi:home-automation
|
|
|
|
- type: custom:button-card
|
|
template: bearstone_infra_kpi
|
|
entity: sensor.joanna_queue_pending
|
|
name: Queue
|
|
icon: mdi:playlist-clock
|
|
|
|
- type: custom:button-card
|
|
template: bearstone_infra_status_kpi
|
|
entity: sensor.joanna_ha_errors_24h
|
|
name: HA Errors · 24H
|
|
icon: mdi:alert-circle-outline
|
|
variables:
|
|
ok_state: '0'
|
|
healthy_text: NONE
|
|
raw_suffix: ERRORS
|
|
|
|
# -------------------------------------------------------------------
|
|
# Recent dispatches
|
|
# -------------------------------------------------------------------
|
|
- type: grid
|
|
column_span: 4
|
|
columns: 1
|
|
square: false
|
|
cards:
|
|
- type: custom:layout-card
|
|
grid_options:
|
|
columns: full
|
|
layout_type: custom:grid-layout
|
|
layout:
|
|
grid-template-columns: repeat(2, 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))
|
|
cards:
|
|
- 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
|
|
name: Most Recent Dispatches
|
|
|
|
- type: custom:button-card
|
|
template: bearstone_infra_list_row
|
|
entity: sensor.bearclaw_status_telemetry
|
|
icon: mdi:robot-outline
|
|
variables:
|
|
activity_index: 0
|
|
name: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'No dispatches in 24 hours';
|
|
return String(item.source || 'unknown')
|
|
.replace(/^home_assistant_automation\./, 'HA · ')
|
|
.replace(/^scheduler_/, 'Scheduled · ')
|
|
.replace(/^manual_/, 'Manual · ')
|
|
.replaceAll('_', ' ');
|
|
]]]
|
|
state_display: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'NO ACTIVITY';
|
|
const state = String(item.state || 'queued').replaceAll('_', ' ').toUpperCase();
|
|
const when = item.dispatchedAt ? new Date(item.dispatchedAt).toLocaleString('en-US', { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) : 'N/A';
|
|
return `${state} · ${when}`;
|
|
]]]
|
|
|
|
- type: custom:button-card
|
|
template: bearstone_infra_list_row
|
|
entity: sensor.bearclaw_status_telemetry
|
|
icon: mdi:robot-outline
|
|
variables:
|
|
activity_index: 1
|
|
name: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'No additional dispatches';
|
|
return String(item.source || 'unknown').replace(/^home_assistant_automation\./, 'HA · ').replace(/^scheduler_/, 'Scheduled · ').replace(/^manual_/, 'Manual · ').replaceAll('_', ' ');
|
|
]]]
|
|
state_display: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'NO ACTIVITY';
|
|
const state = String(item.state || 'queued').replaceAll('_', ' ').toUpperCase();
|
|
const when = item.dispatchedAt ? new Date(item.dispatchedAt).toLocaleString('en-US', { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) : 'N/A';
|
|
return `${state} · ${when}`;
|
|
]]]
|
|
|
|
- type: custom:button-card
|
|
template: bearstone_infra_list_row
|
|
entity: sensor.bearclaw_status_telemetry
|
|
icon: mdi:robot-outline
|
|
variables:
|
|
activity_index: 2
|
|
name: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'No additional dispatches';
|
|
return String(item.source || 'unknown').replace(/^home_assistant_automation\./, 'HA · ').replace(/^scheduler_/, 'Scheduled · ').replace(/^manual_/, 'Manual · ').replaceAll('_', ' ');
|
|
]]]
|
|
state_display: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'NO ACTIVITY';
|
|
const state = String(item.state || 'queued').replaceAll('_', ' ').toUpperCase();
|
|
const when = item.dispatchedAt ? new Date(item.dispatchedAt).toLocaleString('en-US', { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) : 'N/A';
|
|
return `${state} · ${when}`;
|
|
]]]
|
|
|
|
- type: custom:button-card
|
|
template: bearstone_infra_list_row
|
|
entity: sensor.bearclaw_status_telemetry
|
|
icon: mdi:robot-outline
|
|
variables:
|
|
activity_index: 3
|
|
name: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'No additional dispatches';
|
|
return String(item.source || 'unknown').replace(/^home_assistant_automation\./, 'HA · ').replace(/^scheduler_/, 'Scheduled · ').replace(/^manual_/, 'Manual · ').replaceAll('_', ' ');
|
|
]]]
|
|
state_display: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'NO ACTIVITY';
|
|
const state = String(item.state || 'queued').replaceAll('_', ' ').toUpperCase();
|
|
const when = item.dispatchedAt ? new Date(item.dispatchedAt).toLocaleString('en-US', { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) : 'N/A';
|
|
return `${state} · ${when}`;
|
|
]]]
|
|
|
|
- type: custom:button-card
|
|
template: bearstone_infra_list_row
|
|
entity: sensor.bearclaw_status_telemetry
|
|
icon: mdi:robot-outline
|
|
variables:
|
|
activity_index: 4
|
|
name: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'No additional dispatches';
|
|
return String(item.source || 'unknown').replace(/^home_assistant_automation\./, 'HA · ').replace(/^scheduler_/, 'Scheduled · ').replace(/^manual_/, 'Manual · ').replaceAll('_', ' ');
|
|
]]]
|
|
state_display: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'NO ACTIVITY';
|
|
const state = String(item.state || 'queued').replaceAll('_', ' ').toUpperCase();
|
|
const when = item.dispatchedAt ? new Date(item.dispatchedAt).toLocaleString('en-US', { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) : 'N/A';
|
|
return `${state} · ${when}`;
|
|
]]]
|
|
|
|
- type: custom:button-card
|
|
template: bearstone_infra_list_row
|
|
entity: sensor.bearclaw_status_telemetry
|
|
icon: mdi:robot-outline
|
|
variables:
|
|
activity_index: 5
|
|
name: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'No additional dispatches';
|
|
return String(item.source || 'unknown').replace(/^home_assistant_automation\./, 'HA · ').replace(/^scheduler_/, 'Scheduled · ').replace(/^manual_/, 'Manual · ').replaceAll('_', ' ');
|
|
]]]
|
|
state_display: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'NO ACTIVITY';
|
|
const state = String(item.state || 'queued').replaceAll('_', ' ').toUpperCase();
|
|
const when = item.dispatchedAt ? new Date(item.dispatchedAt).toLocaleString('en-US', { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) : 'N/A';
|
|
return `${state} · ${when}`;
|
|
]]]
|
|
|
|
- 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
|
|
name: Earlier Today
|
|
|
|
- type: custom:button-card
|
|
template: bearstone_infra_list_row
|
|
entity: sensor.bearclaw_status_telemetry
|
|
icon: mdi:robot-outline
|
|
variables:
|
|
activity_index: 6
|
|
name: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'No additional dispatches';
|
|
return String(item.source || 'unknown').replace(/^home_assistant_automation\./, 'HA · ').replace(/^scheduler_/, 'Scheduled · ').replace(/^manual_/, 'Manual · ').replaceAll('_', ' ');
|
|
]]]
|
|
state_display: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'NO ACTIVITY';
|
|
const state = String(item.state || 'queued').replaceAll('_', ' ').toUpperCase();
|
|
const when = item.dispatchedAt ? new Date(item.dispatchedAt).toLocaleString('en-US', { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) : 'N/A';
|
|
return `${state} · ${when}`;
|
|
]]]
|
|
|
|
- type: custom:button-card
|
|
template: bearstone_infra_list_row
|
|
entity: sensor.bearclaw_status_telemetry
|
|
icon: mdi:robot-outline
|
|
variables:
|
|
activity_index: 7
|
|
name: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'No additional dispatches';
|
|
return String(item.source || 'unknown').replace(/^home_assistant_automation\./, 'HA · ').replace(/^scheduler_/, 'Scheduled · ').replace(/^manual_/, 'Manual · ').replaceAll('_', ' ');
|
|
]]]
|
|
state_display: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'NO ACTIVITY';
|
|
const state = String(item.state || 'queued').replaceAll('_', ' ').toUpperCase();
|
|
const when = item.dispatchedAt ? new Date(item.dispatchedAt).toLocaleString('en-US', { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) : 'N/A';
|
|
return `${state} · ${when}`;
|
|
]]]
|
|
|
|
- type: custom:button-card
|
|
template: bearstone_infra_list_row
|
|
entity: sensor.bearclaw_status_telemetry
|
|
icon: mdi:robot-outline
|
|
variables:
|
|
activity_index: 8
|
|
name: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'No additional dispatches';
|
|
return String(item.source || 'unknown').replace(/^home_assistant_automation\./, 'HA · ').replace(/^scheduler_/, 'Scheduled · ').replace(/^manual_/, 'Manual · ').replaceAll('_', ' ');
|
|
]]]
|
|
state_display: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'NO ACTIVITY';
|
|
const state = String(item.state || 'queued').replaceAll('_', ' ').toUpperCase();
|
|
const when = item.dispatchedAt ? new Date(item.dispatchedAt).toLocaleString('en-US', { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) : 'N/A';
|
|
return `${state} · ${when}`;
|
|
]]]
|
|
|
|
- type: custom:button-card
|
|
template: bearstone_infra_list_row
|
|
entity: sensor.bearclaw_status_telemetry
|
|
icon: mdi:robot-outline
|
|
variables:
|
|
activity_index: 9
|
|
name: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'No additional dispatches';
|
|
return String(item.source || 'unknown').replace(/^home_assistant_automation\./, 'HA · ').replace(/^scheduler_/, 'Scheduled · ').replace(/^manual_/, 'Manual · ').replaceAll('_', ' ');
|
|
]]]
|
|
state_display: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'NO ACTIVITY';
|
|
const state = String(item.state || 'queued').replaceAll('_', ' ').toUpperCase();
|
|
const when = item.dispatchedAt ? new Date(item.dispatchedAt).toLocaleString('en-US', { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) : 'N/A';
|
|
return `${state} · ${when}`;
|
|
]]]
|
|
|
|
- type: custom:button-card
|
|
template: bearstone_infra_list_row
|
|
entity: sensor.bearclaw_status_telemetry
|
|
icon: mdi:robot-outline
|
|
variables:
|
|
activity_index: 10
|
|
name: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'No additional dispatches';
|
|
return String(item.source || 'unknown').replace(/^home_assistant_automation\./, 'HA · ').replace(/^scheduler_/, 'Scheduled · ').replace(/^manual_/, 'Manual · ').replaceAll('_', ' ');
|
|
]]]
|
|
state_display: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'NO ACTIVITY';
|
|
const state = String(item.state || 'queued').replaceAll('_', ' ').toUpperCase();
|
|
const when = item.dispatchedAt ? new Date(item.dispatchedAt).toLocaleString('en-US', { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) : 'N/A';
|
|
return `${state} · ${when}`;
|
|
]]]
|
|
|
|
- type: custom:button-card
|
|
template: bearstone_infra_list_row
|
|
entity: sensor.bearclaw_status_telemetry
|
|
icon: mdi:robot-outline
|
|
variables:
|
|
activity_index: 11
|
|
name: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'No additional dispatches';
|
|
return String(item.source || 'unknown').replace(/^home_assistant_automation\./, 'HA · ').replace(/^scheduler_/, 'Scheduled · ').replace(/^manual_/, 'Manual · ').replaceAll('_', ' ');
|
|
]]]
|
|
state_display: >
|
|
[[[
|
|
const item = entity?.attributes?.dispatchActivity?.items?.[variables?.activity_index];
|
|
if (!item) return 'NO ACTIVITY';
|
|
const state = String(item.state || 'queued').replaceAll('_', ' ').toUpperCase();
|
|
const when = item.dispatchedAt ? new Date(item.dispatchedAt).toLocaleString('en-US', { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) : 'N/A';
|
|
return `${state} · ${when}`;
|
|
]]]
|