Tasker Project to control Philips Hue bulbs using Ok Google commands (no root)

Search This thread

shadow321337

Member
Jul 11, 2011
18
16
23
I got around this by choosing a random profile like "turn on the lights" and expanding it. Then I pressed and held the task, and replaced it with "set lights". I activated the AutoHue parts, and then switched it back.

In addition, I was using incorrect voice commands. All better now!
Glad to hear you got it.

Do you know how to disable to toast that pops up telling me that a possible command has been detected? It now shows up no matter what I search by voice.
It's in the AutoVoice app settings under Toasts and Logs. I just disabled both of them.

Thanks for such a fast reply!
No problem! Just chilling at home and saw it.
 
  • Like
Reactions: wavetingle

paulie.phonic

New member
Oct 16, 2013
1
0
0
So I got the thing up and running but am encountering some weird issues, if someone could help it would be much appreciated. My setup is about 18 lights on my hue bridge. Im a noob at tasker

1. I was trying to set up a command to only turn on my masterbed lights, so i cloned movie mode and changed name, cloned the movie task and renamed, and set up the autohue action with my master lights selected- but it does not work. If i test the hue action it turns on the lights, but if I try to run the command by voice nothing happens.

2. what is all going on with the set lights task? I see alot of info in that one and I dont fully understand it (maybe thats where the problem lies for me)

3. another thing is the autovoice only sometimes works, other times I get no black pop-up looking for commands- I switch back and forth between autovoice and tasker and sometimes that clears up the problem and it begins listening for commands again. Is this normal (I have autovoice selected always listening on)
 

Purpleluigi

New member
Oct 7, 2015
2
0
0
I love this! Thank you very much indeed. Works great.

Like the previous poster though, I'm not entirely sure about the Set Lights task. I was wanting to make a couple of changes to things, but I don't really want to go blundering through changing things that are essential, and I'm not clear on the last two steps of Set Lights, which I think are the same as each other?
 

Evostance

Senior Member
Nov 27, 2008
1,511
332
0
www.greghesp.com
I seem to be having some issues with this.

Has anyone successfully managed to pass brightness variables between Autovoice and Autohue? I've got my value stored as %brightness, and then using a custom json string within AutoHue that consists of {"on": true,"bri":%brightness} however it doesn't work.
If I replace %brightness with the value though, it works so I know its not a json issue
 

JohnBurnett1981

New member
Dec 2, 2015
1
0
0
Video

Hi,

Thanks for this. I have been looking all over the net to do this and the only place that had something helpful.

Do you know of any video tutorials to show you how to do this?

I am struggling and a video would really help.

Best regards,
John

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!)
 

saboture

Senior Member
Jul 25, 2009
418
142
63
30
Charleston, WV
I can't get this to work and I've been trying for a few days. Sorry for ressurecting an old thread lol. I imported the profile xml, have auto voice (paid) and auto hue. I change the IP to my hue bridge, have auto voice set up correctly (To my knowledge) and when testing the commands in tasker they work. However, when I issue the command from my home screen (Okay Google, turn the lights on) I get nothing out of my hue system. Can anyone provide some tips or settings I should be looking for?

Sent from my Nexus 6 using Tapatalk
 

pmgreen

Senior Member
Apr 17, 2012
408
10
0
Does anyone have an issue with Google Now not listening all the time? Running Marshmallow 6.0.1 and I need to click the mic for Google Now to work.
Fear using the Autovoice always listening will burn battery too fast. Greatly appreciate any help.
 

Haizum74

Senior Member
Aug 6, 2010
453
62
58
Capital of Yorkshire
Does anyone have an issue with Google Now not listening all the time? Running Marshmallow 6.0.1 and I need to click the mic for Google Now to work.
Fear using the Autovoice always listening will burn battery too fast. Greatly appreciate any help.

Easiest way I found was to add an autovoice widget to my screen and just press that to launch autovoice. It doesn't go into google now so for me its cleaner to use.
 

gillioen

Member
Dec 8, 2012
7
0
0
I am new to philips hue, to tanker, to..... everything you talk about here.
but i managed to make it work after reading all posts.
Just had to set my language from Dutch to English for the voice commands to be understood. :)

But that's no problem.
thanks for the effort Mr Shadow
 

shadow321337

Member
Jul 11, 2011
18
16
23
I am new to philips hue, to tanker, to..... everything you talk about here.
but i managed to make it work after reading all posts.
Just had to set my language from Dutch to English for the voice commands to be understood. :)

But that's no problem.
thanks for the effort Mr Shadow
You're very welcome. Glad you got it to work. It'll be a little bit of work, but you should be able to reconfigure it for Dutch if you want. Just tap on whichever profile name you want to change, then tap directly under that where it should now say "AutoVoice Recognized Command: ...". Then click on the pencil in the top right to edit the command and change the "Command Filter" entry to whatever the Dutch equivalent would be. You'll have to do this for each command, but it should work.

Alternatively you can set up your Google Now to have support for both Dutch and English by just selecting both options under the Voice settings in that app. Then you can just issue the lights commands via voice in English, but still be able to search in Dutch.
 

gillioen

Member
Dec 8, 2012
7
0
0
You're very welcome. Glad you got it to work. It'll be a little bit of work, but you should be able to reconfigure it for Dutch if you want. Just tap on whichever profile name you want to change, then tap directly under that where it should now say "AutoVoice Recognized Command: ...". Then click on the pencil in the top right to edit the command and change the "Command Filter" entry to whatever the Dutch equivalent would be. You'll have to do this for each command, but it should work.

Alternatively you can set up your Google Now to have support for both Dutch and English by just selecting both options under the Voice settings in that app. Then you can just issue the lights commands via voice in English, but still be able to search in Dutch.
Thanks for the info.
I selected 2 languages and it works fine.
 

sandeepsb

Senior Member
Jan 27, 2013
77
13
0
London
Hi, Thanks for the project file - it worked great and I'm very impressed with the amount of detail you went in to.
Just wondering if you've made any new changes with your Tasker project that could be worth sharing?

I'm really interested in the two points you mentioned in your first post

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
 

ikirt

Member
Mar 13, 2010
47
2
0
Hi, Thanks for the project file - it worked great and I'm very impressed with the amount of detail you went in to.
Just wondering if you've made any new changes with your Tasker project that could be worth sharing?

I'm really interested in the two points you mentioned in your first post
To setup a voice command to change the color of the lights is similar to turning lights on and off, except for the action, choose "color" from the command dropdown, and pick the color you would like.
 

shadow321337

Member
Jul 11, 2011
18
16
23
Hi, Thanks for the project file - it worked great and I'm very impressed with the amount of detail you went in to.
Just wondering if you've made any new changes with your Tasker project that could be worth sharing?

I'm really interested in the two points you mentioned in your first post
Haven't made any significant changes yet. I just recently moved into a new house that could actually make use of multiple room support (I was in a tiny apartment before) so I'll probably get that set up once I get the proper light fixtures installed.
Like ikirt said, you can just copy and paste the "Set Lights" command, rename it, and change the settings within that to make different colors for now.
 

DKs_Denimp

New member
Aug 13, 2016
1
0
0
That sure worked like ****! Not your coding but "ok google" and tasker. The lights didn't respond, they sometime made weird noises. All in all not worth spending the 4-6 dollars on this ****.
Just to say it again. Your coding probably worked very well and you probably did your best. But "ok google" and tasker doesn't work with the philips hue lights!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 11
    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!)
    1
    Very nice! Thank you for that. I created my own commands, resembling the scenes I have set up. For this, you have to directly connect to your bridge, create a new user and read out the color settings of your lamps with your desired scene. Whoever wants to try it:

    1. Find out you Hue bridge's IP.

    2. Connect to it via Browser:
    Code:
    http://HUE_IP/debug/clip.html

    3. In the URL field within the page, enter:
    Code:
    http://HUE_IP/api

    4. For message body, enter:
    Code:
    {"devicetype":"test user","username":"newdeveloper"}
    This will create a user named "newdeveloper". You can choose whatever name you like.

    5. Push "POST". In "Command Response", you will see something like "Error: Link button not pressed." You'll have to press the button on your bridge, then hit "POST" again. It should say "success" now.

    6. Now, enter the following in the URL field:
    Code:
    http://HUE_IP/api/newdeveloper
    Afterwards, hit "GET". You will see a list of your lights, their state and some further information.

    7. Now, with your phone, start a scene that you'd like to set via your voice. Afterwards, hit "GET" again. You'll see that the state of the corresponding lights changed (except you already set the scene before).

    8. Now you've got something like this:

    hlhfgd43.png


    And there are all the values you need!

    9. Now go to Tasker. Hit the + Button, choose Event, then Plugin, Autovoice, Recognized.

    10. Hit the Pencil next to "Configuration". Choose "Speak Filter", speak your desired command. Then hit the checkmark on the top.

    11. Now select "New Task", enter a name if you like, then hit the checkmark. + Button, Plugin, Autohue, Pencil next to Configuration.

    12. Now you can choose your Lights which you want to turn on and to be set. Under Command, select "Custom JSON String". In my case, it looks like this:

    mws6vd9p.jpg


    So, I tell the lamp to turn on ("on":true), and to set to the color I read out before ("xy":[0.5438,0.4048]).
    You can also use the "bri", "hue" and "sat" variables if you like, but I prefer xy, its easier for me :)

    EDIT: This only sets the color. You need the "bri" variable for brightness! :)

    13. Test Command and profit! This was for a single light now. If you have different lights with different settings, just add another task for that event :)

    I hope that this is helpful for some of.. hue :cool:
    1
    I try to import your profile it told me I can't because it's contain more then one profile. Any way around it. I'm new to tasker

    Make sure Beginner Mode is disabled in Tasker, and then on the main screen hold-tap on the house icon in the lower left and select Import from there. It sounds like you're trying to import just a Profile, but this is a Project, which is a combination of Profiles, Tasks, and Variables.
    1
    I got around this by choosing a random profile like "turn on the lights" and expanding it. Then I pressed and held the task, and replaced it with "set lights". I activated the AutoHue parts, and then switched it back.

    In addition, I was using incorrect voice commands. All better now!
    Glad to hear you got it.

    Do you know how to disable to toast that pops up telling me that a possible command has been detected? It now shows up no matter what I search by voice.
    It's in the AutoVoice app settings under Toasts and Logs. I just disabled both of them.

    Thanks for such a fast reply!
    No problem! Just chilling at home and saw it.
    1
    Yeah the last two steps in the Set Lights task are the same. I found in my testing it would sometimes not trigger so I made it send the command twice to ensure that it did.
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone