Hypfer / hass-scene_presets

Hue-like scene presets for lights in home assistant
Apache License 2.0
128 stars 9 forks source link
home-assistant
scene_presets


This custom_component is an implementation of an idea not all too dissimilar to what the Philips Hue app calls Scenes. Apart from that though, it has nothing to do with Hue. No bridge required.

Everything has been implemented entirely inside this custom_component, meaning that it works with every light entity. No vendor restrictions. No need for special bridges. And, most importantly, no account required :-)

Screenshots

ui.png

service.png

Installation

  1. Add the repository as a custom repository of type integration in HACS: https://hacs.xyz/docs/faq/custom_repositories/
  2. Restart Home Assistant
  3. Navigate to Settings > Devices & Services
  4. Click Add integration
  5. Search for Scene Presets
  6. Click on it and follow the wizard 🧙

You should now have a new item in your sidebar.

Usage

The scene_presets component can either be used via its UI or by calling its services in automations, scripts etc.

It is compatible with any color-capable light entity. Additionally, it will also try its best to map colors to a matching color temperature if it encounters a light that only features tunable white capabilities.

UI Usage

To get to know what is possible, I'd recommend opening up the UI first and playing around for a bit.
For that, simply open the Home Assistant sidebar, navigate to "Scene Presets", select your lights and then click on a preset tile to apply it.

The UI will remember your favorite presets, your last selected targets and the last state of your tunables in your browser's local storage.
This means that it is persistent but not synced across devices.

The tunables section allows you to further customize how the preset should be applied.
In normal mode, you have the following options:

Dynamic Scenes

If you enable the dynamic toggle, you will have Dynamic Scenes.
These are endless loops that apply the same preset with smart shuffled colors every interval with a transition as specified.

Dynamic Scenes can be useful to e.g. have ambient lighting that constantly changes but does so mostly unnoticeable.
For that effect to work, you of course need to pick suitably long durations for interval and transition.

You can see all active dynamic scenes at the top of the UI. To stop them, just tap them.

Furthermore, you should know that

Service usage

The UI is not the only way to use this component. In fact, it too just calls the services provided by it.

You can use the services to e.g. bind scene presets to a button on a remote or someone entering a room or maybe even a voice command.

To make this easier, you can use the UI, do the action you'd like to do and then click on the robot icon on the top right.
This will then open a dialog that looks like this with a copy-pasteable service call for easy automation:

last_action_payload.png

Advanced usage

For advanced usage, use the Home Assistant DevTools and call the services provided by the custom_component directly.
Preset IDs can be found in the overview here: assets

If you're a developer, you can also add your own presets by creating a json file.
Check the docs page on that for more info.

Docs

Check out the ./docs/ folder.

Misc

This component provides all the scene presets that were available in the Hue App scene gallery on 2023-09-28. These have been manually extracted in a clean-room way by setting a group of lights to a scene and then noting the different x,y values + its name. Thanks again to @coderph0x!

Check out the assets folder for a list with all presets available.