This Alfred workflow allows you to interact with your Home Assistant instance directly from Alfred. You can quickly toggle lights, switches, and other entities, as well as adjust brightness levels for lights.
There is an existing workflow created by @Skakiz. It was forked to support long-lived access tokens, which are now required. However, it uses Python 2 and would need changes to work in modern environments using Python 3.
I'm not great with Python. In addition, all that I require is a simple and quick way to toggle lights and switches. Therefore, I decided to write a quick replacement in Ruby.
- List Entities: Quickly list and filter entities from your Home Assistant instance.
- Toggle Entities: Toggle lights and switches on or off directly from Alfred.
- Adjust Brightness: Adjust brightness levels for lights by specifying a brightness value.
- Download the workflow file from the releases page.
- Double-click the downloaded file to import it into Alfred.
- Configure the workflow by clicking the "configure" keyword and entering your Home Assistant instance URL and access token.
- Type
ha
in Alfred to list all entities from your Home Assistant instance. - Use keyword arguments to filter entities by name. For example,
ha living
will filter entities with "living" in their name.
- To toggle an entity (e.g., light or switch), select it from the list and press Enter.
- To adjust the brightness of a light, select it from the list and append
%brightness_value
to the entity ID. For example,light.living_room %50
will set the brightness of the "Living Room" light to 50%.
- You can exclude entities from the list by configuring exclusions in the workflow settings. Wildcards (*) can be used for pattern matching.
- Click the "configure" keyword in Alfred to open the workflow settings.
- Enter your Home Assistant instance URL and access token.
- Configure excluded entities by entering entity IDs or patterns using wildcards.
If you encounter any issues or have suggestions for improvement, please open an issue on GitHub. PRs are also welcome.