#Horribly confused by our iPhones in HA and notifications.

1 messages · Page 1 of 1 (latest)

fleet sigil
#

I've been trying to sort this out for a couple hours now. I've read the Notifications documentation:
https://www.home-assistant.io/integrations/notify as well as this:
https://companion.home-assistant.io/docs/notifications/notifications-basic/

I'm still super stuck.

In the "Mobile App" Integration I see 4 entries, one of which I've disabled:

In Devices I see 3 entries with "iPhone" in the name:

In Entities I see 2:

And now for the real head scratcher - when I try to add a Notification Action I see these options:

#

If I focus just on my phone (the one right here on my desk) it's named Steve iPhone 12MLW in the Mobile App, Device and Entity pages. But I don't see it as an Action option in the list. I've 2x confirmed all Notification settings are enabled on my phone. I've confirmed Notifications are enabled in the companion app.

I don't understand any of this, not sure where to start to make sense of it.
To try to ask some specific questions:

  1. Why might my phone be missing in the Actions list? These actions are auto generated (I read that in the notify documentation in the Companion App notifications section)
  2. Is there any documentation that I can read that will help me make sense of the Mobile App entries, the Device entries and the Entity entries? They're clearly related in some way, but not consistent or at least I'm not understanding why I see different number of items on different pages.
  3. Is there a clean way to just throw it all out and start over? Without starting fresh with HA?
#

Out of desperation I deleted my phone entry from the Mobile App integration. Not disabled, deleted. I started the app on my phone and a new entry popped into the Mobile App Integration with the same name I had set before. So... not really deleted :/

unreal lily
#

it sounds silly, but did you scroll that list to see if there are other entries in the Action list?

#

the scroll bar indicates that it's a longer list

fleet sigil
#

Not silly, I noticed the same and yes, I checked but not there

unreal lily
#

it seems like you have three phones enabled and three services, so just the names don't match up?

#

the service names may not adapt if you change the device or entity names

fleet sigil
#

Maybe, I'm not terribly sure still how all this relates, but I'm getting closer.
It looks like the Mobile App Integration auto creates a Device that represents the phone.
I've deleted 2 of the phones and reduced the Mobile App to just the two phones I care about

#

If I now look at the Devices list and filter by "iPhone" in the name I see entries that match the entries in the Mobile App list:

#

And the Entities list now also better aligns with things. I suspect before that my wifes phone was double registered in the Mobile App which created a defacto duplicate Device, but then the Entities list was smart enough to consolidate/merge the duplicate entities. This is just my theory, but it would explain some things.

#

AND... I think I maybe see what the Actions list is showing. I believe the auto generated Actions have the original Device name that was used when the Mobile App Integration created the phone Devices.

#

This little exercise brings me right back to your last message when you say:

...the service names may not adapt if you change the device or entity names...

unreal lily
#

Yes, that's what I was trying to point out

#

In the end, I just make a script to send a notification and only worry about the actual service name in there. I just call the script everywhere I want to send a notification

fleet sigil
#

That's funny because I also have a script for the same reason, but when I ran it (it's been a while) I didn't get the notification on my phone and that's what sent me down this rabbit hole.

unreal lily
#

BTW, at some point mobile_app will move to notify entities and use notify.send_message or something like that and it will be a lot clearer

#

I don't know what's taking so long for mobile_app

unreal lily
fleet sigil
#

Update: I've got things back under control. That forum post was the key - renaming the device on the companion app, deleting the entry from the Mobile App Integration and then restarted the Mobile Companion app worked. The Action was created with the expected name and there is peace in the world once again.
I'm glad improvements are on the way because this is pretty convoluted!

Thanks for working through this with me 🙂
Here's my super simple script. I'd be curious if you've done anything clever with yours. I don't have the critical support implemented, I knew I wanted it but haven't put in the time to do it yet.

sequence:
  - action: notify.mobile_app_steves_iphone_12mlw
    metadata: {}
    data:
      message: "{{message}}"
      title: "{{title}}"
  - action: notify.mobile_app_katys_main_phone
    metadata: {}
    data:
      message: "{{message}}"
      title: "{{title}}"
    enabled: false
alias: Send Phone Notification to Katy and Steve
description: Parameterized script to send push notifications to Steve and Katy's phones.
fields:
  message:
    selector:
      text:
        multiline: true
    name: message
    required: true
    description: Enter the body of the notification
  title:
    selector:
      text: null
    name: title
    description: Enter an optional title for the notification
  critical:
    selector:
      text: null
    name: critical
    description: >-
      Select if this is a critical notification. It will result in a higher
      priority, possibly interrupting notification on target devices.
    default: "false"
#

(updating tags to "Resolved")

unreal lily
#

mine are quite simple:

notify_iphone:
  sequence:
    action: !secret iphone_service
    data:
      title: "{{ title }}"
      message: "{{ message }}"
      data:
        push:
          sound: "BatteryMagsafe_Haptic.caf"

notify_iphone_camera:
  sequence:
    - action: !secret iphone_service
      data:
        title: "{{ title }}"
        message: "{{ message }} {{ entity_id }}"
        data:
          push:
            sound: "BatteryMagsafe_Haptic.caf"
          entity_id: "{{ entity_id }}"
#

the "urgent" one is more complicated because it uses actionable notifications:

notify_iphone_urgent:
  sequence:
    - alias: "Set up action variables"
      variables:
        # Including 'id' in 'action' allows us to identify this script run
        # and not accidentally trigger for other notification actions
        action_clear: "{{ 'CLEAR_' ~ context.id }}"
    - action: !secret iphone_service
      data:
        title: "{{ title }}"
        message: "{{ message }}"
        data:
          push:
            sound:
              name: "Fanfare.caf"
              critical: 1
              volume: 1.0
            badge: 1
          actions:
            - action: "{{ action_clear }}"
              title: "Clear"
    - alias: "Wait for a response"
      wait_for_trigger:
        # We wait for specific actions because we don't want to run for 
        # any action, only for a response to the one we just sent
        - trigger: event
          event_type: mobile_app_notification_action
          event_data:
            action: "{{ action_clear }}"
      timeout:
        seconds: 10
      continue_on_timeout: false
    - alias: "Acknowledged, clearing the badge"
      action: !secret iphone_service
      data:
        message: clear_badge