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.

138 lines
18 KiB

<h1 align="center">
<a name="logo" href="https://www.vCloudInfo.com/tag/iot"><img src="https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/x_profile.png" alt="Bear Stone Smart Home" width="200"></a>
<br>
Bear Stone Smart Home Documentation
</h1>
<h4 align="center">Be sure to :star: my configuration repo so you can keep up to date on any daily progress!</h4>
<div align="center">
[![X Follow](https://img.shields.io/static/v1?label=talk&message=3k&color=blue&logo=twitter&style=for-the-badge)](https://x.com/ccostan)
[![YouTube Subscribe](https://img.shields.io/badge/VIEW-6.8K-FF0000?logo=Youtube&logoColor=%23DF5D44&style=for-the-badge)](https://www.youtube.com/vCloudInfo?sub_confirmation=1)
[![GitHub Stars](https://img.shields.io/github/stars/CCOSTAN/Home-AssistantConfig.svg?label=STARS&logo=github&style=for-the-badge)](https://github.com/CCOSTAN/Home-AssistantConfig/stargazers) <br>
[![HA Version Badge](https://raw.githubusercontent.com/ccostan/home-assistantconfig/master/ha-version-badge.svg)](https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/config/.HA_VERSION)
[![Last Commit](https://img.shields.io/github/last-commit/CCOSTAN/Home-AssistantConfig/master?style=plastic)](https://github.com/CCOSTAN/Home-AssistantConfig/commits/master)
[![Commit Activity](https://img.shields.io/github/commit-activity/y/CCOSTAN/Home-AssistantConfig.svg?style=plastic)](https://github.com/CCOSTAN/Home-AssistantConfig/commits/master)
</div>
Reusable scripts that other automations call for notifications, lighting, safety responses, and Joanna/BearClaw AGENT engineer handoffs. Pass variables in; let the script do the heavy lifting.
### Quick navigation
- You are here: `config/script/` (scripts library)
- [Repo overview](../../README.md) | [Config index](../README.md) | [Automations](../automation) | [Scenes](../scene) | [![vCloudInfo Blog Post](https://img.shields.io/static/v1?label=vCloudInfo&message=Blog%20Post&color=21759B&logo=wordpress&logoColor=white)](https://www.vcloudinfo.com/2018/12/breaking-down-my-home-assistant-volume.html)
![Home Assistant header](https://i.imgur.com/vjDH1LJ.png)
### Featured files to browse
| File | Why it matters |
| --- | --- |
| [![YAML source: notify_engine](https://img.shields.io/static/v1?label=YAML&message=notify_engine&color=lightgrey&logo=github&logoColor=181717)](notify_engine.yaml) | Single entrypoint for rich push notifications, with one or two optional action buttons, tags for clearing, and shared colored notification icons for household alerts. | [![Watch on YouTube](https://img.shields.io/badge/Watch-YouTube-FF0000?logo=youtube&logoColor=white)](https://youtu.be/TMfdxv-WprM) [![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/10/home-assistant-ios-notification-icons.html)
| [![YAML source: hvac_control](https://img.shields.io/static/v1?label=YAML&message=hvac_control&color=lightgrey&logo=github&logoColor=181717)](hvac_control.yaml) | Single reconciler for grid, entry-point, occupancy, and target-temperature HVAC policy. |
| [![YAML source: notify_live_activity](https://img.shields.io/static/v1?label=YAML&message=notify_live_activity&color=lightgrey&logo=github&logoColor=181717)](notify_live_activity.yaml) | Shared helper for tagged live activity/live update pushes and clear commands. |
| [![YAML source: kiosk_driveway_camera_takeover](https://img.shields.io/static/v1?label=YAML&message=kiosk_driveway_camera_takeover&color=lightgrey&logo=github&logoColor=181717)](kiosk_driveway_camera_takeover.yaml) | Coordinates the bounded Driveway camera takeover and wake behavior across both household kiosks. |
| [![YAML source: send_to_logbook](https://img.shields.io/static/v1?label=YAML&message=send_to_logbook&color=lightgrey&logo=github&logoColor=181717)](send_to_logbook.yaml) | Generic `logbook.log` helper for Activity feed entries (Issue #1550). |
| [![YAML source: joanna_dispatch](https://img.shields.io/static/v1?label=YAML&message=joanna_dispatch&color=lightgrey&logo=github&logoColor=181717)](joanna_dispatch.yaml) | Shared AGENT engineer dispatch contract that routes HA-detected issues into Joanna/BearClaw remediation. |
| [![YAML source: speech_engine](https://img.shields.io/static/v1?label=YAML&message=speech_engine&color=lightgrey&logo=github&logoColor=181717)](speech_engine.yaml) | TTS/announcement orchestration with templated speech; speech processing can bypass LLM rewriting for exact messages and also routes garage/office Echo announcements. |
| [![YAML source: verify_rain_at_house](https://img.shields.io/static/v1?label=YAML&message=verify_rain_at_house&color=lightgrey&logo=github&logoColor=181717)](verify_rain_at_house.yaml) | Conservative rain corroboration through the existing OpenAI AI Task and current exterior camera images. Returns a decision without controlling devices; requires usable recent Frigate camera reports, high-confidence visible rain or broadly wet exposed concrete, and inactive irrigation. Errors and uncertainty deny optional rain lighting. |
| [![YAML source: monthly_color_scene](https://img.shields.io/static/v1?label=YAML&message=monthly_color_scene&color=lightgrey&logo=github&logoColor=181717)](monthly_color_scene.yaml) | Seasonal lighting dispatcher that follows `sensor.holiday_lighting_scene`. |
| [![YAML source: interior_off](https://img.shields.io/static/v1?label=YAML&message=interior_off&color=lightgrey&logo=github&logoColor=181717)](interior_off.yaml) | Existing bedtime/away shutdown for interior lights, switches, media power, and the Paige lighting routine. |
| [![YAML source: lighting_all_off](https://img.shields.io/static/v1?label=YAML&message=lighting_all_off&color=lightgrey&logo=github&logoColor=181717)](lighting_all_off.yaml) | Shared Home/Mobile lights-only shutdown with an explicit lamp-switch allowlist; uses the same scope as On Now. |
### Household notification icons
Driveway alerts, front-door package alerts/status checks, and check-garage-door reminders use separate stable `tag` values so each new notification replaces the previous one of its kind on each recipient's phone. Existing untagged notifications require one-time manual dismissal. The iOS `destructive` action option only colors an action button red; notification replacement uses [tags](https://companion.home-assistant.io/docs/notifications/notifications-basic/#replacing).
Shared phone notifications sent through `notify.ios_parents` or `notify.ios_family` also join the household kiosk rotation for ten minutes. The kiosk feed observes these group calls, including callers outside `notify_engine`, and preserves phone recipients, actions, attachments, and urgency. Each slide shows the notification title, message, and sent time. A repeated tag replaces its earlier slide; `clear_notification` removes the matching tag. Individual phone notifications and device commands stay out of the shared rotation.
[![Watch on YouTube](https://img.shields.io/badge/Watch-YouTube-FF0000?logo=youtube&logoColor=white)](https://youtu.be/TMfdxv-WprM) [![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/10/home-assistant-ios-notification-icons.html)
Both `script.notify_engine` and `script.notify_engine_two_button` accept `notification_icon` (an `mdi:` name), `icon_url` (a public or `/local/` image), `notification_icon_color` (glyph hex color), and `color` (background hex color). On supported iOS apps, these appear as rounded sender icons and require a nonempty notification title. `icon_url` takes precedence over the MDI icon; colors apply only to MDI icons. See the [Companion App documentation](https://companion.home-assistant.io/docs/notifications/notifications-basic/#notification-icon-and-color) and [issue #1773](https://github.com/CCOSTAN/Home-AssistantConfig/issues/1773).
The shared helper gives existing notification groups a consistent palette without changing their grouping, recipients, action buttons, tags, or interruption levels:
| Notification group | Icon | Background |
| --- | --- | --- |
| `Medicine` | `mdi:pill` | Purple |
| `Garbage_Reminders` | `mdi:trash-can-outline` | Green |
| `Welcome_Home` | `mdi:home-heart` | Teal |
| `360_alerts` | `mdi:map-marker-radius` (arrival/departure callers override it) | Blue |
| `Battery_Alert` | `mdi:battery-alert-variant-outline` | Orange |
| `maintenance` | `mdi:tools` | Slate |
| `Phyn` | `mdi:water-alert` | Red |
| `Tesla_Model_Y` | `mdi:car-electric` | Blue |
| `Tesla_Tire_Pressure` | `mdi:car-tire-alert` | Orange |
| `Tesla_Charge_Rate_Alarm` | `mdi:ev-station` | Red |
| `JuiceBox_Proxy_Offline` | `mdi:ev-station` | Orange |
| `water_heater` | `mdi:water-boiler-alert` | Orange |
| `RemoteLR` | `mdi:remote` | Purple |
| `Printer` | `mdi:printer` | Slate |
| `vacation` | `mdi:palm-tree` | Teal |
| `royal_caribbean_price_drop` | `mdi:ferry` | Blue |
Group lookup ignores case. An explicit icon overrides the preset; `notification_icon: ''` disables it. Other groups keep their existing payload unless a caller supplies an icon. Driveway, fridge-door, front-door package, and vacuum-help alerts supply their own icons while retaining their existing camera attachments where applicable. Untitled notifications and `clear_notification` commands receive no icon fields. Older apps or push paths that do not support custom icons retain the normal app icon.
Arrival alerts use a teal home-entry icon at home or a checked map pin at other monitored places; driving departures use a blue home-exit icon. The existing presence rules and notification groups stay in place. Grid status uses a red disconnected tower for outages and a green tower for restoration, with separate battery/HVAC icons for load shedding and recovery.
Lightning and high-wind warnings, open doors/garages, alarm-panel access, fridge temperature, server temperature, storage space, kitchen power, water-heater maintenance, house-sitter visits, and secure-house checks also pass explicit icons. Previously untitled door, alarm-panel, and storage alerts now have short titles so iOS can display their icons. The direct Roku remote-finder notification keeps its existing action payload and adds the same purple remote icon as its confirmation.
### Joanna + BearClaw AGENT engineer handoff
`script.joanna_dispatch` is the shared handoff contract from Home Assistant automations into Joanna/BearClaw when Home Assistant detects something worth investigating or fixing.
Why we use it:
- Keeps one message schema for remediation context (`trigger_context`, `source`, `summary`, `entity_ids`, `diagnostics`, `request`, plus optional routing hints).
- Avoids repeating direct `rest_command.bearclaw_command` payload formatting in multiple packages.
- Lets Home Assistant stay focused on detection, timing, and routing while Joanna acts as the AGENT engineer for infrastructure triage and recommended remediation.
- Makes resolution-trigger automations easier to review, update, and audit.
What the helper normalizes before the BearClaw intake call:
- `trigger_context`, `source`, and `summary` so every dispatch has traceable origin details.
- `entity_ids` from either a YAML list or a comma-delimited string.
- `diagnostics` from either free text or structured mappings/sequences.
- `request` guardrails so Joanna defaults to investigation/recommendation, not blind resets or power-cycles.
- `domain_hint`/`lane_hint` default to BearClaw ops routing so HA infrastructure text does not drift into another domain parser.
Current automations that kick off automated resolutions (via `script.joanna_dispatch`):
| Automation ID | Alias | File |
| --- | --- | --- |
| `mqtt_open_repair_on_failure` | MQTT - Open Repair On Failure | [![YAML source: mqtt_status](https://img.shields.io/static/v1?label=YAML&message=mqtt_status&color=lightgrey&logo=github&logoColor=181717)](../packages/mqtt_status.yaml) |
| `onenote_indexer_failure_open_repair` | OneNote Indexer - Open Repair On Failure | [![YAML source: onenote_indexer](https://img.shields.io/static/v1?label=YAML&message=onenote_indexer&color=lightgrey&logo=github&logoColor=181717)](../packages/onenote_indexer.yaml) |
| `infra_backup_nightly_verification` | Infrastructure - Backup Nightly Verification | [![YAML source: infrastructure](https://img.shields.io/static/v1?label=YAML&message=infrastructure&color=lightgrey&logo=github&logoColor=181717)](../packages/infrastructure.yaml) |
| `infra_monthly_log_hygiene_review` | Infrastructure - Monthly HA Log Hygiene Review | [![YAML source: infrastructure](https://img.shields.io/static/v1?label=YAML&message=infrastructure&color=lightgrey&logo=github&logoColor=181717)](../packages/infrastructure.yaml) |
| `infra_nebula_sync_health_dispatch` | Infrastructure - Nebula Sync Health Dispatch | [![YAML source: infrastructure](https://img.shields.io/static/v1?label=YAML&message=infrastructure&color=lightgrey&logo=github&logoColor=181717)](../packages/infrastructure.yaml) |
| `infra_pihole_iot_dns_drift_dispatch` | Infrastructure - Pi-hole IoT DNS Drift Dispatch | [![YAML source: infrastructure](https://img.shields.io/static/v1?label=YAML&message=infrastructure&color=lightgrey&logo=github&logoColor=181717)](../packages/infrastructure.yaml) |
| `infra_website_down_repair_and_dispatch` | Infrastructure - Website Down Repair And Dispatch | [![YAML source: infrastructure](https://img.shields.io/static/v1?label=YAML&message=infrastructure&color=lightgrey&logo=github&logoColor=181717)](../packages/infrastructure.yaml) |
| `docker_state_sync_repairs_dynamic` | Docker State Sync - Repairs (Dynamic) | [![YAML source: docker_infrastructure](https://img.shields.io/static/v1?label=YAML&message=docker_infrastructure&color=lightgrey&logo=github&logoColor=181717)](../packages/docker_infrastructure.yaml) |
| `docker_group_reconcile_weekly_joanna_review` | Docker Group Reconcile - Weekly Joanna Review | [![YAML source: docker_infrastructure](https://img.shields.io/static/v1?label=YAML&message=docker_infrastructure&color=lightgrey&logo=github&logoColor=181717)](../packages/docker_infrastructure.yaml) |
| `docker_host_disk_pressure_monitor` | Docker Host Disk Pressure Monitor | [![YAML source: infrastructure](https://img.shields.io/static/v1?label=YAML&message=infrastructure&color=lightgrey&logo=github&logoColor=181717)](../packages/infrastructure.yaml) |
| `proxmox_updates_joanna_dispatch` | Proxmox Updates Joanna Dispatch | [![YAML source: proxmox](https://img.shields.io/static/v1?label=YAML&message=proxmox&color=lightgrey&logo=github&logoColor=181717)](../packages/proxmox.yaml) |
| `tugtainer_dispatch_joanna_for_available_updates` | Tugtainer - Dispatch Joanna For Available Updates | [![YAML source: tugtainer_updates](https://img.shields.io/static/v1?label=YAML&message=tugtainer_updates&color=lightgrey&logo=github&logoColor=181717)](../packages/tugtainer_updates.yaml) |
| `tugtainer_dispatch_joanna_for_home_assistant_core_digest` | Tugtainer - Dispatch Joanna For Home Assistant Core Digest | [![YAML source: tugtainer_updates](https://img.shields.io/static/v1?label=YAML&message=tugtainer_updates&color=lightgrey&logo=github&logoColor=181717)](../packages/tugtainer_updates.yaml) |
| `unifi_ap_no_clients_repair_combined` | Unifi AP Create Repair Issue after 5m of 0 Clients | [![YAML source: wireless](https://img.shields.io/static/v1?label=YAML&message=wireless&color=lightgrey&logo=github&logoColor=181717)](../packages/wireless.yaml) |
| `proxmox_runtime_repairs` | Proxmox Runtime Repair Issues | [![YAML source: proxmox](https://img.shields.io/static/v1?label=YAML&message=proxmox&color=lightgrey&logo=github&logoColor=181717)](../packages/proxmox.yaml) |
| `proxmox_disk_pressure_repairs` | Proxmox Disk Pressure Repair Issues | [![YAML source: proxmox](https://img.shields.io/static/v1?label=YAML&message=proxmox&color=lightgrey&logo=github&logoColor=181717)](../packages/proxmox.yaml) |
| `synology_dsm_open_repair_and_dispatch` | Synology DSM - Open Repair And Dispatch | [![YAML source: synology_dsm](https://img.shields.io/static/v1?label=YAML&message=synology_dsm&color=lightgrey&logo=github&logoColor=181717)](../packages/synology_dsm.yaml) |
| `processmonitor_disk_use_joanna_review` | Self Heal Disk Use Joanna Review | [![YAML source: processmonitor](https://img.shields.io/static/v1?label=YAML&message=processmonitor&color=lightgrey&logo=github&logoColor=181717)](../packages/processmonitor.yaml) |
| `rheem_water_heater_alert_incident` | Rheem Water Heater Alert Incident | [![YAML source: rheem_econet](https://img.shields.io/static/v1?label=YAML&message=rheem_econet&color=lightgrey&logo=github&logoColor=181717)](../packages/rheem_econet.yaml) |
| `rheem_water_heater_incident_reconcile` | Rheem Water Heater Incident Reconcile | [![YAML source: rheem_econet](https://img.shields.io/static/v1?label=YAML&message=rheem_econet&color=lightgrey&logo=github&logoColor=181717)](../packages/rheem_econet.yaml) |
| `1ce3cb43-0e27-4c53-acdd-d672396f3559` | Disk Use Alarm | [![YAML source: processmonitor](https://img.shields.io/static/v1?label=YAML&message=processmonitor&color=lightgrey&logo=github&logoColor=181717)](../packages/processmonitor.yaml) |
### Tips
- Keep scripts generic, route data via `data:`/`variables:`, and reuse everywhere.
- If you copy a script, rename any `alias` and `id` fields to avoid duplicates.
**All of my configuration files are tested against the most stable version of home-assistant.**
<a name="bottom" href="https://github.com/CCOSTAN/Home-AssistantConfig#logo"><img align="right" border="0" src="https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/config/www/custom_ui/floorplan/images/branding/up_arrow.png" width="25" ></a>
**Still have questions on my Config?** <br>
**Message me on X :** [![Follow CCostan](https://img.shields.io/twitter/follow/CCostan)](https://www.x.com/ccostan)
<p align="center">
<a target="_blank" href="https://www.buymeacoffee.com/vCloudInfo"><img src="https://www.buymeacoffee.com/assets/img/BMC-btn-logo.svg" alt="Buy me a coffee"><span style="margin-left:5px">You can buy me a coffee</span></a><a target="_blank" href="https://www.buymeacoffee.com/vCloudInfo"><img src="https://www.buymeacoffee.com/assets/img/BMC-btn-logo.svg" alt="Buy me a coffee"></a>
<br>
<a href="https://eepurl.com/dmXFYz"><img align="center" border="0" src="https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/config/www/custom_ui/floorplan/images/branding/email_link.png" height="50" ></a><br>
<a href="https://www.vCloudInfo.com/p/affiliate-disclosure.html">
Affiliate Disclosure
</a></p>

Powered by TurnKey Linux.