[Android General] shadow321337:
Tasker Project to control Philips Hue bulbs using Ok Google commands (no root)​

I've created a Tasker Project that works in conjuction with Ok Google and a few Tasker plugins to give you voice control over your Philips Hue lights, as well as some instructions for setting it up. Hope you enjoy! Apologies for the lack of links, I'm more a lurker than a poster.

(Not sure if this is the right forum for this, but mods please move it if not.)

For those who are starting from scratch wanting to do this, I'll give a short guide to how to get this up and running. If you are experienced, the gist of it is to install all the plugins, import the XML file, and configure AutoHue within the tasks.

Step 1: Prereqs

The first thing you'll need to do (after buying and setting up your Hue bulbs) is install the prerequisites:

Tasker:

($2.99)

play.google.com/store/apps/details?id=net.dinglisch.android.taskerm

AutoVoice:

play.google.com/store/apps/details?id=com.joaomgcd.autovoice

AutoVoice Pro Unlock:

($1.57, yes you need pro)

play.google.com/store/apps/details?id=com.joaomgcd.autovoice.unlock

AutoHue:

($1.29)

play.google.com/store/apps/details?id=com.cuberob.autohue

Philips Hue:

(not required, but you'll need it if you haven't already set up your bulbs. good for testing anyway):

play.google.com/store/apps/details?id=com.philips.lighting.hue

​

Step 2: Configure AutoVoice

You'll then need to make sure you have Ok Google enabled and allow AutoVoice to intercept commands. Lifehacker has a good article on how to do this which I used, so I'll just tell you to use steps 0 and 1 from that:

lifehacker.com/how-to-create-custom-voice-commands-with-tasker-and-aut-1282209195

I also recommend in the AutoVoice app, under Google Now Integration, to check the "Only Voice" box so if you type a search for anything it doesn't accidentally trigger a profile.

Keep in mind I'm running this on a stock, rooted Nexus 6 with always listening Google Now enabled. YMMV if you have other means to trigger the voice commands. You may want to set up some dummy tasks to test your voice triggering.

Step 3: Configure Tasker

At this point you can follow the Lifehacker guide to set up some profiles, but I've provided my Tasker Project via an XML file for your convenience.

XDA doesn't accept .xml files, so I changed it to .txt

Just rename it back to .xml (it's plaintext, so by all means inspect it). You should never blindly import a stranger's Tasker profiles.

Once you're satisfied, just download and import it into Tasker (there are guides out there for this).

Step 4: Configure Tasker Profiles for your Bulbs

One at a time open the "Set Lights", "Turn off the lights", "Mood Lighting", and "Movie Mode" actions and do the following for each of the "AutoHue" Actions in each task (There are 3 in "Set Lights", 1 in the rest):

==> Select the Action

==> Tap the pencil in the rop right

==> Tap the magnifying glass and search/pair with your Hue bridge

==> Tap the button under "Light" and select the bulbs you want to be controlled

==> Tap the Check Mark in the top right

(That step seems like a lot of work, but trust me when I say it pales in comparison to setting up all of these individually)

Step 5: Test!

Once you've completed that, open a few of the tasks and press the Play button in the bottom corner to make sure they are configured right (your lights should respond accordingly). Then once you know Tasker is working right, you can try using Ok Google to trigger it. If everything was configured properly, then you're all good to go!

List of available commands I have already set up with descriptions:

These can be disabled individually by either turning the Profile switch to Off or completely deleting the Profile and Task from Tasker.

==> "Turn on the lights"

- turns on all lights to maximum brightness​

==> "Turn off the lights"

- turns off all lights​

==> "Dim the lights"

- dims the lights to 20%​

==> "Movie Mode"

- turns off all lights except one (mine's set for the one being in the kitchen; This needs to be set up like the "Set Lights" task above.)​

==> "Set the Mood"

- dims the lights and sets them red (for when you've got "company"). This needs to be set up like the "Set Lights" task above.​

==> "Wake Up"

- When phone alarm goes off, slowly increases the lights from off to full with blue hue to help you wake up, then waits 10 minutes and sets the color to white​

==> Increase by % (increments of 10%; range: 10%-90%)

- e.g. "increase the lights 30%"​

==> Decrease by % (increments of 10%; range: 10%-90%)

- e.g. "decrease the lights 30%"​

==> Set to % (increments of 10%; range: 10%-100%)

- e.g. "set the lights to 30%"​

Note: I have it configured so setting the brightness also adjusts the warmth of the light, so a dimmer light is an oranger hue (easier on the eyes in the dark; similar to f.lux.) This can be disabled by changing references to the %Sat variable under the AutoHue actions in the "Set Lights" task to 0.

Things I'll probably add in soon:

Another variable for hue to add the ability to change the color of the lights with voice commands

Individual Room Lighting Control

A Few Notes:

Let me just say that I, personally, have not developed any of the tools required to make this happen, so if you liked what I've put together here throw your money at them, not me. (You'll need to in order to make it work, anyway.)

If you have the Xposed Module installed, you can also set up AutoVoice to work from Android Wear devices (pretty cool!)