question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not able to turn Vibrations off

See original GitHub issue

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 the window node and the success 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:

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
dshokouhicommented, Apr 5, 2022

Here is the log of the following actions:

  • I opened the app, went into settings and turned vibrations on.
  • Triggered the normal expected vibration
  • Went into settings and turned vibrations off.
  • Triggered the strange vibration

So according to your logs I see you clicked on 3 buttons (light, success and success feedback events)

04-05 21:45:28.692 23271 23499 D WebviewActivity: External bus {"type":"haptic","payload":{"hapticType":"light"},"id":5} 
04-05 21:45:28.692 23271 23271 D WebviewActivity: Processing haptic tag for light 
04-05 21:45:30.564 23271 23271 W HiTouch_PressGestureDetector: Touch pointer move a lot. The moving distance of X is:13.652557, limit is:60The moving distance of Y is:70.17816, limit is:60 
04-05 21:45:31.226 23271 23271 I HwViewRootImpl: removeInvalidNode all the node in jank list is out of time 
04-05 21:45:34.858 23271 23499 D WebviewActivity: External bus {"type":"haptic","payload":{"hapticType":"success"},"id":6} 
04-05 21:45:34.859 23271 23271 D WebviewActivity: Processing haptic tag for success 
04-05 21:45:36.068 23271 23499 D WebviewActivity: External bus {"type":"haptic","payload":{"hapticType":"success"},"id":7} 
04-05 21:45:36.069 23271 23271 D WebviewActivity: Processing haptic tag for success

and then a few seconds later (presumably after turning off HA User profile vibration setting) you had clicked on the same 3 items.

04-05 21:45:41.317 23271 23499 D WebviewActivity: External bus {"type":"haptic","payload":{"hapticType":"light"},"id":9} 
04-05 21:45:41.318 23271 23271 D WebviewActivity: Processing haptic tag for light 
04-05 21:45:42.960 23271 23271 W HiTouch_PressGestureDetector: Touch pointer move a lot. The moving distance of X is:5.3286133, limit is:60The moving distance of Y is:64.73346, limit is:60 
04-05 21:45:43.036 23271 23271 I HwViewRootImpl: removeInvalidNode all the node in jank list is out of time 
04-05 21:45:46.750 23271 23499 D WebviewActivity: External bus {"type":"haptic","payload":{"hapticType":"success"},"id":10} 
04-05 21:45:46.751 23271 23271 D WebviewActivity: Processing haptic tag for success 
04-05 21:45:48.462 23271 23499 D WebviewActivity: External bus {"type":"haptic","payload":{"hapticType":"success"},"id":11} 
04-05 21:45:48.462 23271 23271 D WebviewActivity: Processing haptic tag for success

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

0reactions
dshokouhicommented, Apr 5, 2022
  • The issue is not only with this one custom cards, but with all cards using the custom-cards/custom-card-helpers library. I suspect the reason is that the haptics event raised by this library is raised on the window while native HA haptics raise it on the respective DOM element. (The documentation for this is still WIP and doesn’t provide the right way to do it (link))

There is not much we can do here with custom cards, especially when default behavior works as expected.

  • Somewhere along the line the frontend treats these two events slightly differently and ignores the setting for passing the event along.

I am not sure but that would not be app related as we just respond to events

  • There are two parallel implementations of the vibrate function (js and native android)

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.

  • somehow it only seems to occur on huawei phones for some reason.

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Customize iPhone for vibration sensitivities - Apple Support
Turn off all vibrations: Go to Settings > Accessibility > Touch, then turn off Vibration. Note: This setting turns off vibrations for earthquake,...
Read more >
Cannot turn off vibration on a Bluetooth Xbox series X|S
Today I bought an Xbox series X|S controller to use for my PC and I have a problem disabling the vibration when it...
Read more >
How to Turn Off Vibration on Your iPhone in 3 Steps
How to turn off vibration on your iPhone ... 1. On your iPhone's home screen, locate and tap the Settings icon. 2. Scroll...
Read more >
Change vibration settings - Android Accessibility Help
Open your device's Settings app . · Tap Accessibility. · Tap Vibration & haptic strength. · Review or change the following settings: Ring...
Read more >
Not able to turn off vibration mode - OnePlus Community
- I have gone to accessibility and Vibration is on. Tried turning it off but I still could not... There is a sliding...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found