benknight
-
Posts
23 -
Joined
-
Last visited
-
Days Won
1
Content Type
Blogs
Gallery
Downloads
Events
Profiles
Forums
Articles
Media Demo
Posts posted by benknight
-
-
alp works just fine in Alfred 2, and Alfred 3 with this patch applied: https://github.com/phyllisstein/alp/pull/23. It suppose it could easily be updated to fallback to the data in info.plist as well.
By the way, when you say "discontinued" do you mean to say alp was at some point an official Python library for Alfred?
-
Reasonable suggestion. However the library my workflow relies heavily on is this one: https://github.com/phyllisstein/alp which references Alfred's storage and cache paths.
For now I think I'll have to see this is as just being a tradeoff. The best solution for right now is probably setting the environment variables manually if I need to test outside of Alfred.
In the future why not have Alfred expose some sort of developer utility (i.e. a bash script) that bootstraps all the Alfred environment variables.
Thanks.
-
Andrew, does this mean I can no longer run my workflow code outside of Alfred's shell environment? Or is there some sort of utility available for that now?
-
Is there a way inside a workflow's source code to determine whether the user has Alfred 2 or 3?
My workflow stores information in the OS application cache/storage directories, e.g.
~/Library/Application Support/Alfred 2/Workflow Data/
I want to update my workflow to use the correct directory for the version of Alfred that's being used, but I don't currently see any way of doing that.
-
On 10/9/2016 at 0:02 PM, bongobong said:
Thanks. I was sort of hoping i could get it to go "hp <preset name> or some such.Thanks!
@bongobong I think it's also worth noting you can create a hotkey for a specific preset if you're always setting to the same preset. More info here: https://github.com/benknight/hue-alfred-workflow#hotkeys
-
On 10/9/2016 at 0:02 PM, bongobong said:
Thanks. I was sort of hoping i could get it to go "hp <preset name> or some such.Thanks!
@bongobong Actually this is possible with some light editing of the workflow source. Here's a rough guide:
1. Open Alfred Preference, go to "Workflows" and select this workflow.
2. Create a new script filter: + > Inputs > Script Filter
3. Double click the new script filter (it will be at the bottom probably)
4. Edit the filter accordingly:
- Set to "Argument optional"
- Set the Keyword to whatever you like, such as "hp" to use your example
- Set the Placeholder title to whatever you like, e.g. "Set Philips Hue Controller preset..."
-
In the "script" box, enter
python -m logic.filters "presets {query}"
-
4. Profit
Let me know if it works out for you!
-
18 hours ago, bongobong said:
Hey there guys, this is a brilliant workflow but did anyone work out how to have a preset triggered by just "Hue Party" or "Hue Concentrate" etc?
You can trigger any preset with "hue preset <preset name>"
-
How do you delete presets?
I attempted save presets twice and each time only 6-7 of lights included in preset actually turned on. I would like to delete these save presets but see no instruction for how to do so.
Can you delete save presets, if so how?
Use the "-hue" keyword to find the "Open Presets Storage – Use this to delete, rename, or backup presets" option. This opens the a directory in Finder. To delete the preset, just delete the folder pertaining to that preset.
-
Use this one to highlight a URL found in some text somewhere and open it with your default browser.
Download link:
http://cl.ly/022J311A1e0q/download/Open%20URL%20with%20hotkey.alfredworkflow
-
Use this one to highlight words, then hit the hotkey to automatically open a new browser tab with the Google search results for the selection as the search query.
Download link:
http://cl.ly/3V2v2i0m121D/download/Google%20Selected%20Text.alfredworkflow
-
This is a fantastic workflow! Thank you for the time you've put in.
I don't want to start barking ideas but this is more of a question:
When I set (with my phone) to a preset (lets say blue rain) and then use alfred to save the preset (hue-preset-save or whatever) can it save that current config? Or is saving presets in alfred only for if you've set the lights up through alfred. I ask because I set to a preset using my phone and then saved the preset with alfred but when i go back to that preset through alfred, it doesnt seem to work
Interesting. That *should* actually work. Can you repeat the action maybe a few times and tell me if it's consistently failing?
-
Ben, first and foremost, AMAZING workflow!!!! Thank you!
I have a small suggestion, would it be possible for you allow for the user to set the IP of their HUE bridge via the "-hue set-bridge" command? Something like "-hue set-bridge 192.168.2.20".
The reason why is because for people like me that get an empty response from "http://www.meethue.com/api/nupnp", we are not able to get the bridge to pair. I had to modify the setup.py script so that I could pair my bridge.
You can see in bold the change I made below. I know that it is not a good permanent change, but it was good enough for me to get it to work.
class HueAlfredSetup:
def setup(self):
r = requests.get('http://www.meethue.com/api/nupnp')
bridges = r.json()
# Changed "If not" to an "If" so that it skips to the else.
if bridges:
print 'No bridges found on your network.'
else:
# Statically assigned the IP address of my bridge.
bridge_ip = '192.168.2.20'
settings = alp.Settings()
# Create API user for the workflow
r = requests.post(
'http://{bridge_ip}/api'.format(bridge_ip=bridge_ip),
data=json.dumps({'devicetype': 'Alfred 2'}))
resp = r.json()[0]
if resp.get('error'):
print 'Setup Error: %s' % resp['error'].get('description')
else:
settings.set(bridge_ip=bridge_ip, group='')
settings.set(username=resp['success']['username'])
print 'Success! You can now control your lights by using the "hue" keyword.'
return None
Hey carbon copy, I'm surprised you're having this issue. As far as I know all Hue devices would depend on this public endpoint working. I think what you did (manually editing the script) is probably the best approach here. I would hesitate to program a feature for this because I can't imagine this is a common problem.
-
+1 for a fix. Would love to have this.
-
Now I totally see why! It's because you have lights on the system that aren't hue bulbs (5x LivingWhites Adapter, 1x LivingColors Bloom, 1x LivingColors Iris), which I haven't tested this workflow with. I will fix this is an update. Sorry for the inconvenience. As a temporary fix, you can find out the ID number of each bulb and use the "-hue set-group" command so that you're only controlling the hue bulbs which I'm pretty sure will prevent this error.
-
That's a pretty strange error and there are a few possible scenarios going on here that I can imagine.
The error is telling me that a certain light attribute isn't present even though it's documented in the Philips Hue Lights API. I wonder if maybe your bridge's software is out of date. If you try using the iPhone or Android app does it prompt you to update?
There also might be some edge case here which I haven't accounted for. Is there anything out of the ordinary going on with your Hue lights? If you turn all of them on do you still get that error? How many bulbs are there? What happens if you type "-hue" and try to set the group or save the current state?
-
Oh no! If anyone's having issues can you make sure Alfred 2 is completely up to date and then try this:
1. Open up Alfred Preferences
2. Go to Workflows
3. Select the Philips Hue Controller workflow
4. Click the "Debugger" icon
Looks like this (the first one on the left):
5. Type "hue" into Alfred
6. Copy and paste what was spit out into the Debugger console.
That should tell me what's going wrong.
Thanks!
Ben
-
UPDATE — I just edited the original post to release version 2.0 of this workflow to you all!
Features include:
- 'Lights' is now the index result set.
- New 'All Lights' option for setting the state for all lights in one command.
- Lights icons are now the actual current light color!
- Save presets states for all lights.
- Set which lights the workflow controls using easy group management via `-hue set-group`
- Set reminders (blink lights after some time delta).
-
Good idea! The "all" option in the lights menu is a no brainer. I'll add that soon.
I'll also be pushing a fix that makes the filter script run much faster.
Please let me know if you run into any issues!
Ben
-
Hey guys, I just published my own Hue workflow here: http://www.alfredforum.com/topic/2723-philips-hue-controller-workflow/
-
-
Philips Hue Controller for Alfred
Quickly and easily control Philips Hue lights with Alfred.
Installation
-
The first time you run the workflow it will ask you to press the button on top of the Hue bridge then action the item to authorize the workflow to control your Hue lights. The workflow automatically attempts to find the bridge on your local network. You can also manually specify the bridge's IP address. For example, if your bridge's IP is 192.168.1.126:
hue 192.168.1.126
Read more about features at the project's Github page.
-
How to tell in workflow code if user has Alfred 2 versus 3?
in Workflow Help & Questions
Posted
Great, thanks for the tips. I'll consider switching over to your awesome-looking Python package and dropping alp