πŸ”” Notifications - Actionable Mobile Notifications Script, with optional Timeout Feature and Camera Snapshots [works with iOS/Android]

:christmas_tree: Version 2.0: Fields!

:arrow_double_down: Import Version | :link: Github Link | :male_detective:t2: Compare Changes

Multi-device Variant:

:arrow_double_down: Import Version | :link: Github Link | :male_detective:t2: Compare Changes

:memo: What’s Changed

If you are already using Version 2 Beta 2, you may skip this release.

:warning: Service to Notify has been deprecated, stay on v1.6.1 if you rely on this option.

Existing scripts that do not use the above should not be affected this release. :crossed_fingers:t2: 🫳🏻 :wood:

  • :beetle: iOS Notifications with Camera Snapshots showing Failed to load attachment.
  • :oncoming_automobile: Android: Added Show on Android Auto option.
  • :hourglass: Enable Timeout Action(s) option to dynamically disable timeout actions
  • :scroll: Fields Support Added! (requires Home Assistant 2023.11 or newer)

:question: How to update:

Home Assistant 2023.12 and up:

Before Home Assistant 2023.12:

:mag_right: Things to check after updating:

  • As usual, existing scripts should be loaded.
  • If you have switched between either variants, check out this reply.
  • Script should show one of:
    • Version 2.0
    • Version 2.0 - Multi-device.

:eyes: Preview:

Show/Hide: Script Fields Preview


Show/Hide: Script Fields with Templates


Example payload:

service: script.my_test_notifications
data:
  field_title: >-
    {{ state_attr("sun.sun", "friendly_name") }}
  field_message: >-
    {% if is_state("sun.sun", "above_horizon") -%}
      The sun rose {{ relative_time(states.sun.sun.last_changed) }} ago.
    {%- else -%}
      The sun will rise at {{ as_timestamp(state_attr("sun.sun", "next_rising")) | timestamp_local }}.
    {%- endif %}

Result:


Show/Hide: Script Fields in Automations with Templates


Version 2 - 12 Dec 2023

  • Fixed: iOS showing Failed to load attachment
  • Refactor: Build payload in templates
  • Deprecated: πŸ“² Notification Strategy due to refactor.
  • Deprecated: πŸ“² Service to notify due to refactor.
  • Added: Support for fields
    • Added: 🏷️ Title field
    • Added: πŸ’¬ Message field
    • Added: 🏷️ Subtitle field
    • Added: πŸ“Έ Attachment: Camera Entity: Camera Entity field
    • Added: Options show/hide fields
    • Added: βŒ›οΈ Enable Timeout and βŒ›οΈ Enable Timeout Action(s) fields.
  • Added: 🚘 Show on Android Auto option.
  • Added: βŒ›οΈ Enable Timeout Action(s) option and field.

Notes:

  • When enabling boolean fields with value of false, be sure to toggle them to true once, and then to false.
    There seems to be a bug where the boolean value is not passed if it’s enabled and value is false without the toggle.
  • If you rely on πŸ“² Service to notify, do not upgrade, Version 1.6.1 will be the last version supporting that feature.