🎉 Party Lights - Randomly loop through color and brightness values

Just create these two automations and sub to your entities :smiley:


#Automation 1 - Save current state:
alias: Auto - Luke Disco Save Light Status
description: ""
trigger:
  - platform: state
    entity_id: input_boolean.disco_luke_helper
    from: "off"
    to: "on"
condition: []
action:
  - service: scene.create
    data:
      snapshot_entities:
        - light.luke_dog
        - light.luke_spot_01
        - light.luke_spot_02
        - light.luke_spot_03
        - light.luke_spot_04
        - light.luke_spot_05
      scene_id: luke_before_disco
mode: single


#Automation 2 - Restore previous state:
alias: Auto - Luke Disco Restore Light Status
description: ""
trigger:
  - platform: state
    entity_id: input_boolean.disco_luke_helper
    from: "on"
    to: "off"
condition: []
action:
  - service: scene.turn_on
    data: {}
    target:
      entity_id: scene.luke_before_disco
mode: single

Then your light will go back to previous state :wink:

1 Like

I’ve used the blueprint to create multiple automations, one for each room in my home. I can now go into party mode in a single room or the whole house. I tested it with the whole house which is 27 lights and it was AWESOME. Setting them all back to normal was a bit of a pain so I do hope something like the above can be integrated into the blueprint.

1 Like

I can’t seem to figure this message board, I’m a blockhead :yum:

I was TRYING to say …

I have to agree with Edvin89!

This was the first blueprint I used PLUS it was one of the main ideas I had wanted to try with my lights.

Thanks much for your work!

That is all! lol

1 Like

For those struggling with getting their lights back to normal after using this amazing blueprint, I came up with the following. It doesn’t actually set it back to what it was but instead back to what you define as default which may well be how they were to begin with. It works for me :slight_smile:

I have separate automations for each room that detect when the corresponding room’s input boolean turns off and it then runs the following code (example from one room shown). I did it this way as it meant I didn’t modify the original blueprint code in case in gets updated. It also allows different settings for each room. Basically when the input boolean turns off the lights will stay as they are, in various colours etc. I let that settle for a few seconds, change the lights to how I normally want them in the room and then turn them off.

Here’s the code. I hope it is helpful. If you have any better ideas I’d love to hear them and of course it would be great to get something like this built into the blueprint.

description: ""
trigger:
  - platform: state
    entity_id:
      - input_boolean.party_lights_tv_room
    from: "on"
    to: "off"
condition: []
action:
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - alias: Set Lights Back to White
    service: light.turn_on
    metadata: {}
    data:
      kelvin: 5500
      brightness_pct: 20
    target:
      entity_id: light.tv_room_lights
  - service: light.turn_off
    metadata: {}
    data: {}
    target:
      entity_id: light.tv_room_lights
    alias: Turn Lights Off
mode: single

It would be great if the BluePrint could include the HA service to create a snapshot of the light entity states prior to any changes so we can call the restore service when turning off ‘party lights’.

eg:

prior to making changes to lights:

      - service: scene.create
        data:
          scene_id: ensuite_lights_snapshot
          snapshot_entities:
            - light.ensuite_led_strip
            - light.ensuite_downlight

Then when turning off party lights:

      - service: scene.turn_on
        data:
          entity_id: scene.ensuite_lights_snapshot

This is just an example from what I do with some lights if my doorbell is pressed where they flash a few times then go back to the previous state.

1 Like

Great blueprint, it could be added that when the trigger is turned off, all bulbs or groups return to warm white. When the trigger goes to OFF, the bulbs remain lit in color. I solved the problem myself by creating an additional script and automation for when the trigger goes to off.