Notify.send_message for Mobile App

I’m working on fixing the deprecated notify.xxxxxx and changing these to notify.send_message. I’ve looked at Send a notification message - Home Assistant which specifies that all I have is “message” and “title” to specify. When sending notifications to my various HA Mobile Apps, I used to send images under the deprecated method. If I try to add images under data, I get " Error: extra keys not allowed @ data[‘image’]". Which makes sense if I’m no longer allowed to send images.

Am I reading the documentation correct that I can’t send images any more? If I can send images to the mobile app under the new notify structure, can anyone give me a hint on how to do this?

I also looked here: List of available actions - Home Assistant in case the mobile app had additional information I could use, but didn’t find anything.

I’ve found the documentation for notifications, well, somewhat lacking in clarity. I can’t even get clarity on exacting what is and is not being depreciated. I think what I found says that the stuff you defined in YAML is depreciated. It appears though, that mobile device notifications do still exist and are platform specific. So you can still send extra data with those. But they have the same naming convention as the depreciated stuff, so I can’t be sure I didn’t just move to another depreciated method. Anyway, here’s an automation I have that forwards all persistent messages to my phone. You can see that I have extra data in the payload to create the iOS button and the count badge (that doesn’t work with the send notification message thing you linked to).

alias: Forward HA Notification to Mobile
description: ''
triggers:
  - event_type: call_service
    event_data:
      domain: persistent_notification
      service: create
    trigger: event
conditions: []
actions:
  - action: counter.increment
    metadata: {}
    target:
      entity_id: counter.notification_count
    data: {}
  - action: notify.mobile_app_kyles_iphone
    metadata: {}
    data:
      message: '{{trigger.event.data.service_data.message}}'
      title: '{{trigger.event.data.service_data.title}}'
      data:
        push:
          badge: '{{states("counter.notification_count")}}'
        actions:
          - action: CLEAR_ALERTS
            title: Mark All as Read
mode: queued

For anything mobile app related my go to is the Companion App Docs.

Companion App notification attachments docs

Very helpful. I’ll use it as a guide and see if I get going.

Thanks for the link. I never saw this.

Again, Thanks for the info and I read the docs referred to in your and Happy Cadaver’s posts.
In your post you are using “action: notify.mobile_app_kyles_iphone” which is what I think is deprecated and we are supposed to move to:

action: notify.send_message
target:
  entity_id: notify.mobile_app_kyles_iphone

I can get this new form to work for sending text. But no matter what I try, I get errors trying to send images like I could in the old method. If I try something like this:

alias: Notify Phone via HA app
continue_on_error: true
action: notify.send_message
data:
  message: '{{ full_message }}'
  data:
    entity_id: camera.front_door_clear
target:
  entity_id: notify.my_ha_iphone_17

I get the error " Error: extra keys not allowed @ data[‘data’]".
If I remove the following:

  data:
    entity_id: camera.front_door_clear

The notification works, but obviously as text only.
I’ve tried “Image: {Image Here}” and I get the same error, except referring to the word “image”.

The error “Extra Keys Not Allowed” seems to mean to me the keywords themselves are now unsupported. Under the new notification structure, is it possible images have just been dropped?

I thought I was getting ahead of the game on future deprecations, but I guess I’ll need to go back to the deprecated way since it works.

The action notify.send_message only supports message and title.

If you need to use extended data, you will need to use the notify.mobile_app_<device_name> action.

This is the confusing part. I’m pretty sure what’s depreciated is the YAML creation of notification things. The one I’m using seems to be part of core HA. I didn’t create it, I think HA exposes it as part of the mobile app integration. Here’s the documentation that talks about the mobile app notify platform:

I can’t find anything saying that is depreciated. But it looks kind of like the thing that is being depreciated. So maybe I’m wrong. Maybe I’m right. Either way, It’s the one I’m using because the other method doesn’t support the features I need to send notifications.

Yeah, I’m just going to forget about it and use the old ways that work and worry about it when (and if) old methods are actually removed. Thanks.