🚨 Custom Blinking Lights Blueprint

Richard,

Not a problem at all, you have sowed the foundation for a useful blueprint.
Take your time and don’t put down your skills. You have done well to get it this far.
You will crack it :slight_smile:

Thanks

Hi Szalony-West,

I’ve added the transition_length option to the blueprint as requested. It allows you to set a custom transition time for the lights, overriding the device’s default transition setting. Everything is working fine on my end, but I wanted to check if it’s working as expected for you as well.

If it works for you, I’ll update the main blueprint to include this feature!

Let me know if you encounter any issues or if there’s anything else you’d like to tweak.

blueprint:
  name: Blinking Lights with Restore and Transition
  description: Blink selected lights in a specific color and restore their original state, with custom transition support.
  domain: automation
  input:
    lights:
      name: Lights
      description: Select the lights to blink.
      selector:
        target:
          entity:
          - domain:
            - light
    color:
      name: Blink Color
      description: Choose a color for blinking.
      selector:
        color_rgb: {}
    blink_count:
      name: Blink Count
      description: How many times should the lights blink?
      default: 3
      selector:
        number:
          min: 1.0
          max: 10.0
          step: 1.0
          mode: slider
    blink_duration:
      name: Blink Duration (seconds)
      description: How long should each blink last?
      default: 1
      selector:
        number:
          min: 0.1
          max: 5.0
          step: 0.1
          mode: slider
    trigger_entity:
      name: Trigger Entity
      description: Select the entity that triggers this automation.
      selector:
        entity:
          multiple: false
    from_state:
      name: From State (optional)
      description: Enter the state to trigger from (leave empty for any state).
      default: ''
      selector:
        text:
          multiline: false
          multiple: false
    to_state:
      name: To State (optional)
      description: Enter the state to trigger to (leave empty for any state).
      default: ''
      selector:
        text:
          multiline: false
          multiple: false
    flash_with_off:
      name: Flash with Off
      description: Turn off lights between blinks? If unchecked, the lights will return
        to their original color between blinks.
      default: true
      selector:
        boolean: {}
    transition_length:
      name: Transition Length (seconds)
      description: Set a custom transition time for the lights (overrides device default).
      default: 0.5
      selector:
        number:
          min: 0
          max: 5
          step: 0.1
  source_url: https://community.home-assistant.io/t/custom-blinking-lights-blueprint/796494
mode: restart
variables:
  lights: !input lights
  blink_count: !input blink_count
  blink_duration: !input blink_duration
  color: !input color
  trigger_entity: !input trigger_entity
  from_state: !input from_state
  to_state: !input to_state
  flash_with_off: !input flash_with_off
  transition_length: !input transition_length
trigger:
- platform: state
  entity_id: !input trigger_entity
action:
- service: scene.create
  data:
    scene_id: light_restore_scene
    snapshot_entities: '{{ lights.entity_id }}'
- repeat:
    count: '{{ blink_count }}'
    sequence:
    - service: light.turn_on
      target: '{{ lights }}'
      data:
        rgb_color: '{{ color }}'
        brightness: 255
        transition: '{{ transition_length }}'
    - delay: '{{ blink_duration | float }}'
    - choose:
      - conditions:
        - condition: template
          value_template: '{{ flash_with_off }}'
        sequence:
        - service: light.turn_off
          target: '{{ lights }}'
          data:
            transition: '{{ transition_length }}'
      - conditions:
        - condition: template
          value_template: '{{ not flash_with_off }}'
        sequence:
        - service: scene.turn_on
          data:
            entity_id: scene.light_restore_scene
    - delay: '{{ blink_duration | float }}'
- service: scene.turn_on
  data:
    entity_id: scene.light_restore_scene

Cheers! :blush:

Forum Post: Update - Blinking Lights Blueprint with Transition Time Support

Hi everyone,

I’m excited to share an update to the Blinking Lights Blueprint that introduces custom transition time support! :tada:

:new: What’s New?

  • Transition Length Option: You can now set a custom transition time for your lights during the blinking sequence. This feature overrides the default transition time of your lights, ensuring smooth operation even if your device has a predefined transition length (e.g., in ESPHome).

:hammer_and_wrench: How It Works:

  • A new transition_length option allows you to specify a transition time (in seconds) for light on/off actions.
  • The feature ensures that blinking effects remain visible even if the blink_duration is shorter than the device’s default transition time.

:bulb: Use Case:

This update is particularly useful for setups where the default transition length of your lights is too long, making blinking effects less noticeable. For example, if you have ESPHome lights with a default_transition_lengthsetting, this blueprint now works seamlessly without overriding global settings.

:clipboard: Example:

  • Blink Duration: 1 second
  • Transition Length: 0.5 seconds
    • Lights will transition on/off in 0.5 seconds, ensuring the blinking sequence is smooth and visible.

:link: Updated Blueprint:

You can find the updated blueprint here.

:hammer_and_wrench: Feedback:

As always, I’d love to hear your feedback! Let me know if the transition time works for your setup or if you encounter any issues. :blush:

1 Like

hello. I see the updated blueprint in the first post at the top. I checked it, it works as it should, it does what it was designed for! Great job, I’m impressed with the quick solution! thank you and good luck with your next projects.

Pozdrawiam -West

1 Like