Expose BearClaw runtime health on infrastructure dashboards

master
Carlo Costanzo 1 month ago
parent 59f35d2754
commit 0d8350e413

@ -13,6 +13,7 @@
# Notes: Power & Solar shows realtime flow; accumulated history remains in Energy.
# Notes: Scheduled Proxmox maintenance and sustained WAN quality/reset warnings render amber; critical conditions remain red.
# Notes: Active Issue rows enumerate faults, scheduled maintenance, and reset urgency so drill-down is optional for initial triage.
# Notes: BearClaw scheduled-job warnings/errors roll up under Joanna and appear as an exceptions-only Active Issue row.
# Notes: Home Water and Systems surface normalized Rheem faults; telemetry-only loss renders amber.
# Notes: Back to Overview is the first control in the landing-view navigation strip.
######################################################################
@ -186,12 +187,15 @@
- type: custom:button-card
template: bearstone_infra_status_kpi
entity: sensor.bearclaw_status_telemetry
entity: sensor.bearclaw_scheduled_job_health
name: Joanna
icon: mdi:robot-outline
variables:
ok_state: ok
warning_state: warning
healthy_text: HEALTHY
warning_text: JOB WARNING
critical_text: JOB ERROR
tap_action:
action: navigate
navigation_path: /dashboard-infrastructure/joanna
@ -339,6 +343,24 @@
action: navigate
navigation_path: /dashboard-infrastructure/kiosks
- type: custom:button-card
template: bearstone_infra_alert_row
entity: sensor.bearclaw_scheduled_job_health
name: BearClaw scheduled job needs attention
icon: mdi:calendar-alert
variables:
alert_kind: state_not
ok_state: ok
alert_severity: >
[[[ return entity?.state === 'warning' ? 'warning' : 'critical'; ]]]
exception_detail: >
[[[ return String(entity?.attributes?.summary ?? 'SCHEDULED JOB STATUS REQUIRES REVIEW').toUpperCase(); ]]]
state_display: >
[[[ return entity?.state === 'warning' ? 'WARNING' : 'ERROR'; ]]]
tap_action:
action: navigate
navigation_path: /dashboard-infrastructure/joanna
- type: custom:button-card
template: bearstone_infra_alert_row
entity: binary_sensor.proxmox1_runtime_healthy

@ -4,11 +4,12 @@
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# -------------------------------------------------------------------
# Infrastructure Partial - Joanna
# Focused dispatch health, latest activity, rolling volume, and diagnostics.
# Focused dispatch health, latest activity, runtime issues, and memory-system freshness.
# -------------------------------------------------------------------
# Notes: BearClaw Admin provides the detailed runtime drill-down while this page stays summary-focused.
# Notes: This view changes HA presentation only; BearClaw runtime behavior is untouched.
# Notes: Reset expiry is amber within 7 days and red within 3 days; the four reset slots remain visible.
# Notes: Compact scheduled-job health provides an HA-visible failure summary with Admin as the detailed source of truth.
# Notes: BearClaw working memory and the federated OneNote KB are separate indexes and render separately.
######################################################################
# -------------------------------------------------------------------
@ -63,7 +64,7 @@
raw_suffix: ERRORS
# -------------------------------------------------------------------
# Trend, latest state, and reset summary
# Trend, latest activity, and runtime health
# -------------------------------------------------------------------
- type: grid
column_span: 4
@ -109,16 +110,6 @@
name: HA Dispatches 30D
icon: mdi:calendar-month
- type: custom:button-card
template: bearstone_infra_list_row
entity: sensor.bearclaw_status_telemetry
name: BearClaw Admin
icon: mdi:shield-crown-outline
state_display: OPEN ADMIN
tap_action:
action: url
url_path: http://192.168.10.13:8124/admin
- type: custom:vertical-stack-in-card
card_mod:
style: !include /config/dashboards/infrastructure/card_mod/infra_panel.yaml
@ -165,6 +156,89 @@
name: All Dispatches 30D
icon: mdi:calendar-month
- 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: Runtime & Memory
- type: custom:button-card
template: bearstone_infra_status_kpi
entity: sensor.bearclaw_scheduled_job_health
name: Scheduled Jobs
icon: mdi:calendar-alert
variables:
ok_state: ok
warning_state: warning
healthy_text: HEALTHY
warning_text: JOB WARNING
critical_text: JOB ERROR
state_display: >
[[[
const count = Number.parseInt(entity?.attributes?.issue_count ?? '0', 10);
if (entity?.state === 'ok') return 'HEALTHY';
return `${Number.isFinite(count) ? count : '?'} ${String(entity?.state ?? 'unknown').toUpperCase()}`;
]]]
- type: custom:button-card
template: bearstone_infra_alert_row
entity: sensor.bearclaw_scheduled_job_health
name: >
[[[
const issue = Array.isArray(entity?.attributes?.issues) ? entity.attributes.issues[0] : null;
return issue?.label || 'Scheduled job needs attention';
]]]
icon: mdi:alert-circle-outline
variables:
alert_kind: state_not
ok_state: ok
alert_severity: >
[[[ return entity?.state === 'warning' ? 'warning' : 'critical'; ]]]
exception_detail: >
[[[
const issue = Array.isArray(entity?.attributes?.issues) ? entity.attributes.issues[0] : null;
return String(issue?.detail || entity?.attributes?.summary || 'SCHEDULED JOB STATUS REQUIRES REVIEW').toUpperCase();
]]]
state_display: >
[[[ return entity?.state === 'warning' ? 'WARNING' : 'ERROR'; ]]]
- type: custom:button-card
template: bearstone_infra_status_kpi
entity: sensor.joanna_memory_docs
name: BearClaw Working Memory
icon: mdi:database-search
variables:
status_severity: >
[[[ return states['binary_sensor.joanna_memory_index_stale']?.state === 'on' ? 'critical' : 'healthy'; ]]]
state_display: >
[[[
const docs = entity?.state ?? '0';
const chunks = states['sensor.joanna_memory_chunks']?.state ?? '0';
const status = states['binary_sensor.joanna_memory_index_stale']?.state === 'on' ? 'STALE' : 'CURRENT';
return `${status} · ${docs} DOCS · ${chunks} CHUNKS`;
]]]
- type: custom:button-card
template: bearstone_infra_status_kpi
entity: sensor.joanna_onenote_kb_health
name: Federated OneNote KB
icon: mdi:notebook-multiple
variables:
ok_state: ok
warning_state: warning
healthy_text: CURRENT
warning_text: SYNC STALE
critical_text: INDEX ERROR
state_display: >
[[[
const docs = Number(entity?.attributes?.docs ?? 0).toLocaleString();
const chunks = Number(entity?.attributes?.chunks ?? 0).toLocaleString();
const status = entity?.state === 'ok' ? 'CURRENT' : String(entity?.state ?? 'unknown').toUpperCase();
return `${status} · ${docs} DOCS · ${chunks} CHUNKS`;
]]]
- type: custom:button-card
template: bearstone_infra_list_row
entity: sensor.openai_response
@ -177,13 +251,10 @@
- type: custom:button-card
template: bearstone_infra_list_row
entity: sensor.joanna_memory_docs
name: Memory Index
icon: mdi:database-search
state_display: >
[[[
const docs = entity?.state ?? '0';
const chunks = states['sensor.joanna_memory_chunks']?.state ?? '0';
const stale = states['binary_sensor.joanna_memory_index_stale']?.state === 'on';
return `${docs} docs | ${chunks} chunks${stale ? ' | STALE' : ''}`;
]]]
entity: sensor.bearclaw_status_telemetry
name: BearClaw Admin
icon: mdi:shield-crown-outline
state_display: OPEN ADMIN
tap_action:
action: url
url_path: http://192.168.10.13:8124/admin

@ -65,7 +65,7 @@ Kitchen Show note: `kiosk_tablet.yaml` uses Kiosk Satellite's native ESPHome ent
| [![YAML source: processmonitor](https://img.shields.io/static/v1?label=YAML&message=processmonitor&color=lightgrey&logo=github&logoColor=181717)](processmonitor.yaml) | Root filesystem disk-pressure monitoring with immediate digest/logbook notes at 80%, Joanna review after 10 minutes above 80%, and delayed phone alerts only if the issue stays unresolved after dispatch. | `sensor.disk_use_percent`, `repairs.create`, `script.joanna_dispatch`, `tts.clear_cache` |
| [![YAML source: tugtainer_updates](https://img.shields.io/static/v1?label=YAML&message=tugtainer_updates&color=lightgrey&logo=github&logoColor=181717)](tugtainer_updates.yaml) | Tugtainer container update notifications via webhook + persistent alerts, with immediate Joanna recovery dispatch for `### Failed:` / `### Rolled-back:` reports and every `### Available:` report. Home Assistant core participates in the 07:00 automatic rollout after a mandatory Tugtainer pre-update config check, with HTTP health and image rollback safeguards. Protected Tugtainer control-plane containers are updated one host at a time through their owning Compose stacks; duplicate Portainer image-update entities are auto-disabled because Tugtainer and Compose own rollout decisions. [![Watch on YouTube](https://img.shields.io/badge/Watch-YouTube-FF0000?logo=youtube&logoColor=white)](https://youtu.be/4NNOkXzUyYw) [![vCloudInfo Blog Post](https://img.shields.io/static/v1?label=vCloudInfo&message=Blog%20Post&color=21759B&logo=wordpress&logoColor=white)](https://www.vcloudinfo.com/2026/07/home-assistant-tugtainer-docker-updates.html) | `automation.tugtainer_disable_duplicate_portainer_image_updates`, `persistent_notification.create`, `event: tugtainer_available_detected`, `script.joanna_dispatch`, `input_datetime.tugtainer_last_update` |
| [![YAML source: printer](https://img.shields.io/static/v1?label=YAML&message=printer&color=lightgrey&logo=github&logoColor=181717)](printer.yaml) | Epson ink watchdog with one-day and one-week mobile snooze actions for low-ink reminders. | `input_datetime.printer_ink_snooze_until`, `sensor.epson_*`, mobile app action events |
| [![YAML source: bearclaw](https://img.shields.io/static/v1?label=YAML&message=bearclaw&color=lightgrey&logo=github&logoColor=181717)](bearclaw.yaml) | Joanna/BearClaw bridge automations forward Telegram commands to codex_appliance, include LLM-first routing context for freeform text, relay replies, deliver compact adaptive TeslaMate road-trip milestone, destination-arrival, and final summaries to Carlo and Stacey, emit an active-trip vacation signal, ingest `/api/bearclaw/status` telemetry, and expose dispatch, BearClaw memory-index, user-keyed 7/28/90 step trends, and personal records for Overview Health. Full Joanna reports add directional route comparisons, charging strategy, trip-aware morning context, and a private final route map. Retired QMD telemetry is not imported. Road-trip companion: [![Watch on YouTube](https://img.shields.io/badge/Watch-YouTube-FF0000?logo=youtube&logoColor=white)](https://youtu.be/9-9T6v17NEw) [![vCloudInfo Blog Post](https://img.shields.io/static/v1?label=vCloudInfo&message=Blog%20Post&color=21759B&logo=wordpress&logoColor=white)](https://www.vcloudinfo.com/2026/07/teslamate-road-trip-reports-codex.html). | `rest_command.bearclaw_*`, `event: tesla_road_trip_active`, `sensor.bearclaw_status_telemetry`, `sensor.joanna_*`, `binary_sensor.joanna_*`, `automation.bearclaw_*`, `script.notify_engine`, `script.send_to_logbook` |
| [![YAML source: bearclaw](https://img.shields.io/static/v1?label=YAML&message=bearclaw&color=lightgrey&logo=github&logoColor=181717)](bearclaw.yaml) | Joanna/BearClaw bridge automations forward Telegram commands to codex_appliance, include LLM-first routing context for freeform text, relay replies, deliver compact adaptive TeslaMate road-trip milestone, destination-arrival, and final summaries to Carlo and Stacey, emit an active-trip vacation signal, ingest `/api/bearclaw/status` telemetry, and expose dispatch, distinct BearClaw working-memory and federated OneNote KB health, compact scheduled-job warning/error health for Systems, user-keyed 7/28/90 step trends, and personal records for Overview Health. Full Joanna reports add directional route comparisons, charging strategy, trip-aware morning context, and a private final route map. Retired QMD telemetry is not imported. Road-trip companion: [![Watch on YouTube](https://img.shields.io/badge/Watch-YouTube-FF0000?logo=youtube&logoColor=white)](https://youtu.be/9-9T6v17NEw) [![vCloudInfo Blog Post](https://img.shields.io/static/v1?label=vCloudInfo&message=Blog%20Post&color=21759B&logo=wordpress&logoColor=white)](https://www.vcloudinfo.com/2026/07/teslamate-road-trip-reports-codex.html). | `rest_command.bearclaw_*`, `event: tesla_road_trip_active`, `sensor.bearclaw_status_telemetry`, `sensor.bearclaw_scheduled_job_health`, `sensor.joanna_onenote_kb_health`, `sensor.joanna_*`, `binary_sensor.joanna_*`, `automation.bearclaw_*`, `script.notify_engine`, `script.send_to_logbook` |
| [![YAML source: telegram_bot](https://img.shields.io/static/v1?label=YAML&message=telegram_bot&color=lightgrey&logo=github&logoColor=181717)](telegram_bot.yaml) | Legacy Telegram transport marker for BearClaw; the shared `joanna_send_telegram` helper now forwards through the codex_appliance direct Telegram API. | `rest_command.bearclaw_telegram_send`, `script.joanna_send_telegram` |
| [![YAML source: rheem_econet](https://img.shields.io/static/v1?label=YAML&message=rheem_econet&color=lightgrey&logo=github&logoColor=181717)](rheem_econet.yaml) | Rheem EcoNet water-heater monitoring with normalized alert and telemetry-stale states, event snapshots, persistent Repairs, parent notifications, Joanna diagnostic dispatch, and safe electric-mode enforcement during the current warranty repair. | `binary_sensor.rheem_wh_active_alert`, `binary_sensor.rheem_wh_telemetry_stale`, `binary_sensor.rheem_wh_problem`, `sensor.rheem_wh_diagnostic_status`, `sensor.rheem_wh_last_alert_snapshot`, `repairs.create`, `script.joanna_dispatch` |
| [![YAML source: phynplus](https://img.shields.io/static/v1?label=YAML&message=phynplus&color=lightgrey&logo=github&logoColor=181717)](phynplus.yaml) | Phyn shutoff automations with leak-test guard, Activity Feed context, Repairs tracking, and critical push recovery when the valve closes. [![Watch on YouTube](https://img.shields.io/badge/Watch-YouTube-FF0000?logo=youtube&logoColor=white)](https://youtu.be/xbhgWnomFYI) | `valve.phyn_shutoff_valve`, `binary_sensor.phyn_leak_test_running`, `script.phyn_send_actionable_leak_notification`, `repairs.create` |

@ -17,6 +17,9 @@
# Notes: Progress and destination-arrival callbacks emit tesla_road_trip_active so Vacation Mode can use the signal when the whole family is away.
# Notes: Status telemetry polling expects !secret bearclaw_status_url (token header stays !secret bearclaw_token).
# Notes: Status telemetry includes the latest 12 dispatches in the rolling 24-hour window for the Joanna Activity drill-down.
# Notes: Status telemetry exposes compact scheduled-job warning/error health for the Systems dashboard.
# Notes: Status telemetry distinguishes the compact BearClaw working-memory index from the federated OneNote KB.
# Notes: sensor.joanna_onenote_kb_health marks the federated KB warning after 90 minutes without a successful sync.
# Notes: Status telemetry also exposes compact, user-keyed step trends and personal records for the Health dashboard.
# Notes: Retired QMD health telemetry is no longer imported or materialized in Home Assistant.
# Notes: TeslaMate road-trip walkthrough: https://youtu.be/9-9T6v17NEw
@ -146,10 +149,87 @@ sensor:
- transports
- followups
- memoryIndex
- oneNoteKb
- healthInsights
- scheduledJobsHealth
template:
- sensor:
- name: BearClaw Scheduled Job Health
unique_id: bearclaw_scheduled_job_health
icon: mdi:calendar-alert
availability: >-
{% set health = state_attr('sensor.bearclaw_status_telemetry', 'scheduledJobsHealth') %}
{{ health is mapping and health.get('status') in ['ok', 'warning', 'error'] }}
state: >-
{% set health = state_attr('sensor.bearclaw_status_telemetry', 'scheduledJobsHealth') | default({}, true) %}
{{ health.get('status', 'unknown') }}
attributes:
issue_count: >-
{% set health = state_attr('sensor.bearclaw_status_telemetry', 'scheduledJobsHealth') | default({}, true) %}
{{ health.get('issueCount', 0) | int(0) }}
error_count: >-
{% set health = state_attr('sensor.bearclaw_status_telemetry', 'scheduledJobsHealth') | default({}, true) %}
{{ health.get('errorCount', 0) | int(0) }}
warning_count: >-
{% set health = state_attr('sensor.bearclaw_status_telemetry', 'scheduledJobsHealth') | default({}, true) %}
{{ health.get('warningCount', 0) | int(0) }}
summary: >-
{% set health = state_attr('sensor.bearclaw_status_telemetry', 'scheduledJobsHealth') | default({}, true) %}
{{ health.get('summary', 'Scheduled-job health unavailable') }}
issues: >-
{% set health = state_attr('sensor.bearclaw_status_telemetry', 'scheduledJobsHealth') | default({}, true) %}
{{ health.get('issues', []) }}
generated_at: >-
{% set health = state_attr('sensor.bearclaw_status_telemetry', 'scheduledJobsHealth') | default({}, true) %}
{{ health.get('generatedAt') }}
- name: Joanna OneNote KB Health
unique_id: joanna_onenote_kb_health
icon: mdi:notebook-check-outline
availability: >-
{% set kb = state_attr('sensor.bearclaw_status_telemetry', 'oneNoteKb') %}
{{ kb is mapping }}
state: >-
{% set kb = state_attr('sensor.bearclaw_status_telemetry', 'oneNoteKb') | default({}, true) %}
{% set last_sync_ts = as_timestamp(kb.get('lastSyncAt'), 0) %}
{% set age_minutes = ((as_timestamp(now()) - last_sync_ts) / 60) if last_sync_ts > 0 else 999999 %}
{% if not kb.get('ok', false) or kb.get('lastSyncError') not in [none, ''] or kb.get('lastSchedulerError') not in [none, ''] %}
error
{% elif age_minutes > 90 %}
warning
{% else %}
ok
{% endif %}
attributes:
docs: >-
{% set kb = state_attr('sensor.bearclaw_status_telemetry', 'oneNoteKb') | default({}, true) %}
{{ kb.get('docs', 0) | int(0) }}
chunks: >-
{% set kb = state_attr('sensor.bearclaw_status_telemetry', 'oneNoteKb') | default({}, true) %}
{{ kb.get('chunks', 0) | int(0) }}
last_sync_at: >-
{% set kb = state_attr('sensor.bearclaw_status_telemetry', 'oneNoteKb') | default({}, true) %}
{{ kb.get('lastSyncAt') }}
last_modified_at: >-
{% set kb = state_attr('sensor.bearclaw_status_telemetry', 'oneNoteKb') | default({}, true) %}
{{ kb.get('lastModifiedAt') }}
source_accounts: >-
{% set kb = state_attr('sensor.bearclaw_status_telemetry', 'oneNoteKb') | default({}, true) %}
{{ kb.get('sourceAccounts', []) }}
pending_digest: >-
{% set kb = state_attr('sensor.bearclaw_status_telemetry', 'oneNoteKb') | default({}, true) %}
{{ kb.get('pendingDigest', 0) | int(0) }}
pending_synthesis: >-
{% set kb = state_attr('sensor.bearclaw_status_telemetry', 'oneNoteKb') | default({}, true) %}
{{ kb.get('pendingSynthesisAll', 0) | int(0) }}
carlo_docs: >-
{% set kb = state_attr('sensor.bearclaw_status_telemetry', 'oneNoteKb') | default({}, true) %}
{{ kb.get('sources', {}).get('carlo', {}).get('docs', 0) | int(0) }}
stacey_docs: >-
{% set kb = state_attr('sensor.bearclaw_status_telemetry', 'oneNoteKb') | default({}, true) %}
{{ kb.get('sources', {}).get('stacey', {}).get('docs', 0) | int(0) }}
- name: Joanna HA Dispatches 24h
unique_id: joanna_ha_dispatches_24h
icon: mdi:calendar-clock

@ -28,6 +28,7 @@
# Notes: Garage compute health uses the same 145 F threshold as the existing temperature notification.
# Notes: Immediate website-down states create Repairs; the installed UptimeRobot integration exposes current state, not trend rollups.
# Notes: Dashboard aggregate issue count is live-only; its underlying degraded sensors retain actionable history.
# Notes: Dashboard aggregate issue count includes compact BearClaw scheduled-job warning/error health.
# Notes: Home Water rollup includes Rheem faults/telemetry loss plus active Phyn alerts and valve closure.
######################################################################
@ -241,7 +242,9 @@ template:
'binary_sensor.home_water_problem',
'binary_sensor.kiosk_devices_need_attention'
] %}
{{ expand(categories) | selectattr('state', 'eq', 'on') | list | count }}
{% set category_count = expand(categories) | selectattr('state', 'eq', 'on') | list | count %}
{% set bearclaw_issue = states('sensor.bearclaw_scheduled_job_health') in ['warning', 'error'] %}
{{ category_count + (1 if bearclaw_issue else 0) }}
attributes:
active_entities: >-
{% set categories = [
@ -253,7 +256,11 @@ template:
'binary_sensor.home_water_problem',
'binary_sensor.kiosk_devices_need_attention'
] %}
{{ expand(categories) | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}
{% set active = expand(categories) | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list %}
{% if states('sensor.bearclaw_scheduled_job_health') in ['warning', 'error'] %}
{% set active = active + ['sensor.bearclaw_scheduled_job_health'] %}
{% endif %}
{{ active }}
- binary_sensor:
- name: "Home Water Problem"

Loading…
Cancel
Save

Powered by TurnKey Linux.