Jump to content

Run Philips Hue workflow for presets

Recommended Posts

You need to add a remote trigger in order to make it available. When constructing the workflow itself, it works just like adding an External Trigger or a Hotkey.


If you want to create a workflow page that will be bundled with the workflow, then click the remote icon that lives right next to the debug icon on the workflow creation page. After that, you'll just click on one of the boxes and select "Run Workflow Trigger," which will give you the option of any Remote Trigger that you've defined on your own workflow.


Take a look at my PowerPoint Remote for an example.

Link to comment

I don't have a Phillips Hue, so it'll be hard for me to help out directly with this one because the workflow needs to be connected to a hue to work. But, with that being said...


You can accomplish this, regardless, in one of two ways:


(1) Use AppleScript to have Alfred do a search with the correct query and then automate the "return" key.

(2) Find the exact argument that the workflow sends when you select a preset and pass it within the workflow.


So, let's talk about #2 (note, since you're modifying the workflow, these modifications will be removed each time you update via the Packal updater or Alfred's regular update mechanism).


(1) Open up the script debugger and show "All Information"

(2) Type in your query to get the presets.


You'll see that each XML item should have something called "arg" in it. You need to find the exact argument, but, for now, I'm just going to assume that the argument for "energize" is "preset-energize", etc...


(3) Create a Remote Trigger that connects to the topmost "Run Script" action, the one that runs the Python. You can set the identifiers to whatever you want, but make the Argument "Text" and then fill in "preset-energize".


(4) Add that to a workflow page.


(5) Press it. It should work.


(6) Repeat for each preset that you want to available.

Edited by Shawn Rice
Link to comment

Problem is that doesn't work this workflow since the presets above are not defined in the workflow and I assume loaded by the workflow itself. So it basically becomes impossible to find any link to "energize" preset i Alfred as shown below...


It might be worth popping the workflow developer a note, as he may be interested in getting involved too. I'm not sure how simple turning these presets into Remote Triggers will be, but it's worth a chat, I'm sure :)

Link to comment

Love the input and didn't even know about the debugger mode :)


The preset triggered this:

[iNFO: alfred.workflow.input.scriptfilter] Processing output 'alfred.workflow.action.script' with arg '{"action": "load_preset", "preset_name": "feetup"}'


But right after that I found in the documentation that I can create a hotkey, set text input to preset's name (in this case feetup) and connect it with the Run Script bin/bash that the other hot keys are connected with. Works like a charm and might be of help for others :)


Thanks for your help!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...