Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Stan-Gobien/9739d3781bd909e8990f6095a77f43e3 to your computer and use it in GitHub Desktop.
Save Stan-Gobien/9739d3781bd909e8990f6095a77f43e3 to your computer and use it in GitHub Desktop.
HA_RestartNotification_Collapsable_Tag
blueprint:
name: Home Assistant Restart Notification
description: Notify a user that Home Assistant has successfully restarted
domain: automation
input:
notification_title:
name: Notification title (Optional)
description: 'Default: "Home Assistant"'
default: Home Assistant
notification_message:
name: Notification message (Optional)
description: 'Default: "Home Assistant has succesfully restarted!"'
default: Home Assistant has succesfully restarted!
notify_device:
name: Device to notify
description: Device needs to run the official Home Assistant app to receive
notifications
selector:
device:
integration: mobile_app
is_ios:
name: Is it an iOS device?
description: Toggle if your selected device runs iOS, default is Android (false)
selector:
boolean:
default: false
trigger:
platform: homeassistant
event: start
variables:
notification_title: !input notification_title
notification_message: !input notification_message
notify_device: !input notify_device
is_ios: !input is_ios
action:
- device_id: !input notify_device
domain: mobile_app
type: notify
title: "{{ notification_title }}"
message: "{{ notification_message }}"
data: >
{% if is_ios %}
{% set platform_data = { "channel": "restart_notification", "apns_headers": { "apns-collapse-id": "restart_notification" }, "push": { "category": "restart_notification", "sound": { "name": "default", "volume": 1.0 } } } %}
{% else %}
{% set platform_data = { "tag": "restart_notification", "channel": "restart_notification", "group": "restart_notification" } %}
{% endif %}
{{ platform_data }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment