Move recent personal records into kiosk rotations

master
Carlo Costanzo 2 months ago
parent 6783da74c7
commit 3d7a18160f

@ -65,10 +65,10 @@ The Camera tab keeps the doorbell and pool on the left, three exterior cameras a
- Bedroom landscape view: [![YAML source: 01_home](https://img.shields.io/static/v1?label=YAML&message=01_home&color=lightgrey&logo=github&logoColor=181717)](bedroom/views/01_home.yaml)
- Android 5 fixed-dark renderer: [![HTML source: bedroom-kiosk](https://img.shields.io/static/v1?label=HTML&message=bedroom-kiosk&color=lightgrey&logo=html5&logoColor=E34F26)](../www/bedroom-kiosk.html)
- Kiosk Satellite preview: [![YAML source: dashboard](https://img.shields.io/static/v1?label=YAML&message=kiosk_satellite_staging&color=lightgrey&logo=github&logoColor=181717)](kiosk_satellite_staging/dashboard.yaml)
- Kitchen tablet view: [![YAML source: 01_home](https://img.shields.io/static/v1?label=YAML&message=01_home&color=lightgrey&logo=github&logoColor=181717)](kiosk_satellite_staging/views/01_home.yaml)
- Kitchen tablet view: [![YAML source: 01_home](https://img.shields.io/static/v1?label=YAML&message=01_home&color=lightgrey&logo=github&logoColor=181717)](kiosk_satellite_staging/views/01_home.yaml). Verified personal bests rotate for seven days alongside household reminders; the Health view retains step trends without persistent record cards.
- Automatic day/night theme: [![YAML source: kiosk_satellite](https://img.shields.io/static/v1?label=YAML&message=kiosk_satellite_theme&color=lightgrey&logo=github&logoColor=181717)](../themes/kiosk_satellite.yaml)
The displays share only the reusable event and screen-policy state they need. Kitchen keeps its clock/current-weather/forecast banner and rotating household context, including the next confirmed cruise countdown and 48-hour Carlo/Stacey bowling-result highlights, while the fixed-landscape Bedroom dashboard omits the redundant clock and uses that space for the next wake alarm, security/weather context, larger Front Lawn and Driveway feeds, and a readable household alert. Both use the same Garage-then-Front-Door event priority, with Garage held for three minutes after both doors close before the default dashboard returns. A lower-priority Frigate Driveway alert replaces both displays with the live Driveway feed until occupancy clears or ten minutes elapse, whichever happens first. The canonical Bedroom Lovelace view and its Android 5 lightweight renderer consume the same camera, header, and alert sensors; the renderer bypasses only the unsupported Home Assistant frontend on the frozen Fire WebView and stays dark at all times for bedroom readability. Kitchen uses native Kiosk Satellite overlays for Garage and Front Door, a full-view Lovelace Driveway alert, and idle dimming; Home Assistant handles household sleep/away enforcement, volume, and event-camera wake instead of periodically forcing the screen on. Nearby rain or lightning starts one five-minute NOAA radar takeover during daylight; afterward, the rotating Storms Approaching banner can replay the latest 20-minute loop while the weather event remains active. Actionable NWS, package, family-location, entry-point, Phyn, and low-hot-water slides open a shared short-lived detail surface; the family map centers only the person named by the tapped slide and shows that person's prior 24-hour trail, while a closed Phyn main valve can be restored only from its detail view after explicit confirmation. The ambient wall remains in place after sunset. True idle panel-off remains disabled until the Crown LineageOS device has a reliable motion-wake input. Its device schedule changes the Home Assistant theme between light at 07:00 and dark at 19:00. Other clients follow their own system preference.
The displays share only the reusable event and screen-policy state they need. Kitchen keeps its clock/current-weather/forecast banner and rotating household context, including the next confirmed cruise countdown and 48-hour Carlo/Stacey bowling-result highlights, while the fixed-landscape Bedroom dashboard omits the redundant clock and uses that space for the next wake alarm, security/weather context, larger Front Lawn and Driveway feeds, and a readable household alert. Fresh personal bests rotate on Kitchen and alternate with lower-priority Bedroom context for seven days; safety alerts and reminders retain priority. Both use the same Garage-then-Front-Door event priority, with Garage held for three minutes after both doors close before the default dashboard returns. A lower-priority Frigate Driveway alert replaces both displays with the live Driveway feed until occupancy clears or ten minutes elapse, whichever happens first. The canonical Bedroom Lovelace view and its Android 5 lightweight renderer consume the same camera, header, and alert sensors; the renderer bypasses only the unsupported Home Assistant frontend on the frozen Fire WebView and stays dark at all times for bedroom readability. Kitchen uses native Kiosk Satellite overlays for Garage and Front Door, a full-view Lovelace Driveway alert, and idle dimming; Home Assistant handles household sleep/away enforcement, volume, and event-camera wake instead of periodically forcing the screen on. Nearby rain or lightning starts one five-minute NOAA radar takeover during daylight; afterward, the rotating Storms Approaching banner can replay the latest 20-minute loop while the weather event remains active. Actionable NWS, package, family-location, entry-point, Phyn, and low-hot-water slides open a shared short-lived detail surface; the family map centers only the person named by the tapped slide and shows that person's prior 24-hour trail, while a closed Phyn main valve can be restored only from its detail view after explicit confirmation. The ambient wall remains in place after sunset. True idle panel-off remains disabled until the Crown LineageOS device has a reliable motion-wake input. Its device schedule changes the Home Assistant theme between light at 07:00 and dark at 19:00. Other clients follow their own system preference.
Kitchen's native Kiosk Satellite Garage and Front Door overlays use imported Home Assistant camera entities, with HLS preferred over WebRTC on the Fire/WebView-class Kitchen Show display. Driveway alerts use the same live Home Assistant camera through the dashboard because Driveway is not configured as a native Kiosk Satellite shortcut.

@ -19,6 +19,7 @@
# Notes: Family detail centers only the selected person and includes the prior 24-hour trail; Phyn detail includes a confirmed main-valve restore action.
# Notes: Rheem problem telemetry adds a red/amber water-heater slide and enriches the existing hot-water detail.
# Notes: New LeagueSecretary results add Carlo and Stacey slides for 48 hours; other bowlers stay out of the kiosk payload.
# Notes: Verified Health Coach personal bests add Carlo and Stacey slides for seven days.
# Notes: The large-format lower panel otherwise mirrors read-only household fact entities.
# Notes: The clock uses oversized time text and places live conditions beneath the current-weather icon.
######################################################################
@ -209,6 +210,7 @@
- input_datetime.tesla_model_y_plug_in_snooze_until
- sensor.next_booked_cruise_countdown
- sensor.bearclaw_status_telemetry
- sensor.kiosk_recent_personal_records
- person.carlo
- person.stacey
- person.justin
@ -565,6 +567,24 @@
});
}
const recordFeed = states['sensor.kiosk_recent_personal_records'];
const personalRecords = recordFeed?.state === 'ready' ? recordFeed.attributes?.items : null;
if (Array.isArray(personalRecords)) {
personalRecords.forEach((record) => {
const occurredAt = new Date(record?.occurredAt || '');
if (!Number.isFinite(occurredAt.getTime()) ||
occurredAt > now || now - occurredAt > 7 * 24 * 60 * 60 * 1000 ||
!record?.person || !record?.label || !record?.displayValue) return;
items.push({
kicker: 'NEW PERSONAL BEST',
title: `${record.person}: ${record.label}`,
detail: [record.displayValue, record.activityType, record.dayKey].filter(Boolean).join(' · '),
icon: 'mdi:trophy-outline',
accent: '#2e7d32'
});
});
}
const cruiseDays = Number.parseInt(state('sensor.next_booked_cruise_countdown'), 10);
const cruiseEntity = states['sensor.next_booked_cruise_countdown'];
const cruiseShip = String(cruiseEntity?.attributes?.ship || '').trim();

@ -105,7 +105,7 @@
]]]
# -------------------------------------------------------------------
# HealthKit steps and personal records
# HealthKit step trends
# -------------------------------------------------------------------
- type: grid
column_span: 4
@ -117,14 +117,14 @@
columns: full
layout_type: custom:grid-layout
layout:
grid-template-columns: repeat(4, minmax(0, 1fr))
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(2, minmax(0, 1fr))
grid-template-columns: minmax(0, 1fr)
cards:
- type: custom:button-card
template: bearstone_health_kpi
@ -180,43 +180,6 @@
return `28d ${value('prior_28d_average', 'prior_28d_samples', 28)} · 90d ${value('prior_90d_average', 'prior_90d_samples', 90)}`;
]]]
- type: custom:button-card
template: bearstone_health_kpi
entity: sensor.joanna_carlo_latest_personal_record
name: Carlo Personal Record
icon: mdi:trophy-outline
show_label: true
variables:
detail_layout: true
state_display: >
[[[
return entity?.attributes?.display_value || 'NO RECORDS';
]]]
label: >
[[[
const attrs = entity?.attributes || {};
const pieces = [entity?.state, attrs.activity_type, attrs.achieved_on].filter((value) => value && value !== 'unknown');
return pieces.join(' · ') || 'Stored HealthKit history';
]]]
- type: custom:button-card
template: bearstone_health_kpi
entity: sensor.joanna_stacey_latest_personal_record
name: Stacey Personal Record
icon: mdi:trophy-outline
show_label: true
variables:
detail_layout: true
state_display: >
[[[
return entity?.attributes?.display_value || 'NO RECORDS';
]]]
label: >
[[[
const attrs = entity?.attributes || {};
const pieces = [entity?.state, attrs.activity_type, attrs.achieved_on].filter((value) => value && value !== 'unknown');
return pieces.join(' · ') || 'Stored HealthKit history';
]]]
# -------------------------------------------------------------------
# Fourteen-night paired trends

@ -8,7 +8,7 @@
# -------------------------------------------------------------------
# Related Issue: 1584
# Notes: Promoted from the approved Health pilot; personal health remains with Overview.
# Notes: Joanna supplies shared personal records and completed-day 7d vs 28d vs 90d step trends.
# Notes: Joanna supplies completed-day 7d vs 28d vs 90d step trends; fresh records rotate on kiosks.
######################################################################
title: Health

@ -67,7 +67,7 @@ After Home Assistant starts, Kitchen Show waits three minutes for the initial st
| [![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 reports via webhook, with Available-only reports processed without persistent alerts, visible `### Updated:` / `### Failed:` / `### Rolled-back:` outcomes, immediate Joanna recovery dispatch for failures, and Joanna review dispatch for 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 dispatch trusted Home Assistant machine jobs to codex_appliance, relay lifecycle callbacks and outbound notifications, 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, personal records for Overview Health, and 48-hour Carlo/Stacey bowling highlights for Kitchen Show. Authenticated human Telegram stays on the appliance's single agent-first Luna path; Home Assistant is not its semantic router. 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: bearclaw](https://img.shields.io/static/v1?label=YAML&message=bearclaw&color=lightgrey&logo=github&logoColor=181717)](bearclaw.yaml) | Joanna/BearClaw bridge automations dispatch trusted Home Assistant machine jobs to codex_appliance, relay lifecycle callbacks and outbound notifications, 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, personal records for seven-day kiosk rotations, and 48-hour Carlo/Stacey bowling highlights for Kitchen Show. Authenticated human Telegram stays on the appliance's single agent-first Luna path; Home Assistant is not its semantic router. 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` |

@ -20,7 +20,7 @@
# 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: Status telemetry exposes user-keyed step trends for Health and personal records for briefings and kiosks.
# Notes: Status telemetry exposes 48-hour Carlo/Stacey bowling highlights for the Kitchen Show rotation.
# Notes: Retired QMD health telemetry is no longer imported or materialized in Home Assistant.
# Notes: TeslaMate road-trip walkthrough: https://youtu.be/9-9T6v17NEw

@ -30,6 +30,7 @@
# Notes: Actionable Kitchen banner slides open one shared short-lived detail surface; camera events retain priority.
# Notes: Phyn detail can restore a closed main valve only after an explicit on-screen confirmation.
# Notes: Rheem faults outrank low-hot-water reminders and reuse the hot-water diagnostic detail surface.
# Notes: Verified Health Coach personal bests rotate for seven days; Bedroom safety and reminders retain priority.
# Video: https://youtu.be/ChgEu0IDWzc
######################################################################
@ -470,6 +471,37 @@ template:
{{ 'House secured' if secure else 'Check house security' }} ·
{{ temperature | round(0) if temperature is number else '--' }}° · {{ weather }}
- name: "Kiosk Recent Personal Records"
unique_id: kiosk_recent_personal_records
icon: mdi:trophy-outline
availability: >-
{% set insights = state_attr('sensor.bearclaw_status_telemetry', 'healthInsights') %}
{% set generated = as_timestamp(insights.get('generatedAt'), none) if insights is mapping else none %}
{{ is_state('sensor.bearclaw_status_telemetry', 'ok')
and generated is not none
and 0 <= as_timestamp(now()) - generated <= 3600 }}
state: ready
attributes:
items: >-
{% set insights = state_attr('sensor.bearclaw_status_telemetry', 'healthInsights') %}
{% set users = insights.get('users', {}) if insights is mapping else {} %}
{% set current = as_timestamp(now()) %}
{% set ns = namespace(items=[]) %}
{% for key, person in [('carlo', 'Carlo'), ('stacey', 'Stacey')] %}
{% set user = users.get(key, {}) if users is mapping else {} %}
{% set personal = user.get('personalRecords', {}) if user is mapping else {} %}
{% for record in personal.get('records', []) if record is mapping %}
{% set occurred = as_timestamp(record.get('occurredAt'), none) %}
{% if occurred is not none and 0 <= current - occurred <= 604800
and record.get('label') and record.get('displayValue') %}
{% set ns.items = ns.items + [dict(person=person, label=record.label,
displayValue=record.displayValue, activityType=record.get('activityType'),
dayKey=record.get('dayKey'), occurredAt=record.occurredAt)] %}
{% endif %}
{% endfor %}
{% endfor %}
{{ ns.items | sort(attribute='occurredAt', reverse=true) | list }}
- name: "Kiosk Household Alert"
unique_id: kiosk_household_alert
icon: mdi:message-alert-outline
@ -479,6 +511,9 @@ template:
{% set rheem_alert_count = states('sensor.rheem_wh_alert_count') | int(0) %}
{% set tomorrow = (now() + timedelta(days=1)).strftime('%Y-%m-%d') %}
{% set battery = states('sensor.spaceship_battery_level') | float(100) %}
{% set records = (state_attr('sensor.kiosk_recent_personal_records', 'items') | default([], true))
if is_state('sensor.kiosk_recent_personal_records', 'ready') else [] %}
{% set record_slot = (now().minute // 2) % (records | count + 1) %}
{% set ns = namespace(name='', raw='') %}
{% for name, person, location in [
('Carlo', 'person.carlo', 'sensor.carlo_location_display'),
@ -511,6 +546,8 @@ template:
{% elif battery < 50 and is_state('switch.spaceship_charge', 'off')
and is_state('person.carlo', 'home') and is_state('person.stacey', 'home') %}
PLUG IN THE TESLA
{% elif record_slot > 0 %}
{{ records[record_slot - 1].person | upper }}'S PERSONAL BEST
{% elif ns.name %}
{% set location = ns.raw | replace(ns.name ~ ' ', '') %}
{{ ns.name }} - {{ location.split(' (since ')[0] }}
@ -524,6 +561,9 @@ template:
{% set rheem_alert_count = states('sensor.rheem_wh_alert_count') | int(0) %}
{% set tomorrow = (now() + timedelta(days=1)).strftime('%Y-%m-%d') %}
{% set battery = states('sensor.spaceship_battery_level') | float(100) %}
{% set records = (state_attr('sensor.kiosk_recent_personal_records', 'items') | default([], true))
if is_state('sensor.kiosk_recent_personal_records', 'ready') else [] %}
{% set record_slot = (now().minute // 2) % (records | count + 1) %}
{% set ns = namespace(name='', raw='') %}
{% for name, person, location in [
('Carlo', 'person.carlo', 'sensor.carlo_location_display'),
@ -559,6 +599,10 @@ template:
{% elif battery < 50 and is_state('switch.spaceship_charge', 'off')
and is_state('person.carlo', 'home') and is_state('person.stacey', 'home') %}
Model Y battery is {{ battery | round(0) }}%.
{% elif record_slot > 0 %}
{% set record = records[record_slot - 1] %}
{{ record.label }}: {{ record.displayValue }}{% if record.activityType %}
· {{ record.activityType }}{% endif %} · {{ record.dayKey }}
{% elif ns.name %}
{% set parts = ns.raw.split(' (since ') %}
{{ 'Since ' ~ (parts[1] | replace(')', '')) if parts | count > 1 else 'Away from home' }}

@ -62,7 +62,6 @@ sensor.garage_ups_battery_runtime
sensor.joanna_all_dispatches_24h
sensor.joanna_all_dispatches_30d
sensor.joanna_all_dispatches_7d
sensor.joanna_carlo_latest_personal_record
sensor.joanna_carlo_steps_trend
sensor.joanna_ha_dispatches_24h
sensor.joanna_ha_dispatches_30d
@ -70,7 +69,6 @@ sensor.joanna_ha_dispatches_7d
sensor.joanna_ha_errors_24h
sensor.joanna_ha_success_rate_24h
sensor.joanna_memory_docs
sensor.joanna_stacey_latest_personal_record
sensor.joanna_stacey_steps_trend
sensor.justin_location_display
sensor.l10s_vacuum_battery_level

Loading…
Cancel
Save

Powered by TurnKey Linux.