šŸ“ State Notifications & Actions

Novice here, soā€¦thank you for the Blueprint.
Exactly what I was looking for.

Iā€™ve added a bunch of Aqara entry sensors to the blueprint, Aqara sensors seem instantaneous, arrival of push varies in arrival time.

The push to device is my phone. Samsung S23 Ultra, Android. Nothing else added yet.

What am I doing wrong if anything? Can I fix it somehow?

If using notify and the companion app I read about priorities and some other things, but that doesnā€™t appear to be an option to push to. Or something like that.

So I donā€™t understand what I need to do to make sure push notifications are as fast as possible.

@G2740

If you are notifying a device it should be fast. notifications take about < 1 second.

Could you please provide us your YAML of the automation? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on ā€œ</>ā€ and paste code in there.

Blacky :smiley:

Here you go and thanks for the time.

Let me say my Zigbee is Zha, all Aqara entry sensors.

Iā€™ll keep troubleshooting as Iā€™m uncertain whatā€™s happening. Zigbee visualization looks as usual.

What I think I may be seeing, but am still investigating. I ran some test.

Iā€™d listen for her to open a door that gets opened often. And expect a ping on my phone. Sound and push.

It seemed delayed, amount not determined yet.

But them on second test, I stood right at the door and opened and closed several times. Pined every time fast. Only did that 4 or 5 times. Sheā€™ll think Iā€™m losing it. :joy: Novice doesnā€™t even know how to paste code. Lol

If I discover any rhyme or reason Iā€™ll post.

Im certainly not blaming the Blueprint, just puzzled. Yaml :point_down:.

type or paste code here
alias: "Aqara Sensor Has Opened "
description: Something is up, Sensor Opened - investigate why
use_blueprint:
  path: Blackshome/state-notifications-and-actions.yaml
  input:
    entity_a_trigger:
      - binary_sensor.aqara_back_door_opening
      - binary_sensor.aqara_basement_inner_door_opening
      - binary_sensor.aqara_basement_outer_door_opening
      - binary_sensor.aqara_basement_window_1_opening
      - binary_sensor.aqara_basement_window_2_opening
      - binary_sensor.aqara_basement_window_3_opening
      - binary_sensor.aqara_basement_window_4_opening
      - binary_sensor.aqara_computer_rm_window_opening
      - binary_sensor.aqara_dave_s_bathroom_window_opening
      - binary_sensor.aqara_front_door_opening
      - binary_sensor.aqara_inner_garage_door_opening
      - binary_sensor.aqara_laundry_room_window_opening
      - binary_sensor.aqara_outer_garage_door_opening
      - binary_sensor.aqara_north_garage_window_opening
      - binary_sensor.aqara_toy_rm_window_1_opening
      - binary_sensor.aqara_toy_rm_window_2_opening
    entity_a_state: "on"
    time_delay_a_state: 0
    include_start_notify: enable_start_notify_options
    start_notify_device:
      - 98157786e5ad0eca1d113ad34ccd49fc
    start_title: "Entry Sensor Has Opened "
    start_message: "An Entry Sensor Has Opened - Investigate "

So it looks like it is working :+1:

Here is a TIP

Because you have a lot of sensors you can have the notification tell you what sensor opened so you know what is going ON.

  • For getting your entity ID in the message use this
{{ trigger.entity_id }}

  • For getting the friendly name of your entity in the message use this
{{ states[trigger.entity_id].attributes.friendly_name }}

Hope this helps you.

Blacky :smiley:

1 Like

Ok, thank you and for the tips.

FAQ: How do I include the sensor name that triggered the automation in the message?

If you have many sensors (e.g., all your window sensors), you can configure the notification to indicate which sensor triggered the automation. This helps you identify what happened more easily.

1. For getting your entity ID in the message use this

{{ trigger.entity_id }}

Or in a custom action

service: notify.mobile_app_your_device_here
data:
  title: Window Open
  message: "{{ trigger.entity_id }}"

2. For getting the friendly name of your entity in the message use this

{{ states[trigger.entity_id].attributes.friendly_name }}

Or in a custom action

service: notify.mobile_app_your_device_here
data:
  title: Window Open
  message: "{{ states[trigger.entity_id].attributes.friendly_name }}"

Enjoy

Blacky :smiley:

Back to FAQ: Click Here

1 Like

No problem, your welcome.

Blacky :smiley:

1 Like

Just to follow up, and in case anyone else runs into the issues, still looking lol, Iā€™m leaning towards some Samsung setting or restriction. Iā€™ve scoured the settings.

Last change was AOD on. In searching Iā€™ve seen similar issues with Samsung, mostly unresolved where some notifications donā€™t come thru until unlocked or awakened. All those unrestricted etc settings are there, run in background for HA, etc. etc.

If the phones open, theyā€™re instant.

I use biometrics, fingerprints.

I looked at HA itself, donā€™t fully understand all yet, still reading about priorities and channels etc. in the companion app. Or an HA bug perhaps. Iā€™m using HA Beta.

Your blueprint is working fine. I havenā€™t added actions or refined further until I figure out this HA, Samsung issue.

Iā€™m leaning Samsung S23 Ultra and/or Android.

Why only one notification ā€œthat Iā€™m awareā€ of does this is beyond me so far. Iā€™ll keep searching.

Further, Iā€™m reading this with interest, flagged as the solution in a post in HA forum. How I implement, I have to figure out. :joy:

The article I linked appears to have the fix for Androids not getting notifications on lock screen. Added at bottom of Blueprint Yaml appears to fix, so far. :+1: I am not a programmer. Lol

data:
ttl: 0
priority: high

Edit; or maybe not.:person_shrugging::thinking:

@G2740

Hi Dave

Thanks for reaching out. I understand the code, but all of this is already under development. I am currently waiting for Home Assistant (HA) as there might be a bug, not in what youā€™re doing, but elsewhere in the notifications. I have reported it to HA, and I am confident they will resolve it in due time. Once this is fixed, we can resume testing, and when it all checks out, we will release an update. This applies to all my notification blueprints.

Edit: Development has started again and will be an option to just select.

Blacky :smiley:

1 Like

FAQ - A Guide to Notification Options on iOS and Android Devices

:apple: iOS ONLY OPTIONS

What are Notification Interruption Levels on iOS?

On devices running iOS 15 and later, you can configure the interruption level for your notifications to ensure they are delivered according to your preferences. This feature allows you to choose how notifications are presented and how they interrupt your activities.

Interruption level Breaks through Focus Overrides Ring/Silent switch on iPhone and iPad
Default No No
Critical Notification Yes Yes
Time Sensitive Notification Yes - Must be enabled in focus No
Quiet notifications without waking screen No No

Notification Sound - iOS Only

The Home Assistant app for iOS includes built-in notification sounds, and you can import sounds from your iOS device into the app. Custom sounds can also be added via iTunes or from your cloud storage.

:warning: Note: In the blueprint, make sure to enter the full filename (including the file extension) in the Notification Sound (iOS Only) input, as shown below. If left blank, your device will play the default notification sound based on its settings.

  • Built-in Notification Sounds:

    1. In the Home Assistant app, depending on your access you have 2 options, go to
      • Settings > Companion App > Notifications > Sounds.
      • App Configuration > Notifications > Sounds.
    2. Tap the Bundled tab.
  • iOS Device Sounds:

    1. In the Home Assistant app, depending on your access you have 2 options, go to
      • Settings > Companion App > Notifications > Sounds.
      • App Configuration > Notifications > Sounds.
    2. Tap the System tab, then Import system sounds.
    3. Wait for the sounds to load and restart your device.
  • Via iTunes:

    1. Connect your device and open iTunes.
    2. Select your device and go to File Sharing.
    3. Choose Home Assistant and add your WAV files (formatted as 32-bit float 48000Hz).
    4. Click Sync and disconnect the device.
    5. In the Home Assistant app, depending on your access you have 2 options, go to
      • Settings > Companion App > Notifications > Sounds.
      • App Configuration > Notifications > Sounds.
    6. Tap the Import tab and select Import sounds from iTunes File Sharing.
  • Via Cloud Storage:

    1. Install and log in to your cloud storage app (e.g., Dropbox, Google Drive).
    2. Upload your WAV files (formatted as 32-bit float 48000Hz) to the cloud.
    3. In the Home Assistant app, depending on your access you have 2 options, go to
      • Settings > Companion App > Notifications > Sounds.
      • App Configuration > Notifications > Sounds.
    4. Tap the Import tab, select Import custom sound, choose your files, and tap Done.
    5. Restart your device if needed.

:robot: ANDROID ONLY OPTIONS

What are High Priority Notifications?

Notifications will appear immediately in most cases. However, in some cases (such as when the phone is stationary or when the screen has been turned off for a prolonged period of time), default notifications will not ring the phone until the screen is turned on. High priority notifications are designed to alert you to important events or updates that require your immediate attention, ensuring they are received promptly even in these situations.

What are Sticky Notifications?

Sticky notifications are a type of notification that remain on your deviceā€™s notification shade until they are manually dismissed by the user. Unlike regular notifications, which can disappear when they are tapped, sticky notifications ensure that important messages are persistently visible until you actively clear or swipe them away, ensuring that critical information stays visible until addressed.

Notification Channels

What are Notification Channels?

Notification channels are a feature for Android devices only. They allow you to categorize notifications, making it easier to manage and prioritize them. Each channel can have its own settings, such as notification style, sound, vibration, blink light, app icon badges, locked screen, and do not disturb, ensuring that you receive notifications in the manner most appropriate for each type of notification you receive.

How Do I Create a Notification Channel?

Before creating channels, it is best to consider what channels you would like to have for your notifications. This will help you structure it correctly, as once you create a channel, it can be removed but will never be deleted unless you reset your app. Taking the time to consider how you would like it structured will help you in the long run.

Some ideas for a channel structure are as follows:

You could just set the notification type. Emergency, General Notification, Dinner Ready, Time for Bed, Appliance Finished, etc.

Or maybe something like this.

  1. Critical
  • Sound and pop-up.
  • Vibrate.
  • Blink light.
  • Locked screen.
  • Ignore Do Not Disturb.
  • Description : Notifications for emergency situations (e.g., fire alarm, flood alert, smoke detector, carbon monoxide detector, security breaches).
  1. High
  • Sound and pop-up.
  • Vibrate.
  • Locked screen.
  • Ignore Do Not Disturb.
  • Description : Notifications for reminders (e.g., upcoming appointment, power outage, rubbish reminder).
  1. General (Default)
  • Sound.
  • Vibrate.
  • Description : Notifications for general updates (e.g., appliance finished, battery low).
  1. Low
  • Silent.
  • Vibrate.
  • Description : Notifications for less critical updates (e.g., appliance started, unavailable sensor, battery low).
  1. Minimal
  • Silent and minimized.
  • Description : Notifications for non-urgent updates (e.g., reminder, Home Assistant update avalible).

To create a new channel, simply enter a name in the input. When your automation sends the first notification, it will create the channel on your device. After the channel is created, you can customize its notification settings to your preference directly on your device.

How Do I Edit a Notification Channel?

There are a few ways to do this:

  1. On your device, go into Settings > Notifications > Home Assistant and you will see categories. These are your channels. Select the one you would like to customize and make your adjustments.
  2. When a notification is received, slowly slide it to the left and you will see a settings icon. Click on it, and it will take you to categories. These are your channels. Select the one you would like to customize and make your adjustments.

How Do I Delete a Notification Channel?

I have a blueprint that will help you remove a notification channel. See link below.

:robot: Android Notification Channel Manager

Hope this helps to explain some of the settings :face_with_monocle:

Enjoy

Blacky :smiley:

Back to FAQ: Click Here

New Update 1.3

This is a big update hope you like it.

:warning: Previously, if you selected an Android device, Sticky Notification was automatically included by default, with no option to disable it. Now, you have the flexibility to enable or disable this feature. If you wish to maintain the previous behavior, please ensure that the Sticky Notification option is enabled in both the start and end notify settings.

:new: New Feature - Collapsible Sections

  • Collapsible Sections - Added collapsible sections to the blueprint. This enhancement improves the blueprint user interface by making it cleaner and more organized, allowing sections to be collapsed.

    :warning: This feature was introduced in Home Assistant 2024.6, so you must have this version or later for the blueprint to work.

:new: New Feature - Confirmation Message

  • Confirmation Message - You can now have a different confirmation messages depending on your actions.

:apple: New Feature For iOS

  • Interruption Level - On devices running iOS 15 and later, you can now configure the interruption level for your notifications to ensure they are delivered according to your preferences. Choose the desired interruption level from the dropdown list. Critical and time-sensitive notifications must be turned ON within the Home Assistant App, and time-sensitive notifications must be allowed in your Focus settings.

:robot: New Feature For Android

  • High Priority notifications ensure that you receive important alerts immediately. These notifications bypass normal delivery delays and are delivered instantly to your device.

  • Sticky Notification ensure that important alerts are not dismissed when selected. They remain on your notification screen until you actively clear or swipe them away, ensuring that critical information stays visible until addressed.

  • Notification Channel allow you to easily organize different notification settings, including notification sounds, vibrations, and other device-specific features. Before crating a channel make sure you understand them and how they work. I have a FAQ that has information on channels, click here.

:toolbox: Maintenance

  • Set blueprint to my new layout.
  • Update input descriptions.
  • Clean up of some code :broom:

:rocket: Performance Upgrade

  • Some performance enhancements.

If you like this blueprint? Consider hitting the :heart: button in the top post :+1:

If you like my blueprints, and would like to show your support or just say thank you? Click Here :smiling_face_with_three_hearts:

Enjoy

Blacky :grinning:

1 Like

Blacky, Thanks for all the hard work on your blueprints. I am working with a couple of the notification blueprints and they both are having the same issue. If I use a standard notification it works fine. I receive it right away on my phone. however, once I enable Action button. I stop getting notified. nothing comes to the phone. Looking at a trace it looks to hang at waiting for a response but without the notification I canā€™t respond. I have checked and enabled all notification settings on the app on the phone. but I canā€™t seem to find the issue. Using a pixel 7. any help would be much appreciated.
Thanks.

@chesedro

Hi Tom, welcome to the community.

I just tested it here on a iPhone and Galaxy S8 and it is all working fine. Make sure you understand channels if you are using them.

Could you please provide us your YAML of the automation? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on ā€œ</>ā€ and paste code in there.

Blacky :smiley:

Thanks for your help on this. This is a test automation I created to troubleshoot. Nothing fancy. I feel like itā€™s something simple. maybe even on the phone itself. I did test with ā€œHigh Priorityā€ ā€œStickyā€ and ā€œNotification Channelā€ same result. they all work fine until I enable the Start action button. Thanks again for your help on this.

To add: I created a quick automation manually but this time I used the Call Service Notification: this does work and presents the button in the notification just fine. Not sure what is different between the two methods.

`alias: Test-Notify
description: ""
use_blueprint:
  path: Blackshome/state-notifications-and-actions.yaml
  input:
    entity_a_trigger:
      - switch.living_room
    entity_a_state: "off"
    include_start_notify: enable_start_notify_options
    start_notify_device:
      - 0cb6a2d576dfe8bbf2d25d7bcc4cdb2b
    start_title: Not sure
    start_message: Will this work
    start_notify_data:
      - high_priority
    include_start_action_buttons:
      - enable_start_action_button_1
    start_action_button_1: Work Please
    include_start_auto_actions: []
    start_action_1:
      - service: switch.turn_off
        metadata: {}
        data: {}
        target:
          device_id: e32dcfd1b314bcc632dbb603dfb35d85
    start_time_delay:
      hours: 0
      minutes: 1
      seconds: 0
    include_start_action_button_confirmation: disable_start_action_button_confirmation
    start_notify_interruption_level: active`

@chesedro

Hi Tom,

I can see the problem now. It is not really a bug, but I will need to address it. With Android if you donā€™t put a name in the cancel button it will not work :pensive:. With iOS it will work :person_raising_hand:. So others donā€™t have this problem into the future I will have to add a default in. Below is your YAML. Copy and paste it in as I also saw there were quotes that shouldnā€™t be there, I think it was when you pasted it into this forum :face_with_diagonal_mouth:

Thanks for reaching out and letting us know as this will help other in the future :+1:

Your YAML below, copy it and replace your YAML.

alias: Test-Notify
description: ""
use_blueprint:
  path: Blackshome/state-notifications-and-actions.yaml
  input:
    entity_a_trigger:
      - switch.living_room
    entity_a_state: "off"
    include_start_notify: enable_start_notify_options
    start_notify_device:
      - 0cb6a2d576dfe8bbf2d25d7bcc4cdb2b
    start_title: Yep Working!
    start_message: Your Welcome, Blacky :)
    start_notify_data:
      - high_priority
    include_start_action_buttons:
      - enable_start_action_button_1
    start_action_button_1: Work Please
    include_start_auto_actions: []
    start_action_1:
      - service: switch.turn_off
        metadata: {}
        data: {}
        target:
          device_id: e32dcfd1b314bcc632dbb603dfb35d85
    start_time_delay:
      hours: 0
      minutes: 1
      seconds: 0
    include_start_action_button_confirmation: disable_start_action_button_confirmation
    start_notify_interruption_level: active
    start_action_button_stop: Cancel?

Let us know how you go.

Blacky :smiley:

Blacky,
That worked perfect. such a simple thing. Thanks so much. I do appreciate all your help with this.

T

Tom,

No problem your welcome, it is updated with a warning now. Push the update and you will receive it.

Blacky :smiley:

New Update 1.4

:toolbox: Maintenance

  • Updated descriptions warnings on action buttons that may prevent the automation from functioning correctly and could result in not receiving the notification.

If you like this blueprint? Consider hitting the :heart: button in the top post :+1:

If you like my blueprints, and would like to show your support or just say thank you? Click Here :smiling_face_with_three_hearts:

Enjoy

Blacky :grinning: