nilsreiter / home-assistant-scenes

Nice, Hue-inspired scenes for Home Assistant
29 stars 3 forks source link
home-assistant scene

This script replicates Hue scenes for Home Assistant. Each scene has five different colors represented by XY values. These colors are distributed randomly on the participating lights (must support XY or RGB color modes) -- each light gets a different color.

The script can run in two modes, selectable at runtime, corresponding to setting lights once or repeatedly. If repeat_delay is specified at the start of the script, it runs continuously, with the specified delay in between rounds. In this case, the end of the script is determined by the stop_when_lights_turn_off parameter: If set to true, the script turns off when one of the participating lights is turned off. If set to false, the script runs until it is turned off.

If repeat_delay is left empty or set to 0:00:00, lights are set once and the script ends.

The script has various configuration options, described below.

Usage

The intended setup is to instantiate the blueprint for each area in which it will be run. To facilitate daily use, you can define buttons as pre-defined action call. To launch the scene "Savanna sunset" as a dynamic scene, you can define a mushroom card like this:

type: custom:mushroom-template-card
primary: Savanna sunset
picture: /local/hue/Savanna sunset.jpg
tap_action:
  action: call-service
  service: script.hue_like_scenes
  target: {}
  data:
    scene: Savanna sunset

If called as part of another script, make sure to use the action script.turn_on, so that it runs in the background (see here):

action: script.turn_on
data:
  variables:
    scene: Savanna sunset
metadata: {}
target:
  entity_id: script.hue_like_scenes

Changelog

3.2

3.1.1

3.1

3.0

2.5.1

2.5

2.4

2.3

2.2

2.1

2.0

Scene images

The images used in the Hue app to represent a scene use creative commons licenses. The following is a list of (some) scenes and image sources: