-
-
Notifications
You must be signed in to change notification settings - Fork 649
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
Not able to turn Vibrations off #2430
Comments
Please reproduce the issue and get us the companion app logs so we can see what's going on here. We have a few debug statements for haptic, the app should be responding to the frontend messages. I would also double check this issue in chrome for Android to see if you can reproduce there. |
here is the log of the following actions:
I also checked the web app in chrome. There it behaves as expected: With vibrations turned on I get two short vibrations, with vibrations turned off I don't get any vibrations (same for do-not-distrub).
|
This is very strange I do not see any of the log messages I expect to see where the app processes the haptic feedback. At a minimum we should expect to see: Once for each haptic event and I do not see any. I do not even see when you went into settings to grab the logs and we should expect to see that too. I tested this myself by simply enabling vibration in my user profile and I immediately see the log line for when its enabled so something is not right here. Are you certain these are the full logs? I am surprised to not even see the part where you went into settings to grab the logs. If we dont see these log messages then the vibrations are not something the app is triggering. |
I have the same problem aswell. Home Assistant Android version: Android version: Phone model: Home Assistant version: Here is the log of the following actions:
|
So according to your logs I see you clicked on 3 buttons (light, success and success feedback events)
and then a few seconds later (presumably after turning off HA User profile vibration setting) you had clicked on the same 3 items.
In both of these cases the app is responding to HA frontend sending the haptic request, so this is beginning to sound like a HA frontend if that is correct. All we do is respond to the HA frontend requests here. Also you have a lot of errors not only about sensors but also in the HA frontend, you may want to look into getting those fixed by following the start fresh steps. The app seems to have issues registering sensors and some other webview error. https://companion.home-assistant.io/docs/troubleshooting/faqs#starting-fresh-with-the-android-app |
@dshokouhi I just did all the steps again and the log looks very similar, but I think somehow the log level is set to info and not debug. No idea how to change that tough. To your comment that the app is responding to the HA frontend in both cases: Something has to be different about it, since the vibration pattern is different. The following is only speculation, but could it be that the long success vibration by the app is always triggered (regardless of the settings), but when the frontend additionally uses Also i tried to read the frontend code to narrow the bug down, but i couldn't find the code that sends the haptic events to the external bus. Update: I just reset the app data and the log level is still only info. |
You need to make sure to grab the logs from the Configuration > Companion App > Show and Share Logs. The log level is not something you set as a user, verbose logs have been known to be missing when another logcat method is used without granting proper USB permissions. Logcat Reader for example is an app that requires USB permissions to get all the correct logs.
I saw your linked comment but thats pointing to a conditional statement where the vibration will take effect only if the devices API level was not correct. The logs shoudl still show that HA is sending us a value but in your logs I do not see that.
The app waits for the external bus message from the frontend and then (only then) do we process the haptic feedback. We can see that from the above comment where the HA frontend continues to send event data.
I think this PR may be of help home-assistant/frontend#3116 |
I did grab the logs from there. Regarding the frontend code: (I know this might not be the right place to discuss this here, but since this issue seems to only affect huawei phones i still think it is relevant) Haptics are emitted as DOM events. For the native js vibrations (that also work in the mobile browser) there is a function that attaches an event listener to them only if they are activated in the profile and the device supports vibrations. (link) This event listener uses the js native The function that re-emitts the events to the external bus, however, never checks this setting and always re-emits the event. (link) From that i am not sure why disabling vibrations even works at all on android, because from what I've seen now only huawei users reported problems. |
Thats my suspicion as well, at least thats the trend along with the same custom card
if that is the issue then it sounds like a frontend issue. Keep in mind as well that both reports come from the same custom card and judging by this issue it seems the author may have a fix in the works. |
For our purposes lets not focus on a custom card but instead of focus on HA default behavior. When you turn vibration on in the user profile do you get feedback? I got feedback when I did this. When you turn off the vibration in the user profile there is no vibration feedback given, I also experience this. Lets start with the basics before looking at anything custom. |
Yes the default behavior works as expected. All native HA cards, switches, etc. obey the setting. As I see it there are multiple bugs or undocumented behavior that leads to this bug:
|
There is not much we can do here with custom cards, especially when default behavior works as expected.
I am not sure but that would not be app related as we just respond to events
The apps are responsible for reacting to the external bus messages for the haptic event, If an event is not supposed to be sent then that responsibility lies with the HA frontend.
could be how they implement one of the APIs used but I am not sure, its a guessing game at this point. Given that default behavior works I am going to close this issue as the issue so far seems to be related to custom cards. If we determine it is an app issue we can revisit this. |
Home Assistant Android version:
2022.3.0-full
Android version:
10
Phone model:
Huawei Mate 20 (HMA-L29)
Home Assistant version:
2022.3.8
Last working Home Assistant release (if known):
Description of problem:
I noticed this problem first with the Lovelace Mushroom Cards, which uses the
custom-card-helpers library. This in turn triggers vibrations with an
haptic
event on thewindow
node and thesuccess
type.If the vibrations are activated in the profile these haptics will register as two very short bursts of vibrations, indicating that it is dispatched directly by the frontend through the
navigator.vibrate
function.If, however vibrations are turned off in the profile OR the do not disturb mode is activated the vibration still exists and is even longer and stronger. Because it is around half a second, I assume the responsible code is the one in the
processHaptics
function in the web view activity.Traceback (if applicable, to get the logs you may refer to: https://companion.home-assistant.io/docs/troubleshooting/faqs/#android-crash-logs):
Screenshot of problem:
Additional information:
The text was updated successfully, but these errors were encountered: