|
| 1 | +###################################################################### |
| 2 | +# @CCOSTAN - Follow Me on X |
| 3 | +# For more info visit https://www.vcloudinfo.com/click-here |
| 4 | +# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig |
| 5 | +# ------------------------------------------------------------------- |
| 6 | +# Infrastructure Partial - Joanna sections |
| 7 | +# Joanna/BearClaw dispatch KPI, trend, latest-state, and filtered activity panels. |
| 8 | +# ------------------------------------------------------------------- |
| 9 | +# Notes: Reuses shared bearstone_infra_* templates and standard infra card_mod snippets. |
| 10 | +###################################################################### |
| 11 | + |
| 12 | +- type: grid |
| 13 | + column_span: 4 |
| 14 | + columns: 6 |
| 15 | + square: false |
| 16 | + cards: |
| 17 | + - type: custom:button-card |
| 18 | + template: bearstone_infra_kpi |
| 19 | + entity: sensor.joanna_ha_dispatches_24h |
| 20 | + name: HA 24H |
| 21 | + icon: mdi:calendar-clock |
| 22 | + - type: custom:button-card |
| 23 | + template: bearstone_infra_kpi |
| 24 | + entity: sensor.joanna_ha_dispatches_7d |
| 25 | + name: HA 7D |
| 26 | + icon: mdi:calendar-range |
| 27 | + - type: custom:button-card |
| 28 | + template: bearstone_infra_kpi |
| 29 | + entity: sensor.joanna_ha_dispatches_30d |
| 30 | + name: HA 30D |
| 31 | + icon: mdi:calendar-month |
| 32 | + - type: custom:button-card |
| 33 | + template: bearstone_infra_kpi |
| 34 | + entity: sensor.joanna_ha_errors_24h |
| 35 | + name: HA Errors 24H |
| 36 | + icon: mdi:alert-circle-outline |
| 37 | + - type: custom:button-card |
| 38 | + template: bearstone_infra_kpi |
| 39 | + entity: sensor.joanna_all_dispatches_24h |
| 40 | + name: All 24H |
| 41 | + icon: mdi:calendar-clock |
| 42 | + - type: custom:button-card |
| 43 | + template: bearstone_infra_kpi |
| 44 | + entity: sensor.joanna_all_dispatches_7d |
| 45 | + name: All 7D |
| 46 | + icon: mdi:calendar-range |
| 47 | + - type: custom:button-card |
| 48 | + template: bearstone_infra_kpi |
| 49 | + entity: sensor.joanna_all_dispatches_30d |
| 50 | + name: All 30D |
| 51 | + icon: mdi:calendar-month |
| 52 | + |
| 53 | +- type: grid |
| 54 | + column_span: 4 |
| 55 | + columns: 2 |
| 56 | + square: false |
| 57 | + cards: |
| 58 | + - type: custom:vertical-stack-in-card |
| 59 | + card_mod: |
| 60 | + style: !include /config/dashboards/infrastructure/card_mod/infra_panel.yaml |
| 61 | + cards: |
| 62 | + - type: custom:button-card |
| 63 | + template: bearstone_infra_panel_header |
| 64 | + name: HA Dispatch Trend |
| 65 | + - type: custom:mini-graph-card |
| 66 | + name: HA Dispatches (24h Window) |
| 67 | + icon: mdi:chart-timeline-variant |
| 68 | + hours_to_show: 168 |
| 69 | + points_per_hour: 1 |
| 70 | + line_width: 2 |
| 71 | + smoothing: true |
| 72 | + show: |
| 73 | + legend: false |
| 74 | + labels: false |
| 75 | + name: true |
| 76 | + icon: true |
| 77 | + state: true |
| 78 | + entities: |
| 79 | + - entity: sensor.joanna_ha_dispatches_24h |
| 80 | + name: HA 24h |
| 81 | + card_mod: |
| 82 | + style: !include /config/dashboards/infrastructure/card_mod/infra_card.yaml |
| 83 | + |
| 84 | + - type: custom:vertical-stack-in-card |
| 85 | + card_mod: |
| 86 | + style: !include /config/dashboards/infrastructure/card_mod/infra_panel.yaml |
| 87 | + cards: |
| 88 | + - type: custom:button-card |
| 89 | + template: bearstone_infra_panel_header |
| 90 | + name: Latest Snapshot |
| 91 | + - type: custom:button-card |
| 92 | + template: bearstone_infra_list_row |
| 93 | + entity: sensor.bearclaw_status_telemetry |
| 94 | + name: Latest HA Dispatch |
| 95 | + icon: mdi:robot |
| 96 | + state_display: > |
| 97 | + [[[ |
| 98 | + const stats = states['sensor.bearclaw_status_telemetry']?.attributes?.dispatchStats || {}; |
| 99 | + const latest = stats?.latest?.haAutomation || {}; |
| 100 | + const source = latest?.source || 'none'; |
| 101 | + const when = latest?.dispatchedAt || 'n/a'; |
| 102 | + return `${source} | ${when}`; |
| 103 | + ]]] |
| 104 | + - type: custom:button-card |
| 105 | + template: bearstone_infra_list_row |
| 106 | + entity: sensor.bearclaw_status_telemetry |
| 107 | + name: Latest HA Completion |
| 108 | + icon: mdi:check-circle-outline |
| 109 | + state_display: > |
| 110 | + [[[ |
| 111 | + const stats = states['sensor.bearclaw_status_telemetry']?.attributes?.dispatchStats || {}; |
| 112 | + const latest = stats?.latest?.haAutomation || {}; |
| 113 | + const state = latest?.state || 'none'; |
| 114 | + const when = latest?.completedAt || 'n/a'; |
| 115 | + return `${state} | ${when}`; |
| 116 | + ]]] |
| 117 | + - type: custom:button-card |
| 118 | + template: bearstone_infra_list_row |
| 119 | + entity: sensor.bearclaw_status_telemetry |
| 120 | + name: Latest Any Dispatch |
| 121 | + icon: mdi:robot-excited |
| 122 | + state_display: > |
| 123 | + [[[ |
| 124 | + const stats = states['sensor.bearclaw_status_telemetry']?.attributes?.dispatchStats || {}; |
| 125 | + const latest = stats?.latest?.all || {}; |
| 126 | + const source = latest?.source || 'none'; |
| 127 | + const when = latest?.dispatchedAt || 'n/a'; |
| 128 | + return `${source} | ${when}`; |
| 129 | + ]]] |
| 130 | + - type: custom:button-card |
| 131 | + template: bearstone_infra_list_row |
| 132 | + entity: sensor.bearclaw_status_telemetry |
| 133 | + name: HA Success (24h) |
| 134 | + icon: mdi:percent-circle |
| 135 | + state_display: > |
| 136 | + [[[ |
| 137 | + const v = states['sensor.joanna_ha_success_rate_24h']?.state ?? '0'; |
| 138 | + return `${v}%`; |
| 139 | + ]]] |
| 140 | +
|
| 141 | +- type: grid |
| 142 | + column_span: 4 |
| 143 | + columns: 1 |
| 144 | + square: false |
| 145 | + cards: |
| 146 | + - type: custom:layout-card |
| 147 | + grid_options: |
| 148 | + columns: full |
| 149 | + layout_type: custom:grid-layout |
| 150 | + layout: |
| 151 | + grid-template-columns: repeat(1, minmax(0, 1fr)) |
| 152 | + grid-auto-flow: row |
| 153 | + grid-auto-rows: min-content |
| 154 | + grid-gap: 12px |
| 155 | + margin: 0 |
| 156 | + cards: |
| 157 | + - type: custom:vertical-stack-in-card |
| 158 | + grid_options: |
| 159 | + columns: full |
| 160 | + card_mod: |
| 161 | + style: !include /config/dashboards/infrastructure/card_mod/infra_panel.yaml |
| 162 | + cards: |
| 163 | + - type: custom:button-card |
| 164 | + template: bearstone_infra_panel_header |
| 165 | + name: Joanna Activity |
| 166 | + # Fallback card: Lovelace logbook card is required to show filtered activity history. |
| 167 | + - type: logbook |
| 168 | + hours_to_show: 72 |
| 169 | + entities: |
| 170 | + - automation.bearclaw_reply_webhook |
| 171 | + - automation.tugtainer_dispatch_joanna_for_available_updates |
| 172 | + - script.joanna_dispatch |
0 commit comments