Skip to content

Commit 7908ee7

Browse files
committed
Enhance Home Assistant configuration and dashboards
- Updated configuration.yaml to include trusted users for network authentication. - Added BearClaw status telemetry sensor and related KPI sensors in bearclaw.yaml for improved monitoring. - Enhanced infrastructure dashboard with a new Joanna Dispatch button card for telemetry display. - Updated README.md to reflect new BearClaw telemetry features and sensor integrations.
1 parent e1528c3 commit 7908ee7

9 files changed

Lines changed: 354 additions & 6 deletions

File tree

config/configuration.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@ homeassistant:
1515
initial_state: 'on'
1616
packages: !include_dir_named packages
1717
auth_providers:
18-
- type: homeassistant
1918
- type: trusted_networks
2019
trusted_networks:
2120
- 192.168.10.0/24
2221
# - !secret external_ip
22+
trusted_users:
23+
192.168.10.17: be280a93c9d7416e98d25d0470f414be
24+
192.168.10.88: be280a93c9d7416e98d25d0470f414be
2325
allow_bypass_login: true
26+
- type: homeassistant
2427

2528
default_config:
2629

config/dashboards/infrastructure/dashboard.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# YAML-exported Lovelace dashboard (split into view files).
88
# -------------------------------------------------------------------
99
# Notes: Entry point for dashboard key `dashboard-infrastructure`. Views are loaded from /config/dashboards/infrastructure/views.
10+
# Notes: Joanna dispatch telemetry view is available at `/dashboard-infrastructure/joanna`.
1011
######################################################################
1112

1213
button_card_templates: !include /config/dashboards/infrastructure/templates/button_card_templates.yaml

config/dashboards/infrastructure/partials/home_sections.yaml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,22 @@
4040
cards:
4141
- type: custom:button-card
4242
template: bearstone_infra_panel_header
43-
name: Alerts
43+
name: Infrastructure Status
44+
- type: custom:button-card
45+
template: bearstone_infra_list_row
46+
entity: sensor.joanna_ha_dispatches_24h
47+
name: Joanna Dispatch
48+
icon: mdi:robot
49+
tap_action:
50+
action: navigate
51+
navigation_path: /dashboard-infrastructure/joanna
52+
state_display: >
53+
[[[
54+
const ha24 = states['sensor.joanna_ha_dispatches_24h']?.state ?? '0';
55+
const all24 = states['sensor.joanna_all_dispatches_24h']?.state ?? '0';
56+
const queue = states['sensor.joanna_queue_pending']?.state ?? '0';
57+
return `HA ${ha24} | All ${all24} | Q ${queue}`;
58+
]]]
4459
4560
- type: custom:button-card
4661
template: bearstone_infra_list_row
@@ -503,7 +518,7 @@
503518
name: UPS Battery
504519
icon: mdi:battery-70
505520
state_display: >
506-
[[[
521+
[[[
507522
const v = Number(entity?.state);
508523
return Number.isFinite(v) ? `${v.toFixed(0)}%` : (entity?.state ?? 'unknown');
509524
]]]
@@ -514,7 +529,7 @@
514529
name: Runtime Remaining
515530
icon: mdi:timer-outline
516531
state_display: >
517-
[[[
532+
[[[
518533
const secs = parseInt(entity?.state, 10);
519534
if (!Number.isFinite(secs)) return entity?.state ?? 'unknown';
520535
const hours = Math.floor(secs / 3600);
@@ -528,7 +543,7 @@
528543
name: On Battery
529544
icon: mdi:battery-alert-variant-outline
530545
state_display: >
531-
[[[
546+
[[[
532547
const s = String(entity?.state || '').toUpperCase();
533548
return s.includes('OB') ? 'Yes' : 'No';
534549
]]]
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
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
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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 View - Joanna
7+
# Dispatch and activity telemetry for BearClaw/Joanna.
8+
# -------------------------------------------------------------------
9+
# Notes: Uses telemetry from /api/bearclaw/status ingested by bearclaw.yaml.
10+
######################################################################
11+
12+
type: sections
13+
title: Joanna
14+
path: joanna
15+
max_columns: 4
16+
icon: mdi:robot
17+
theme: default
18+
badges: []
19+
sections: !include /config/dashboards/infrastructure/partials/joanna_sections.yaml
20+
cards: []

config/packages/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Live collection of plug-and-play Home Assistant packages. Each YAML file in this
5252
| [mqtt_status.yaml](mqtt_status.yaml) | Command-line MQTT broker reachability probe with Spook Repairs escalation and Joanna troubleshooting dispatch on outage. | `binary_sensor.mqtt_status_raw`, `binary_sensor.mqtt_broker_problem`, `repairs.create`, `rest_command.bearclaw_command` |
5353
| [mariadb.yaml](mariadb.yaml) | MariaDB recorder health and capacity SQL sensors. | `sensor.mariadb_status`, `sensor.database_size` |
5454
| [tugtainer_updates.yaml](tugtainer_updates.yaml) | Tugtainer container update notifications via webhook + persistent alerts, plus event-based Joanna dispatch when reports include `### Available:` (24h cooldown via `mode: single` + delay, no new helpers). | `persistent_notification.create`, `event: tugtainer_available_detected`, `script.joanna_dispatch`, `input_datetime.tugtainer_last_update` |
55-
| [bearclaw.yaml](bearclaw.yaml) | Joanna/BearClaw bridge automations that forward Telegram commands to codex_appliance, relay replies back, and write JOANNA webhook reply summaries to Activity feed. | `rest_command.bearclaw_*`, `automation.bearclaw_*`, `script.send_to_logbook`, webhook relay |
55+
| [bearclaw.yaml](bearclaw.yaml) | Joanna/BearClaw bridge automations that forward Telegram commands to codex_appliance, relay replies back, ingest `/api/bearclaw/status` telemetry, and expose dispatch KPI sensors for Infrastructure dashboards. | `rest_command.bearclaw_*`, `sensor.bearclaw_status_telemetry`, `sensor.joanna_*`, `automation.bearclaw_*`, `script.send_to_logbook` |
5656
| [telegram_bot.yaml](telegram_bot.yaml) | Telegram script wrappers used by BearClaw and other ops flows (UI integration remains the source for bot config). | `script.joanna_send_telegram`, `telegram_bot.send_message` |
5757
| [phynplus.yaml](phynplus.yaml) | Phyn shutoff automations with push + Activity feed + Repairs issues for leak events. | `valve.phyn_shutoff_valve`, `binary_sensor.phyn_leak_test_running`, `repairs.create` |
5858
| [water_delivery.yaml](water_delivery.yaml) | ReadyRefresh delivery date helper with night-before + garage door Alexa reminders, plus helper-change audit logging and Telegram confirmations. | `input_datetime.water_delivery_date`, `script.send_to_logbook`, `script.joanna_send_telegram`, `notify.alexa_media_garage` |

0 commit comments

Comments
 (0)