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

Version 1.5 Beta 3 - 3 Oct 2023

  • Cleanup: Descriptions for Version 1.5 release
  • Added: Camera Entity default value and domain validation
  • Added: Prefix compatibility layer for iOS Action Icons

:warning: Please note, this is not a production release.

This beta release is meant help me find testers who have access to camera entities with video streams. Use at your own risk.


Again, thanks for testing it out @KameDomotics.

You can once again try the above script with this version, it should work right out of the box.

If you are not using the attachment_camera_entity and attachment_type fields, you may remove them from the yaml config (Iā€™ve added checks for them anyway so the script should also work if you leave it in).

Example
alias: " Conferma Disattivazione Allarme"
icon: mdi:shield-check
use_blueprint:
  path: samuelthng/notifications.yaml
  input:
    notify_type: notify_service
    notify_service_name: inanu
    title: Home Assistant
    message: Disattivare Allarme?
    confirm_text: Conferma
    dismiss_text: Annulla
    confirm_action:
      # Fire notify service to ensure service is called, remove after testing.
      - service: notify.notify_mobile_app_inanu 
        data:
          message: Conferma Test
      - service: alarmo.disarm
        data:
          entity_id: alarm_control_panel.alarmo
          code: "1111"

Iā€™m sorry but it doesnā€™t work, it doesnā€™t activate the action.
The test notification doesnā€™t even arrive

Hmm, then Iā€™m really at wits end. šŸ„²

Sorry about that @KameDomotics, also thank you for trying the many variations.

Iā€™ve checked out a few other popular notification blueprints and they use very similar methods to send the notification, so Iā€™m really perplexed as to why it wonā€™t show devices for your setup, nor send the notification via the notify service.

If you ever want to try debugging the issue, do feel free to hit me up in a direct message. :pray:t2:

You donā€™t have to thank me, Iā€™m the one thanking you for the effort youā€™re putting into fixing the blueprint.
Could it be an iOS problem? Or do you need to configure something in the Companion app regarding iOS?

If you explain to me how to debug I can try it

1 Like

Will chat with you over direct message!

Thank you for the quick processing.
I have tested it briefly with a camera at my house. Works flawlessly! Thank you!
Unfortunately NabuCasa is very slow right now and the notifications take more than 15 minutesā€¦ otherwise I could have tested more.

Hey @Yannik, thank you so much for confirming!
Was excited to see how the camera feature would pan out for you.

Iā€™ll be doing some cleanup and testing before releasing a stable version.

Iā€™m curious, however, do the notifications send slowly only with the camera entity attached for you, or all the time?

Thanks!
The delay probably came from NabuCasa. Today, notifications arrive within seconds, whether with or without a photo.

1 Like

So I did some more tests:
With a snap, no message is displayed. Just the title and subtitle.

Very good: if the camera is faulty, the message is sent without a snap.

I hope this will help. Thanks!

1 Like

:new: Camera Snapshots: Version 1.5

:link: Github Link :male_detective:t2: Compare Changes
See full changelog and historical changelogs here.
As usual, new additions are optional, existing scripts should not be affected this release. :crossed_fingers:t2:šŸ«³šŸ»šŸŖµ

  • :camera_flash: Send notifications with snapshots from camera entities!

  • :iphone: Users for whom devices do not show in the selector, the script now supports triggering the service by name now.

  • :broom:Updated and cleaned up input descriptions and blueprint description.

How to update

Things to check after updating:

  • As per usual, existing scripts should be loaded.
  • Script should show Version: 1.5.

Thanks for the script,

question, once i use my phone to confirm the notification, it doesnā€™t remove the notification from the phone but instead it trigger another notification to the phone again. Do i just have to wait for it to time out and then swipe it away?

here is the log when I tried to swipe away the notification after confiming the action.

Notification - Garage Door Open turned on triggered by automation Garage Door Open Notification triggered by state of Garage Door

11:45:50 AM - 21 minutes ago

:bell: Notifications started triggered by automation Garage Door Open Notification triggered by state of Garage Door

11:45:50 AM - 21 minutes ago - Traces

Notification - Garage Door Open turned off

11:45:50 AM - 21 minutes ago

Garage Door was closed

11:45:47 AM - 21 minutes ago

Notification - Garage Door Open turned on triggered by automation Garage Door Open Notification triggered by state of Garage Door

11:45:43 AM - 21 minutes ago

:bell: Notifications started triggered by automation Garage Door Open Notification triggered by state of Garage Door

11:45:43 AM - 21 minutes ago - Traces

Notification - Garage Door Open turned off triggered by automation Garage Door Open Notification triggered by state of Garage Door

11:45:43 AM - 21 minutes ago

Notification - Garage Door Open turned on triggered by automation Garage Door Open Notification triggered by state of Garage Door

11:45:39 AM - 21 minutes ago

:bell: Notifications started triggered by automation Garage Door Open Notification triggered by state of Garage Door

11:45:39 AM - 21 minutes ago - Traces

Notification - Garage Door Open turned off

11:45:39 AM - 21 minutes ago

Thanks for trying out the script! Well it should not trigger another instance of the script unless it is being called by another automation. There might have been a loop between your notification script and the automations using it, or it might be a miss on my end as well.

There are a couple of things to check, I have dropped you a direct message, we can debug it together.

Hello and thank you for creating this blueprint.

Sorry if my questions is noobish but where do I choose for example this
sensor ā€œbinary_sensor.lumi_lumi_vibration_aq1_vibrationā€ ā†
I want that I get a notification when the state of this Sensor changes.

Hey there @IssaSFX, thanks for checking out the blueprint.

First, youā€™ll have to craft a šŸ”” Notifications script using this blueprint.
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

After youā€™ve setup the notification script and have tested it with your device, youā€™ll be ready to create an automation. You can find the automations page here:
Open your Home Assistant instance and show your automations.

To use the script in the automation, you simply have to use the Call a service option in the Actions section of the page.

Hope this helps point you in the right direction.

1 Like

perfect thank you for the pointings, i will follow thru.
can you maybe give a short advise how i can test the script?
i importet the blueprint and setup the script.
Do i just run the new notification script to get a notification?

KR

@IssaSFX, youā€™re on the right track!

After youā€™ve created your script, you can simply test the notification without any automations setup.
Simply go to the script youā€™ve created, and select Run script from the menu button (three vertical dots) on the top right of the page.

You can perform a similar procedure to test the notification action on your automations.

As for the triggers and conditions of an automation, itā€™s a little more tricky to test automation conditions - that will have to depend heavily on how you are using your sensor and the conditions youā€™ve set. Might not be able to advise you fully regarding those.

P.S. I just realised thereā€™s a leak in the screenshot. :wink: New features brewing and under testing phase.


P.P.S - When testing your notification script, it is sometimes useful add notifications to the same device in the option actions and timeout actions so that you get a feedback on your device after clicking on a notification action. Gives you immediate feedback on which action has been performed.

You can do so by calling the notify service in the action of the script itself.
Example:

1 Like

thank you for beeing so vocal :smiley:
something is broken on my end, i dont get any messages on my phone but the companian app is installed and i get all data on the sensors.

Edit: After 10-15 minutes I got the timeout messageā€¦

last edit: Icon reference: https://sfsymbols.com/. <ā€” does not exsist btw.
Itā€™s late and I am confused, I will dig further tomorrow haha

Regarding Option Icons:

For confirm_icon and dismiss_icon, they should be icons that exists in the Apple SFSymbols library.

You can check if they are preventing the notifications by removing these icon fields and running the notification again.


Regarding device specific fields:
As you seem to be using an iPhone, the icon field will also not apply for you as thatā€™s for Android phones only.

You can see which fields apply to which devices in the labels of the fields.

Changes recommended for you

Hope this helps clarify!

thanky you for reply i will try your suggestions out now, just to clearfy the url sfsymbols.com does not exsist anymore, so maybe you can remove it.

1 Like

YES!!This now triggers instantly and reaches my iPhone 13 Pro Max.
image


Thank you very much :slight_smile:

1 Like