WTH?! Why do I get 15 old TTS messages when starting android companion app?

As the title suspects. When my Android companion app crashes or is “off”. OR when I turn on my wall tablet. And I restart the companion app again. It starts playling a lot of old TTS notify messages which are old an unuseful. Like “the gate has opened” and we were like huh why is the gate open? But these were old messages… the thing is playing all the missed TTSnotify.

by default notifications respect android doze and will wait for the device to come online or in your case to be restarted. If you check notification history you can see when they arrive. If you want them to appear immediately or not at all you need to follow the critical steps:

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

you can also stop TTS using a command if you find it happens often with your setup. the app should to really crash that often but without a bug report we cant fix it.

https://companion.home-assistant.io/docs/notifications/notification-commands#stop-tts

1 Like

I searched the forum for ‘doze’
I have a Pixel on Android 15 and it seems to ignore all the home assistant notification settings for some reason.
My automation has the channel set as important and also set to be a persistent notification and I’ve noticed since I got this new pixel it doesn’t wake the phone from doze and the notification isn’t persistent anymore.
I know the automation works fine as I’ve only had this phone about a month and it working great on that phone as well as my wife’s phone now.

that is not following the first link directly above, share teh YAML example if you are stuck so we can correct it.

Sorry yeah i have the priority and channel both set which should apparently wake my phone from a doze.

alias: Calendar notification
description: For Baileys tablets
triggers:
  - event: start
    entity_id: calendar.baileys_tablets
    trigger: calendar
actions:
  - data:
      title: Baileys Tablets
      message: "{{ trigger.calendar_event.description }}"
      data:
        actions:
          - action: tabsdone
            title: Done
          - action: URI
            title: Open Calendar
            uri: /calendar
        channel: tablets
        clickAction: noAction
        importance: high
        persistent: true
        icon_url: /local/images/icon/dog2.png
        notification_icon: mdi:dog
        car_ui: true
        tag: tablets
        priority: high
    enabled: true
    action: notify.mobile_app_steve_mobile
mode: single

you are missing ttl: 0 per the example in the link

ttl and `priority are highlighted only in that first example

1 Like

Thanks I’ve added that see if if helps later.

I have the same issues with my android tablet or phone as the OP. When they turn on, or connect to internet after being offline for a period of time, they receive all the TTS notifications that were sent while off or offline. I’ve tried clear_notification with a 30s delay after the TTS was sent, but it doesn’t seem to work with TTS. If I change the notification to text it works. Yes the tag is set correctly.

The command_stop_tts works but I’d have to know when the TTS notification is playing and send the command_stop_tts for each one, so it’s not a good plan.

I’ve search everywhen but can’t seem to find a good way to solve this.

Thanks.

sounds like you are not following the critical format to speed up delivery so they are received immediately: https://companion.home-assistant.io/docs/notifications/critical-notifications#android

Thank you for the quick reply! I actually do have the critical format. I did figured out something that works. I don’t know if this the intended way but it kind of makes sense.

So the clear_notification only clears text notifications, and it won’t do anything with the TTS ones. But if I send a command_stop_tts 10 seconds after my TTS notification, even if the phone is offline, when it does come online, both TTS and command_stop_tts notifications come in (in the right order so far) and the command_stop_tts keeps the TTS from going on.

It works and below is my automation code. Again I don’t know if clear_notification is only supposed to clear text notification but not TTS, and instead we need to use command_stop_tts, but this is how it works for me.

Thanks.

alias: garage closed NOTIFY
description: ""
triggers:
  - trigger: state
    entity_id:
      - sensor.sensor_garage_door_state_bu9dvzn1zaq1s2
    from: open
    to: closed
    for:
      hours: 0
      minutes: 0
      seconds: 0
  - trigger: state
    entity_id:
      - sensor.sensor_garage_door_state_bu9dvzn1zaq1s2
    from: opening/closing
    to: closed
    for:
      hours: 0
      minutes: 0
      seconds: 0
conditions: []
actions:
  - action: notify.phone_and_tablet
    data:
      message: TTS
      data:
        tts_text: >-
          The garage door just closed.
        tag: garage_open_closed_alert
        ttl: 0
        priority: high
  - action: notify.phone_and_tablet
    data:
      message: clear_notification
      data:
        tag: garage_open_after_dark_alert
        ttl: 0
        priority: high
    enabled: false
  - delay:
      hours: 0
      minutes: 0
      seconds: 10
      milliseconds: 0
  - action: notify.phone_and_tablet
    data:
      message: command_stop_tts
      data:
        tag: garage_open_closed_alert
        ttl: 0
        priority: high
mode: single