Mobile App Notifications Are Slow (Android)

device_id: 273318dbedeb3e47b6fd7f3ac458b4eb
domain: mobile_app
type: notify
message: "SEWER PUMP ALARM "
data:
  ttl: 0
  Priority: high
  car_ui: true
  channel: ha_notifications
  importance: high

Notification on motion detection in garage

actualy disregard my last message.

should be

priority: high

case sensitive

Edit: both pasted examples show the incorrect casing

I have it both ways doesnt matter tried that too. This is one i didnt chnage back

thats not what I meant, whats your phone? samsung? Xiaomi? Pixel?

Will switch bith back and see but ive tried denovo notifications copied directly from link and changing my entity, doesnt work

it indeed matters what casing you put in regardless of functionality, YAML is a case sensitive language.

not consistent becaue car ui can be lowercase and it works

they sll need to be lowercase, look at the provided examples in the official docs

https://companion.home-assistant.io/docs/notifications/notifications-basic

I will change it back and see. As I said I copied the example from the link you sent changed my entity and had the same response so it doesnā€™t appear to make a difference but I will redo those notifications and see what happens.

In those I know there wasnā€™t a typo because it was a direct copy and paste and the only thing I changed was my entity but weirder things have happened Iā€™m willing to give it a shot. I appreciate your help

Still happening.

alias: Garage motion group test
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.garage_motion_sensors
    to: "on"
condition: []
action:
  - service: notify.mobile_app_shawn_cell
    data:
      message: Garage Motion
      data:
        importance: high
        ttl: 0
        priority: high
        car_ui: true
        channel: ha_notifications
        vibrationPattern: 100, 1000, 100, 1000, 100
mode: single

what phone is this happening on?

I have noticed this since late last year too. Iā€™m on a pixel 7 pro
here is an example of a notification i have had setup for years, used to be near instant and now is slow sometimes 30sec to a minute.
one thing i did notice last week was my ring camera notification is still instant, and if i get a ring notification i get the HA camera notification at the same time. if i trigger a camera thats not near the ring camera and the phone is idle it will take a long time.

service: notify.mobile_app_chris_p7p
data:
  message: >-
    {{trigger.to_state.name[:-7]}} Camera triggered by a {{ states('sensor.'
    ~trigger.to_state.name[:-7]~'detections')}} at {{ as_timestamp(now()) |
    timestamp_custom('%H:%M') }}
  title: Motion Alarm
  data:
    color: red
    notification_icon: mdi:motion-sensor
    channel: MotionDetect
    ttl: 0
    importance: high
    priority: high
    vibrationPattern: "100, 1000, 100, 1000, 100, 250, 1000, 250 "
    clickAction: /lovelace/motion-sensors
    actions:
      - action: alarm
        title: Alarm!
      - action: URI
        title: Snooze all cameras
        uri: entityId:input_number.motion_global_snooze_time
      - action: URI
        title: Snooze this camera
        uri: >-
          {{ 'entityId:input_number.' ~trigger.to_state.object_id~'_snooze_time'
          }}
    image: /api/camera_proxy/camera.{{trigger.to_state.object_id}}_snap

does the app have background access?

i donā€™t have my phone with me right now to check, iā€™m pretty sure it does.
i have noticed every time i open the app it takes ages to connect. and the quick tiles take a bit to refresh, and they donā€™t all refresh at the same time.

in the docs it mentions this: For Android, notifications will appear immediately in most cases. However, in some cases (such as phone being stationary or when screen has been turned off for prolonged period of time), default notifications will not ring the phone until screen is turned on.

which is exactly whatā€™s happening even with priority: high and ttl: 0 .

so these have nothing to do with the device receiving a notification, if you look at the apps notification history you will see a date printed with each message. That is the actual timestamp the app received the notification from firebase.

According to the firebase docs this is what is needed in order to show a notification immediately. For me on my Pixel 8 Pro with background access granted to the app my notifications always show up timely when using these parameters.

I know some manufacturers like Samsung like to add additional battery saving methods that needs to be disabled. Thigns like data saver, power saving etcā€¦

Iā€™m on a Samsung Galaxy s23 Ultra. Itā€™s better in the last few days but still not 100%.

I noticed thereā€™s a blueprint available to create a actionable notification and it comes directly from home assistant as the author of The blueprint. I played with it so Iā€™m thinking maybe some of the subtleties of the yaml code and those issues might be removed if I were just running the blueprint.
But I donā€™t see any way to add the necessary Android specific priority measures to the blueprint. Is there an easy way to do this? Iā€™m fine running a blueprint and creating a script itā€™s a lot less labor intensive but it doesnā€™t help me if it spits out a generic notification thatā€™s going to be riddled with the same problems.

It might be nice to have a checkbox to allow you to add the priority the channels and the other specs if needed.

1 Like

At this moment April 25 2024 it is more worse sometimes it takes 12 minutes to deliver

What type of phone? Does it make any difference if the phone is unlocked and screen active? If android do you have ttl: 0 and priority: high in data for android or interruption-level: time_sensitive/critical in ios?

are you not following the critical format? they show up immediately everytime when you do.

https://companion.home-assistant.io/docs/notifications/critical-notifications#android