🎉 Party Lights - Randomly loop through color and brightness values

Get it now:
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Introduction:

When ‘party mode’ is turned on, your lights will start looping through random color and brightness values, creating an ever changing atmosphere.

How it works:

  1. Select your party mode trigger.
    ( Can be a switch or input_boolean entity. Once turned on the party mode will be activated)

    • :warning: NOTE: :warning:
      If you don’t have a switch or boolean trigger yet, you can create an input_boolean helper by going to Settings > Devices & services > Helpers
      There you click on 'Create helper and choose ‘Toggle’.
  2. Select the lights you want to control.
    (Only light entities are supported)

  3. Choose if the light need to be synchronized or not.
    If more than 1 target light is selected, choose if they will all change together or if they each get their own random values.

  4. Set the time between changes. This determines how often the lights will change their color or brightness.

  5. Optionally set a transition time. This will smooth out the transition from the set value to the next, essentially creating a fading effect. (This value should be smaller than the time between changes, otherwise your lights may run into a buffering issue.)

  6. Select how the lights need to change color:

    • :black_large_square: NO COLOR CHANGE: Don’t change colors.
    • :rainbow: RANDOM COLOR MODE: Change all RGB values randomly.
    • :red_square: RED ONLY MODE: Change only red value randomly.
    • :green_square: GREEN ONLY MODE: Change only green value randomly.
    • :blue_square: BLUE ONLY MODE: Change only blue value randomly.
    • :blue_square: TEALS ONLY MODE: Change only teal value randomly.
    • :blue_square: PINKS ONLY MODE: Change only pink value randomly.
    • :blue_square: YELLOWS ONLY MODE: Change only yellow value randomly.
  7. Select how the lights need to change brightness:

    • RANDOM BRIGHTNESS: Change the brightness randomly within a set range
    • FIXED BRIGHTNESS: Keep the light at a user defined brightness
  8. Set the brightness range in which the random setting can be chosen (RANDOM BRIGHTNESS MODE) or set the brightness at which the lights need to be set (FIXED BRIGHTNESS MODE).

  9. Add effects (supported effects are determined by your specific smart bulbs).

  10. Set the behaviour of the lights when the party mode is turned off:

    • NO CHANGE: Keep the lights in the state they are at the end of the party.
    • LIGHTS OFF: Turn the lights off.
    • RETURN TO PREVIOUS STATE: Return the lights to the state they were before the party began.
    • USER DEFINED SCENE: Activate a scene that determines the state of the lights after the party.
    • SCENE THEN TURN OFF: Set the lights to a specific setting by activating the user defined scene, then turn them off.
  11. Select a user defined scene (only if the after part state is ‘USER DEFINED SCENE’ or ‘SCENE AND TURN OFF’)

  12. Set the delay before turning the lights off (only if the after part state is ‘LIGHTS OFF’ or ‘SCENE AND TURN OFF’)


Most recent version:

2.3:

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.
:link: Source code (Github)
:gear: See code changes (Github)


:memo:Changelog:

16/09/2024 - Version 2.3

  • Added support for shorter delays by adding a millisecond option to the ‘time between changes’.
    WARNING: this might cause a buffering issue to occur because of the frequent changes.
  • Modified some explanations to improve user friendliness.
See older changes

06/09/2024 - Version 2.2

  • Added a new after party state:
    SCENE THEN TURN OFF:
    Set the lights to a specific setting by activating the user defined scene, then turn them off.
  • General code corrections

06/09/2024 - Version 2.1

  • General code corrections
  • Layout modification for improved user friendliness
  • Correction of some spelling mistakes

06/09/2024 - Version 2.0

  • Added user defined behavior when the party mode is turned off.
    4 options are available:
  1. NO CHANGE:
    Keep the lights in the state they are at the end of the party.

  2. LIGHTS OFF:
    Turn the lights off.

  3. RETURN TO PREVIOUS STATE:
    Return the lights to the state they were before the party began.

  4. USER DEFINED SCENE:
    Activate a scene that determines the state of the lights after the party.

05/09/2024 - Version 1.4

  • Added a feature where your lights will return to the previous settings when the party mode is stopped.
  • Added the option to set effects for the lights.
  • Removed a logging action (was used for debugging).
  • General code corrections.
  • Modified some descriptions to improve user friendliness.

26/01/2024 - Version 1.3

  • Corrected the REDS, GREENS and BLUES only modes.
  • Added TEALS, PINKS and YELLOWS only modes.
  • General code correcting to improve user-friendliness.

22/01/2024 - Version 1.2

  • Re-added the option to select multiple target lights.

16/01/2024 - Version 1.1

  • Added a sync switch for the lights. When multiple lights are selected, this will allow the user to choose if all lights get the same random value assigned or if they all get a different random value assigned.
    :warning: WARNING: This is a breaking feature. You will have to re-select the target lights after re-importing the Blueprint.

  • Changed some descriptions to improve user-friendliness.

15/01/2024 - Version 1.0

  • Original release
6 Likes

Think your “MY” link to import is pointing to the wrong Blueprint…showing as Multi Click Button Blueprint…GitHub link is fine

1 Like

Thanks for the heads up!

It’s corrected now.

1 Like

NEW RELEASE:

16/01/2024 - Version 1.1

  • Added a sync switch for the lights. When multiple lights are selected, this will allow the user to choose if all lights get the same random value assigned or if they all get a different random value assigned.
    :warning: WARNING: This is a breaking feature. You will have to re-select the target lights after re-importing the Blueprint.

  • Changed some descriptions to improve user-friendliness.

What a coincidence! Just the day before you released this blueprint, I told my wife that I was going to fix some party lighting effects with our lights at home as our five year old son started playing DJ with a mixer he got for Christmas.

But having a little trouble getting it to work as I think the idea with it is.
Under target lights, I can only select one Entity, which I guess must then be a group for the lights that you want to control.
But when I put some lights in a group and select that light group, it does nothing if I don’t choose to synchronize the lights, then unfortunately the lights I selected don’t have different colors.

Any idea what I might have done wrong?

The target lights selector allows multiple entities to be selected. (Make sure you update to the latest version: Settings > Automations & scenes > Blueprints > Re-import Blueprint)

It should look like this:

In fact, it’s better to select all lights separately, as that will allow you to randomize each light by turning off the synchronization.
Light groups will be seen as a single entity, so all lights will change together by default.

I hope that made things a bit clearer. Let me know if you need any more help.

Unfortunately, it doesn’t work that way for me when I add an entity.
No new entity selector comes up so I can select more lights.

I had the latest version (1.1), I’ve tried deleting the blueprint and re-adding it with the same result.

1 Like

You’re correct, the option to select multiple lights got removed by accident in one of the previous code changes.
I’ve release version 1.2, which corrects this.

NEW RELEASE:

22/01/2024 - Version 1.2

  • Re-added the option to select multiple target lights.
1 Like

Now it works as it should.

Thank you so much for all your work with the blueprints you shared with us.

1 Like

This is the first blueprint I used. It’s really cool! Thanks for the work you put in.
I like all the customization options. “GREEN ONLY” is my favourite! The only idea I would like to add is for the lights to change at random times, currently they seem to change their colour almost at the same time.

1 Like

I like this too, even though I only have one light that does colours. Do you have plans for a later feature to return the lights to their original state after turning off the toggle?

1 Like

Thanks, that means a lot given the time I’ve put in.

Thanks a lot, great to see you’re enjoying the blueprint.

That sounds like a good idea. I’ll see if I can come up with something for a next release.

1 Like

My parties usually last from day to night, so I don’t want my lights to be the same after :smile:.
Nevertheless, sounds like an interesting feature to add for a future release.

NEW RELEASE:

26/01/2024 - Version 1.3

  • Corrected the REDS, GREENS and BLUES only modes.
  • Added TEALS, PINKS and YELLOWS only modes.
  • General code correcting to improve user-friendliness.
1 Like

Hi, Great blueprint. Somethng I have occasionally missed since moving all my Hue stuff over to HASS direct via Zigbee2MQTT.

Couple of suggestions or tips.

I have a christmas lights routine setup on some lights. They are controlled via zigbee2mqtt and I find if the time period between colours is too quick it floods the zigbee channel and stuff starts being an issue. Might be necessary to have a minimum change time to avoid it. Particularly if each bulb/light is getting its own message. Or at least a health warning to the user to know about it, suggest a minimum of x but let them go lower if they want.
I had my lights set for 5 seconds or 10 seconds and at 5 seconds after a while issues would start. That was for a set of house up-lighters with 8 different bulbs that might be on for 10 hours a day though.

Great to have a reset where when the toggle/helper is turned off, the lights all go to a default colour of something more natural. eg 100% white. As a final clean up.

Great work though. I will stay tuned!

1 Like

Great script!

Could you add a feature to have max hue (avlidit greys and whites)? An possibly also have min hue for only different hues of white.

Thank you for creating this! I’ve got a lot of Tuya lights and whilst you can use their app to do similar things, the scenes do not come over to Home Assistant.

Someone above mentioned an improvement for what happens when this is turned off. Right now it just stops where it was so your lights are likely to be multi-coloured, all red etc. It would be great if it could either revert to what they were when the automation kicked in or to some other preset that can be set when setting up the automation. Yes I know I can create a separate automation to do this but it would be nice to have it all in the one automation.

Another feature request would be able to select a number of colours that are used. The random stuff is great for parties but I’d like to be able to use it for special days like Australia Day (just green and gold/yellow), special sports days with just the team colours etc. I know this is well beyond your original idea but maybe you like the idea too :slight_smile:

Update: I’ve been playing with this a bit today. I’ve now got a few automations for various parts of the house so I can have the whole house in party mode or just sections. I’m also trying to work out how to schedule it for certain dates every year. The main scheduler requires you to set a year. Without a year I can set it so the house front lights are in party mode from Dec 1st to Jan 2nd every year.

1 Like

Thanks for the feedback.
I’ve added the feedback to the list of additions to make. When I have the time, I’ll get working on them.

1 Like