How do I use Intents (Android)?

The recommended way to automate your lights is by using the Tasker plugin which is easier. The alternative (manual) method described on this page uses intents. Intents can be sent using almost any automation app (like Tasker) or through terminal (ADB) commands. Both methods are described below.

Send intent using Tasker

  1. Download Tasker from the Google Play Store. (Tasker is a third party app and Hue Essentials is not affiliated with Tasker in any way).
  2. Open Tasker;
  3. Tap (+) under TASKS;
  4. Enter a name for your task and tap (V);
  5. Tap (+) and search for Send Intent under the System category;
  6. Fill out the action and extra(s) as described in the examples on this page. For example to start a scene with id 1234 in group 3:
    • Action: com.superthomaslab.hueessentials.START_SCENE
    • Extra: BRIDGE_ID:0123456789
    • Extra: GROUP_ID:3
    • Extra: SCENE_ID:1234
  7. Set Package to the following depending on the store:
  • Google Play Store / other: com.superthomaslab.hueessentials
  • Amazon Appstore: com.superthomaslab.hueessentials.amazon
  • Huawei AppGallery: com.superthomaslab.hueessentials.huawei
  1. Set Target to Broadcast Receiver;
  2. Go back to the main screen of Tasker and use the task you just created in a profile. (See help of Tasker for full details.)

Send intent using terminal commands

Automate Hue Essentials using terminal (ADB) commands.

Here is how the command should look like (one line):

adb shell am broadcast -a <ACTION> -e <EXTRA1> <VALUE1> -e <EXTRA2> <VALUE2> <PACKAGE>

Here is an example command to start the scene with id 1234 in group 3 for Hue Essentials from Google Play (one line):

adb shell am broadcast -a com.superthomaslab.hueessentials.START_SCENE -e BRIDGE_ID 0123456789 -e GROUP_ID 3 -e SCENE_ID 1234 com.superthomaslab.hueessentials

Extras

These are the extras of which some are required for the commands. The available commands are explained further down this page.

BRIDGE_ID (String)

This is the identifier of the bridge where the command will be executed. You can find this in Hue Essentials > Hue bridges > Select your bridge > Details > Identifier. (press and hold to copy)

GROUP_ID (String/Integer)

The group identifier. You can find this in Hue Essentials > Select your room/group > Three dots at top > Details > Identifier. (press and hold to copy)

If this value is 0 it will target all the lights of your bridge. (supported on Philips Hue / deCONZ only)

SCENE_ID (String/Integer)

The scene identifier. You can find this in Hue Essentials > Select your room/group > Scenes tab >Three dots of a scene > Details > Identifier. (press and hold to copy)

EFFECT_ID (String)

The effect identifier. The value of this parameter depends on the version of Hue Essentials. You can find the version in Hue Essentials > Open the left side menu > Settings > About.

If you have Hue Essentials 2.x.x or higher:

You can find this in Hue Essentials > Select your room/group > Effects tab > Tap three dots of your effect under ‘My effects’ > Details > Identifier. (press and hold to copy)

If you have Hue Essentials 1.x.x:

You can find this in Hue Essentials > Select your room/group > Effects tab > Select your effect under ‘My effects’ > Details > Identifier. (press and hold to copy)

ENTERTAINMENT_PROGRAM (String)

The entertainment program; values currently available: dance_sensation, disco, fireworks, lightning, police_lights

Commands

Toggle group (on/off)

This command will switch on a group if it is off or on otherwise.

Action

  • com.superthomaslab.hueessentials.TOGGLE_GROUP

Extras

  • BRIDGE_ID
  • GROUP_ID

Start scene

This command activates a scene in the given group. The extra GROUP_ID is used to limit the scene to a group.

Action

  • com.superthomaslab.hueessentials.START_SCENE

Extras

  • BRIDGE_ID
  • SCENE_ID
  • GROUP_ID (Optional for Hue | Required for TRÅDFRI and deCONZ)

Start effect

This command starts an effect in the given group.

Action

  • com.superthomaslab.hueessentials.START_EFFECT

Extras

  • BRIDGE_ID
  • GROUP_ID
  • EFFECT_ID

Stop effect

This command stops a running effect. If both extras are provided, then the effect in that group will be stopped. Otherwise all currently playing effects will be stopped. If no effect is currently playing, this command does nothing.

Action

  • com.superthomaslab.hueessentials.STOP_EFFECT

Extras

  • BRIDGE_ID
  • GROUP_ID (optional)

Start entertainment program

This command starts an entertainment program in the given group.

Action

  • com.superthomaslab.hueessentials.START_ENTERTAINMENT

Extras

  • BRIDGE_ID
  • GROUP_ID
  • ENTERTAINMENT_PROGRAM

Stop entertainment program

This command stops a running entertainment program. If both extras are provided, then the program in that group will be stopped. Otherwise all currently playing programs will be stopped. If no program is currently playing, this command does nothing.

Action

  • com.superthomaslab.hueessentials.STOP_ENTERTAINMENT

Extras

  • BRIDGE_ID (optional)
  • GROUP_ID (optional)

Set group state

Set the state for the given group.

Action

  • com.superthomaslab.hueessentials.SET_GROUP_STATE

Required extras

  • BRIDGE_ID
  • GROUP_ID

Optional extras

  • ON (Boolean) - Switch this group on or off. Can be true (on) or false (off).
  • BRIGHTNESS (Integer) - Set the brightness of this group. Value must be between 1 (almost off) and 254 (highest brightness). This will only change the brightness of a light if the light is on. This can be used in combination with the ON extra.

When trying to send an intent to start the ‘sync’ entertainment program, what needs to be done to specify the entertainment area? I’ve entered the parameters like so:

am broadcast -a com.superthomaslab.hueessentials.START_ENTERTAINMENT -e BRIDGE_ID <bridge_id> -e GROUP_ID 0 -e ENTERTAINMENT_PROGRAM sync com.superthomaslab.hueessentials

This does not start the syncing because no entertainment area is specified. In the app, I have to manually select the lights I want and then it starts syncing.

Help is appreciated.

@harpdogg You need to create an Entertainment area and add its group ID. Usual areas do not work here from what i can see.

And can we please have an optional parameter “BRIGHTNESS” for the START_ENTERTAINMENT intent? Maybe also “INTENSITY”, but brightness would do for me. Not having it is a real bummer :confused:

Thank you @Rexile, I eventually did figure it out. Now I’m having a problem with the ‘sync’ program starting when not in the Hue Essentials app. That is, on my Nvidia Shield, when I’m in any app except Hue Essentials like for example, Kodi or Tivimate, and run the ADB command, the sync program does not start. But, when I run the same ADB command while the Hue Essentials app is in the foreground, the ‘sync’ program starts and runs successfully. I have not been able to figure out why the ADB command does not run successfully outside of the Hue Essentials app.