Add custom icons to household notifications

Support optional MDI and image icons with shared group colors, explicit overrides, and opt-outs. Add contextual icons to driveway, fridge, package, and vacuum alerts and document usage.

Refs #1773
master
Carlo Costanzo 2 months ago
parent 7f15528e91
commit 0a3852c6bd

@ -4,6 +4,7 @@
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# -------------------------------------------------------------------
# Driveway Parked Car Alert - notify when a car remains in the driveway zone.
# Related Issue: 1773
# Sends alerts and starts the shared ten-minute kiosk camera takeover.
# Video: https://youtu.be/X9qrywP3XS0
# Blog: https://www.vcloudinfo.com/2026/09/home-assistant-frigate-driveway-car-alert.html
@ -38,6 +39,8 @@
continue_on_error: true
data:
title: 'Driveway Alert'
notification_icon: mdi:car
color: '#1565C0'
value1: "Hey, there's a car parked in your driveway. Please check."
who: 'parents'
group: 'information'

@ -4,6 +4,7 @@
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# -------------------------------------------------------------------
# LG Fridge - SmartThinQ appliance monitoring - Fridge/freezer sensors via ThinQ integration. https://amzn.to/3lOYTCv.
# Related Issue: 1773
# Centralizes the LG Fridge - SmartThinQ appliance monitoring package configuration and helpers.
# -------------------------------------------------------------------
# Notes: Door-open alerts use the raw SmartThinQ door sensor after 6 minutes, avoiding one-poll false opens without a helper entity.
@ -26,6 +27,8 @@ automation:
- service: script.notify_engine
data:
title: 'Fridge Door Open'
notification_icon: mdi:fridge-alert
color: '#C2410C'
value1: >
The fridge door has been open for more than 6 minutes. Please check and close the fridge door to avoid temperature issues.
who: 'family'

@ -4,6 +4,7 @@
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# -------------------------------------------------------------------
# LLM Vision - garage cans and front-door package checks
# Related Issue: 1773
# Trigger with input_button.llmvision_garbage_check, input_button.llmvision_front_door_package_check, or front door person activity to update vision-backed package sensors.
# -------------------------------------------------------------------
# Notes: LLMVision analyzes camera.garagecam; expects strict "on"/"off" output.
@ -255,6 +256,8 @@ automation:
- service: script.notify_engine
data:
title: Front door package test
notification_icon: mdi:package-variant-closed-check
color: '#6A1B9A'
value1: >-
LLM Vision returned {{ llmvision_result.response_text | default(states('input_boolean.front_door_packages_present')) | lower }}
for the front door package check.
@ -284,6 +287,8 @@ automation:
- service: script.notify_engine
data:
title: Package check
notification_icon: mdi:package-variant-closed-check
color: '#6A1B9A'
value1: "{{ package_message }}"
who: "{{ notify_target }}"
group: information

@ -4,7 +4,7 @@
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# -------------------------------------------------------------------
# Dreame Vacuum Orchestration - Continuous phased sweep/mop with away/on-demand
# Related Issue: 1550, 1553
# Related Issue: 1550, 1553, 1773
# Phases: sweep main, sweep baths, mop main, mop baths; notifications + idle auto-start
# Video: https://youtu.be/KKOWSKuF5jA
# Blog: https://www.vcloudinfo.com/2026/05/home-assistant-vacuum-automations-dreame-2026.html
@ -781,6 +781,8 @@ automation:
- service: script.notify_engine
data:
title: 'Help vacuum'
notification_icon: mdi:robot-vacuum-alert
color: '#C2410C'
value1: "{{ states('sensor.l10s_vacuum_error') }} - {{ states('sensor.l10s_vacuum_current_room') }}"
who: 'parents'
ios_category: 'camera'

@ -27,7 +27,7 @@ Reusable scripts that other automations call for notifications, lighting, safety
### 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 optional tags that let recovery actions target a specific notification for clearing. |
| [![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 optional tags for clearing and shared colored notification icons for household alerts. |
| [![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. |
@ -37,6 +37,26 @@ Reusable scripts that other automations call for notifications, lighting, safety
| [![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) | One-call "all interior lights off" helper. |
### Household notification icons
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 |
| `maintenance` | `mdi:tools` | Slate |
| `Phyn` | `mdi:water-alert` | Red |
| `Tesla_Model_Y` | `mdi:car-electric` | Blue |
| `Tesla_Tire_Pressure` | `mdi:car-tire-alert` | Orange |
| `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.
### 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.

@ -4,10 +4,15 @@
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# -------------------------------------------------------------------
# Notification Engine Scripts - Flexible push helpers for family devices.
# Related Issue: 1773
# Compose messages from value1/value2/value3 with optional actions.
# -------------------------------------------------------------------
# Notes: Optional notification tags let recovery actions target a specific push.
# Untagged callers retain their existing payload; groups are only visual.
# Tags control replacement; groups remain visual notification categories.
# Notes: Known groups receive colored MDI icons; other callers retain their payload.
# Explicit notification_icon/icon_url overrides are shared by both helpers.
# An empty notification_icon disables the group preset; iOS icons require a title.
# Docs: https://companion.home-assistant.io/docs/notifications/notifications-basic/#notification-icon-and-color
# Video Tutorial: https://youtu.be/mK1wdpxhLbM
######################################################################
### Script for Sending Notifications to Mobile Phones
@ -28,6 +33,13 @@
# - 'group': Notification group (optional, defaults to 'information').
# - 'tag': Stable notification identity for replacement or clearing (optional).
# - 'level': Interruption level for the notification (optional, defaults to 'active').
# - 'notification_icon': MDI icon override (optional; empty disables the group preset).
# - 'icon_url': Public or /local/ icon image (optional; takes precedence over MDI).
# - 'notification_icon_color': MDI glyph hex color (optional; app defaults to white).
# - 'color': MDI background hex color (optional; defaults to the group's color).
# Known groups: Medicine, Garbage_Reminders, Welcome_Home, maintenance, Phyn,
# Tesla_Model_Y, Tesla_Tire_Pressure, Printer, vacation, royal_caribbean_price_drop.
# clear_notification commands do not receive icon fields.
# The 'notify_engine_two_button' variant includes additional parameters for two interactive buttons:
# - 'title1', 'title2': Titles for the action buttons.
@ -71,7 +83,41 @@ notify_engine:
'push': {'interruption-level': level | default('active', true)}
} %}
{% set notification_tag = tag | default('', true) | string | trim %}
{{ dict(payload, tag=notification_tag) if notification_tag else payload }}
{% set payload = dict(payload, tag=notification_tag) if notification_tag else payload %}
{% set styles = {
'medicine': {'notification_icon': 'mdi:pill', 'color': '#6A1B9A'},
'garbage_reminders': {'notification_icon': 'mdi:trash-can-outline', 'color': '#2E7D32'},
'welcome_home': {'notification_icon': 'mdi:home-heart', 'color': '#00796B'},
'maintenance': {'notification_icon': 'mdi:tools', 'color': '#455A64'},
'phyn': {'notification_icon': 'mdi:water-alert', 'color': '#C62828'},
'tesla_model_y': {'notification_icon': 'mdi:car-electric', 'color': '#1565C0'},
'tesla_tire_pressure': {'notification_icon': 'mdi:car-tire-alert', 'color': '#C2410C'},
'printer': {'notification_icon': 'mdi:printer', 'color': '#455A64'},
'vacation': {'notification_icon': 'mdi:palm-tree', 'color': '#00796B'},
'royal_caribbean_price_drop': {'notification_icon': 'mdi:ferry', 'color': '#0277BD'}
} %}
{% set style = styles.get(group | default('information', true) | string | lower | trim, {}) %}
{% set icon = (notification_icon if notification_icon is defined and notification_icon is not none
else style.get('notification_icon', '')) | default('', true) | string | trim %}
{% set image_icon = icon_url | default('', true) | string | trim %}
{% if (icon or image_icon) and title | default('', true) | string | trim
and notify_message != 'clear_notification' %}
{% if icon %}
{% set payload = dict(payload, notification_icon=icon) %}
{% set glyph_color = notification_icon_color | default('', true) | string | trim %}
{% set background_color = color | default(style.get('color', ''), true) | string | trim %}
{% if glyph_color %}
{% set payload = dict(payload, notification_icon_color=glyph_color) %}
{% endif %}
{% if background_color %}
{% set payload = dict(payload, color=background_color) %}
{% endif %}
{% endif %}
{% if image_icon %}
{% set payload = dict(payload, icon_url=image_icon) %}
{% endif %}
{% endif %}
{{ payload }}
- choose:
- conditions: "{{ has_actions }}"
sequence:
@ -117,6 +163,10 @@ notify_engine_two_button:
tag: "{{ tag | default('', true) }}"
level: "{{ level | default('active', true) }}"
camera_entity: "{{ camera_entity | default('', true) }}"
notification_icon: "{{ notification_icon | default(none) }}"
icon_url: "{{ icon_url | default('', true) }}"
notification_icon_color: "{{ notification_icon_color | default('', true) }}"
color: "{{ color | default('', true) }}"
title1: "{{ title1 | default('', true) }}"
action1: "{{ action1 | default('', true) }}"
icon1: "{{ icon1 | default('sfsymbols:house.circle', true) }}"

Loading…
Cancel
Save

Powered by TurnKey Linux.