Change Android media volume and put in vibrate mode

Hi, is there anyway to change my phone Android media volume and put the notification in vibration mode when HA detects my phone location is in office?

I installed the HA companion app in my Android phone and I can see all phone sensors in my HA. And I want to have an automation in my HA to change the media volume and notification mode based on my location.

Please advise.

Not directly as far as I am aware. It’s all about the phone being the control, rather than the controlled.

I use an app called MacroDroid for a few things, it can do various things based on triggers including location and visible networks, it also has a webhooks integration that lets you control your phone via a url, something you could send from HA via command line. Not sure how secure that is as I haven’t tried it.

Do not disturb command perhaps works for you?
Not sure if it can be set to vibrate but looking in the settings on the phone there seems to be a custom mode, have a look if that works for you.
If yes then dnd is possible.

I use this every evening to mute the phone at bed time and unmute in the morning

1 Like

That’s pretty cool - I assume that the devs could add other actions that didn’t require root access.

Like what kind of commands, there are already a lot of commands available

There are quite a few commands aren’t there. The only ones I can think of that I use are stuff like sending SMS and making calls - the former can be done using a notification integration in HA and the latter I can’t think of a use for in the context of HA.

Very comprehensive - shame I didn’t find it on my first search of the docs :blush:

Although I have two 7 inch tablets with phone capability - would make a great wireless intercom for your HA panel. Hmm :slight_smile:

Phone calls is possible, I managed to get that working a few months ago if I recall correct.
sms, you can compose a sms but not send it.

2 Likes

https://companion.home-assistant.io/docs/notifications/notification-commands#volume-level

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

One thing you can consider is that if its possible via Tasker then you can have the companion app trigger Tasker by sending an intent. Then from Tasker you listen for that intent and perform whatever the action is.

Hi, thanks for sharing the info. I can now set the volume and ringer mode from my HA. However, I noticed there is one minor problem. It seems it can only configure my phone when I unlocked my phone not when my phone is in locked. Anyway to overcome this?

Thanks.

You need to allow the app to run while screen is off.

And also look in companion app settings:

Probably also needs to follow the critical notification format. Might be a good time to read the companion docs to learn about everything.

I did try to put use ttl and priority format but it doesn’t seem to work. Will review the documentation once again.

thanks a lot , it working perfectly for me that i was searching for