-
Notifications
You must be signed in to change notification settings - Fork 598
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
Silent notification when using channel: alarm_stream on Samsung devices #1159
Comments
check the alarm stream volume on your device, more than likely your volume level for that stream in particular is off. Especially if you confirmed I just tested on my own device and can confirm if you set the volume of alarm to 0 it won't make a sound, as expected. If the volume level for the alarm stream is set to 3 or 4 I do hear it. |
Ah my bad. The thing is. If I use alarm_stream or alarm_stream_max doesn't matter in this case.
This is working. I hear the TTS even if phone is in silent mode. EDIT: After more testing, using TTS, will sound if phone is in silent mode even if i don't use
This notification is received with my standard notification sound. EDIT: But only if sound is on (no silence mode)
|
Try enabling lock screen sounds in your device settings? This might be a manufacturer difference or a setting on your end to adjust. |
Lock screen sound is enabled |
I think this is the same problem as https://github.com/home-assistant/companion.home-assistant/issues/387 |
maybe try checking the default alarm sound? all we do is ask for whatever is the default alarm song and attempt to play it. I think this may be samsung doing something out of the ordinary outside of android specification. Not sure what we can do to correct this as I don't own any samsung devices to test with. here is the code where you can see we specify to use the alarm stream for the notification: There is nothing strange about how TTS is working but notifications is not. They use completely different code and API's and it is expected they may not behave the same. The issue you linked to was also closed as a duplicate of this issue. |
So I did som more testing. |
TTS notification is not the same as a message notification, so the comparison is not valid here. They use completely separate API's and the functionality is also separate. The reason why TTS continues to work is because by default it uses the Music stream, as outlined in the docs. Code wise they both use the same audio attributes when it comes to using the alarm stream. Can you try these steps in order?
Does it make a sound then? |
Hi. |
Does the notification show up before you turn on the screen and touch the device? |
Yes i guesss it does. When the silent / vibration mode is of, sound on, the phone ring with my alarm sound instantly. The screen is black all the time. |
Same issue here, alarm_stream isn't working, neither is alarm_stream_max. Both don't give an audible alarm when on silent mode. My automation in HA:
This just gives me a silent notification when the action is triggered. When I use my alarm clock on my phone it gives me a sound, so I would assume my alarm notifications are properly set-up on my Android device. Running Android v10 on Samsung device. |
Hello, with my phone (Google Pixel 3a) the situation is as follows: |
@KNXBroker you are confusing TTS for a normal notification. There is no @xydix please edit your post title to mention this is Samsung specific. For everyone else let's please stop mentioning TTS here to not cause further confusion. They don't work the same, TTS doesn't even use notification channels. We only kept the name as the intended functionality of using the alarm stream is the same. Code wise both TTS and notifications use the same audio attributes, but use a different Android API. I can reopen this issue once we help users understand what specifically the issue is as this impacts Samsung only. Samsung users will need to stick to TTS to use the alarm stream in the meantime while we figure out the cause of this issue. If any user has access to ADB logs, you can try to help by grabbing the on device logs. You should see the entire message payload so make sure to grab all relevant information after you see the payload. You can use Android studio to get the ADB logs. Maybe there is some clue in the logs to help us. |
Re-opening as there is one thing to try that I found in a stack overflow post. It did not specifically call out Samsung but it did mention some additional alarm attributes that continue to work on my device so hopefully this is what other manufacturers are expecting. No promises so if you are able to get ADB logs would be good to get them too. My other suspicion is that its possible that samsung is just returning a blank URI for the alarm however I would expect to see a crash report if that were the case. |
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. |
The issue is not Samsung specific, I have a OnePlus 6T and alarm_stream channel doesn't work in silent/vibration mode. This is the log captured (sorry for the length, but I do not know what exactly to look for):
|
@d3m3trius please try with the latest build starting from build 511 as it contains extra fixes, this build is not in the play store yet but you can install it off github. The log is somewhat helpful. If the issue is still reproducible in a later build please post another log. |
I tried v3.0.2 but it still does not work. This is the log in vibrate mode:
|
I tired your workaround.
The only problem is, if my phone lying unused for a while the command doesn't do anything. EDIT: Using only
Still doesn't work with the lastest version of the app. |
Lets all please move the convo to #1186 as this issue is now closed. |
@d3m3trius please comment in #1186 and grab a new log. Your log is incomplete as it does not contain the notification message itself. At a minimum I expect to see the following log and then we will need about 20-30 (or more) log statements afterwards.
You should see the full message payload. I would also look for things like
|
@dshokouhi I can not find these messages in logcat, maybe they are included only in debug build. Is it possible ti change the log level in the app? Otherwise, how should I proceed? |
@d3m3trius these are not from a debug build I was using the production version of the app, you may need to investigate the logcat tool you are using to ensure it gets all logs. If it is an app most likely you need to grant some permission via ADB too they would have that documented for you. You will definitely see these logs. Alternatively you can use android studio to get the logs too. |
@dshokouhi I am using Android Studio (verbose mode, no filters). If the app is in foreground, the notification message is empty (there is just the icon without text, is it another bug?) and still no sound. In this case, the log is:
Edit: it looks like there is no data payload in the notification; looking at https://firebase.google.com/docs/cloud-messaging/android/receive#handling_messages, in background the notification is delivered directly to the device’s system tray because there is no payload, and in foreground the log show empty payload. |
Home Assistant Android version:
3.0.0-full
Android version:
10
Phone model:
Samsung Galaxy S20
Home Assistant version:
0.116.2
Last working Home Assistant release (if known):
Description of problem:
I Try to use the alarm_stream in a notification.
I want to use Home Assistant to find my phone if i loose it.
It uses the alarm sound but if the phone is in silent mode it receives the notification silent.
Did I misunderstood the docs?
Using this works if the phone is in slient mode
Traceback (if applicable):
Screenshot of problem:
Additional information:
The text was updated successfully, but these errors were encountered: