EDIT - I originally posted this as a "how-to", explaining how I setup my Android tablets and phone using Tasker and AutoRemote. I don't want to stifle others wanting to share their solutions in this space, whether it still be in the Android space using things like MacroDroid, or those who have signed up to the Apple eco-system, all are welcome to post their own creations to achieve this outcome.... plus any other weird and wonderful variations.... Though I may post separate topics, so stay tuned.....
I recently set one of my Android tablets up to adjust the screen brightness and volume based on the mode set in HE. Below are some notes on how I did this. Due to the use of Tasker, this is only relevant for Android devices.
The short explanation is that I used a HTTP call from Rule Machine rule when the HE mode changes, which is received on my tablet using AutoRemote and Tasker, with Tasker storing a variable to represent the mode name passed in the HTTP call. Tasker then adjusts the screen brightness and volume based on the mode name received.
I will skip over the initial setup of Tasker and AutoRemote, but can add some notes if people need them, or at least links to existing instructions.
Setup the Tasker Variable
- Open Tasker
- Across the top of the screen select the Variables (Vars) tab
- In the bottom right click the plus symbol to add a variable
- In the pop-up at the top of the screen enter a name for the variable, leaving the percent symbol in place, tapping the tick to create the variable. I called my variable Mode.
- If you want, tap the variable and enter a value, e.g. Day, Night, etc.
Setup a Tasker Profile to Dim Screen Brightness and Mute Device Volume
- Open Tasker
- Select the Profiles tab
- Tap the plus symbol to add a new Profile
- Select State, Variables and finally the Variable Value state
- Tap the Conditions configuration icon (tag-style icon) and select the recently created %Mode variable (at the top of the list)
- In the Value enter one of the modes where you want the display and audio settings reduced
- If you have more than one mode where this will be the case, tap the plus icon in the Conditions banner and repeat steps 5 and 6.
- Tap the back arrow to return to the profile setup
- Tap the New Task option that pops up, entering a name for the new task, like Night Mode Settings
- Tap the plus icon to add action
- Select Display, Display Brightness, adjusting the brightness setting on the slider. Tap the back arrow to return to the task setup
- Tap the plus icon to add a second action, selecting Audio, System Volume, adjusting the volume setting slider. Tap the back arrow to return to the task setup
- Tap the back arrow again to return to the profiles tab
- Tap the tick in the top right of the screen to save the changes.
Repeat the steps above to setup another profile for raising the brightness and volume for different mode(s).
Test the changes by going into the variables page and manually adjusting the mode variable and seeing the tasks run and take effect.
Setup Profile to Receive Mode Change Command From HE
- Create a new profile, selecting Event, Plugin, AutoRemote, AutoRemote
- Tap the Edit pencil icon in the configuration banner
- Tap the Message Filter, entering the word mode. You can set this to be case insensitive if you wish.
- Create a Task that sets the mode variable to %arcomm, a variable that is populated when the AutoRemote plugin is triggered by a command being received that has the format of mode=:=Night, where arcomm would have a value of night in this case.
- Save the profile
Sending the Mode From HE
I chose to use Rule Machine to send the AutoRemote command, but you can use whatever approach works for you.
- Create a new Rule Machine Rule, triggered by a change in mode
- Under Actions, select a HTTP GET call, entering the following address:
http://< IP of Phone / Tablet >:1817/?message=mode=:=< Mode Name >
replacing < IP of Phone / Tablet > and < Mode Name > with appropriate values. Depending on how you setup AutoRemote, you may also need to adjust the port from 1817.
Setup additional RM rules or conditional actions in one rule to handle each mode. I personally prefer to send all the modes to the device and record them in the variable, then react to the one's I want through my choice to configure a Tasker profile for that mode.
Enjoy!!