Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android - alarm_stream notifications still silent #1186

Closed
BigDoom opened this issue Nov 10, 2020 · 20 comments · Fixed by #1428
Closed

Android - alarm_stream notifications still silent #1186

BigDoom opened this issue Nov 10, 2020 · 20 comments · Fixed by #1428
Labels
bug Something isn't working notifications

Comments

@BigDoom
Copy link

BigDoom commented Nov 10, 2020

Home Assistant Android version:
BETA-515bd2ebb0-full
Android version:
v10
Phone model:
SM-A405FN
Home Assistant version:
0.117.5
Last working Home Assistant release (if known):
n/a

Description of problem:
Ongoing problems with alarm_stream notifications not making an audible sound. Beta-515 might have resolved it, but unfortunately not the case. Ongoing issue as reported in #1159 and #1167

Trying this didn't work either:

There is another workaround you guys can use in the meantime while we try to figure things out. As part of 3.0 we also introduced new notification commands that will allow you to change the devices ringer mode or do not disturb setting. You can also use the corresponding sensors for these commands to determine the old state and send another command to set it back. I know its not exactly what this feature is but it should at least allow you to get by in the meantime.

Traceback (if applicable):


Screenshot of problem:

Additional information:

@BigDoom BigDoom added the bug Something isn't working label Nov 10, 2020
@dshokouhi
Copy link
Member

Did you not get presented with a permission when you tried the workaround?

@BigDoom
Copy link
Author

BigDoom commented Nov 10, 2020

Did you not get presented with a permission when you tried the workaround?

No nothing happened

@dshokouhi
Copy link
Member

Please share the yaml you used for both the command and notification

@BigDoom
Copy link
Author

BigDoom commented Nov 10, 2020

yaml for the notification

action:
  -   service: notify.mobile_app_phone
      data:
        message: "Some message"
        title: "Some title"
        data:
          ttl: 0
          priority: high
          channel: alarm_stream

yaml for the command

action:
  -   service: notify.mobile_app_phone
      data:
        message: "command_volume_level"
        title: "70"
        data:
          channel: alarm_stream

@dshokouhi
Copy link
Member

ok I think you misunderstood the workaround actually :) What you did was just adjust the volume of the alarm stream. The actual workaround is to change the devices ringer mode state to normal first, send a normal notification, then change it back to silent or vibrate after the notification was cleared you can use the ringer mode sensor to detect what to change it back to.

https://companion.home-assistant.io/docs/notifications/notification-commands#ringer-mode

@dshokouhi
Copy link
Member

also can you confirm if you have a Wear OS device?

@BigDoom
Copy link
Author

BigDoom commented Nov 12, 2020

also can you confirm if you have a Wear OS device?

No, don't have such device

@dshokouhi
Copy link
Member

What about the actual workaround? Does that work now if you try the command I mentioned?

@xydix
Copy link

xydix commented Nov 13, 2020

I had to have the app open, or the screen on to get the app to ask for permissions about DND.
Not sure wich one of it but if i sent the command with my screen of it didn't ask for permissions.

@dshokouhi
Copy link
Member

Please double check that the app has proper permission to run in the background @xydix it does not sound like it does. Also asking for DND permission is a one time thing once granted you don't need to do that again.

@BigDoom
Copy link
Author

BigDoom commented Nov 14, 2020

What about the actual workaround? Does that work now if you try the command I mentioned?

Yes the workaround is working now.

How can we proceed fixing the issue with the alarm_stream?

@dshokouhi
Copy link
Member

I need to see logs like I mentioned here #1159 (comment)

@dshokouhi
Copy link
Member

dshokouhi commented Nov 14, 2020

@d3m3trius lets please continue the conversation over here as I had previously requested. I am not sure why your message payload is coming in as blank. The app is also setup as a message receiver so we do indeed get the notifications that are posted on the device regardless of being in the foreground or background. Can you please try and start fresh something seems amiss with your setup. Even if I force stop the app the data payload still comes through in the logs so there is something funky going on with your device it seems.

Here is a brief log from when I force stopped the app:

2020-11-14 11:56:24.492 30732-31215/? D/MessagingService: From: 331041709873
2020-11-14 11:56:24.492 30732-31215/? D/MessagingService: Message data payload: {message=test}
2020-11-14 11:56:24.493 30732-30732/? D/MessagingService: Creating notification with following data: {message=test}

Even without sending channel: alarm_stream I can see the app being granted audio for the notification stream:

2020-11-14 11:56:24.705 1583-1583/? D/NotificationService: 0|io.homeassistant.companion.android|-933984211|null|10430: granting content://settings/system/notification_sound

@dshokouhi
Copy link
Member

Just checking in to see if anyone is able to get us the proper logs so we can attempt to debug this issue.

@dshokouhi
Copy link
Member

dshokouhi commented Mar 11, 2021

I was helping out another user with a different alarm stream issue and it lead me to an interesting stackoverflow thread with a potential fix. Can those who have this issue confirm if they have a default alarm ringtone set on their device and also if they have used the alarm on their device to trigger this default ringtone in the past? Some users suggest the default ringtone may return null which would explain the silence seen here. I think a possible fix (if this is indeed the case) is to try and default to the actual ringtone in case the alarm one returns null, I can't imagine the actual ringtone being null here but alarm might make sense if it was never used.

https://stackoverflow.com/a/5687023

still waiting to hear back from users on this

Edit: actually this comment might be a better fix but will need confirmation from users who have this issue: https://stackoverflow.com/a/43141881

@jojeda654
Copy link

I have this issue, and I have not set a default alarm ringtone on my device. I do not have that option available in the settings menu. The only options available are Ringtone, Notification sound, and System sound. All 3 settings seem to have unique sound lists.

The alarms in the Clock app default to a sound called Homecoming from the Ringtone list. It is not the sound I selected for my Ringtone. I do not see an option for changing the default alarm ringtone within the Clock app. The sounds available when creating a new alarm are from the Ringtone list only.

I noticed something odd after doing a fresh start, so I did a second one to confirm what I observed.
Notification was received, but silent. In the app settings, the sound for alarm_stream is listed as "Default notfication sound (Homecoming)"
However, when attempting to change the sound, the list presented is the same as the Notification sound list. Backing out of this screen, even without selecting a new sound, changes the sound to "Default notification sound (Chaos)"
Chaos is the sound I selected as my Notification sound in my phone's settings. Changing the Notification sound in my phone's settings also changes the alarm_stream sound.

Here is the configuration for the button I used to send the notification:

type: button
tap_action:
  confirmation:
    text: Find Phone?
  action: call-service
  service: notify.mobile_app_s21
  service_data:
    title: Finding Phone
    message: Ringing phone
    data:
      ttl: 0
      importance: high
      priority: high
      tag: Find
      channel: alarm_stream
name: Find S21
icon: 'mdi:cellphone-wireless'

@dshokouhi
Copy link
Member

However, when attempting to change the sound,

Because of the way notification channels work once you change it the app no longer has control. So you will need clear data to bring back the channel properties.

Also the fix for this was merged and in the latest beta. If you still have this issue please open a new issue and fill out the issue template with all requested data.

@VNRARA
Copy link

VNRARA commented Oct 24, 2023

Just checking in to see if anyone is able to get us the proper logs so we can attempt to debug this issue.

What do you need? I'm still trying to get "media_stream: alarm_stream" to work on a Samsung.

@KrisHoobergs
Copy link

@VNRARA any solution for your Samsung problem? I'm encountering the same problem. Working fine on OnePlus

@VNRARA
Copy link

VNRARA commented Apr 30, 2024

Sadly no. I can't even find any app that does succesfully use alarm stream.

@KrisHoobergs EDIT: Except for Automate by Illamalab. Alarm channel works fine there even on Samsung.

I'm probably going to use Automates URI in combination with HA Notification to get an alarm going.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working notifications
Projects
None yet
6 participants