WTH is so difficult to make a light blink for a couple of seconds?

You are right as usual, @123. As I add lights and reduce the delay it starts behaving really odd, but most likely for blinking a couple of lights in a not so short interval it would work fine.

I’ve tried as an automation blueprint:
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

1 Like

Yeah, it makes more sense as a script:

As a script:
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

2 Likes

FWIW, the same situation occurs when attempting to emulate transition. There are scripts that ramp brightness and they work reasonably well with a light or two. However, as you’ve discovered for emulating flash, increasing the number of lights can cause erratic behavior due to substantially increased zigbee network traffic.

That’s why transition and flash are implemented exclusively for devices that support the features natively.

1 Like

A side point to consider when changing the state of lights… there may be other automations tied to the changing state of the light(s). You run the risk of causing a cascade of other actions.

This is among the reasons some lighting systems have a specifically separate security or flashing state, so something that tracks the light being turned on, or off, won’t misinterpret the flashing as repeated on/off changes.

1 Like

Hello @EdwardTFN! I’m trying to import this blueprint into my HA and it shows an error saying “No valid blueprint found in the topic. Blueprint syntax blocks need to be marked as YAML or no syntax.”

I also tried to copy and paste this into a script (Scripts > Add Script) and it says “Message malformed: extra keys not allowed @ data[‘blueprint’]”.

I’m really interested in implementing this method in my HA, could you point me on the right steps to follow?

Thank you!
Rodrigo

I don’t know why the original links are failing,mbut please try those (using GitHub instead):

As an automation:
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

As a script:
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Please let me know if you still having issues with those links.

I tried with both links and they show this message:
image
In the meantime, I was able to import another script using the same method, so it seems that the problem is with these specific URLs…

R.

Mmmm…

Those 2 links are working for me.

Let me investigate a bit more…

I got the link working by following what the My integration was passing along and it’s redirecting to https://raw.githubusercontent.com/edwardtfn/ha_blueprints/main/script/EdwardTFN/blink_lights.yaml (the automation link). Maybe the links need corrected to point to the raw.githubusercontent.com domain?

I didn’t got you point, @AnvilPaladin. Aren’t those two links just the same?

Hey!

Sorry, let me try to clarify:

Maybe the redirect is confusing HA and causing it to fail?

Aha!
Now I got it! Thanks for clarifying.

What about these new links:

As an automation:
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

As a script:
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

If this one works I will fix on all my previous posts.

1 Like

That did it! No more errors for me when trying to import either of them :slight_smile:

1 Like

By looking at your automation and your script to blink lights, I can see it uses mode: single, which means multiple simultaneous executions will be ignored. I imagine this is probably fine if each script/automation instance only controls a single subset of the lights. However, if someone tries to be “smarter” and make the script (or automation) take the lights as parameters, then we are in trouble.

For me, this is yet another example of a subtle way things can go wrong because there is no native support for blinking in HA core. Which is yet another argument in favor to what I asked in the top of this thread.

(Note: I have nothing against you, @EdwardTFN, and nothing against your blueprints.) (Note 2: I haven’t had time to try your blueprints, and thus haven’t tried under those racing conditions.)

4 Likes

@ EdwardTFN Thanks for the blueprints. I can’t get the script blueprint to show any inputs though. I suspect fields should be input?

Edit:
Something like this? https://gitlab.com/filmkorn/ha_blueprints/-/raw/main/blink_lights.yaml

For anyone reading - light.toggle is unreliable. if your lights support it, use light.turn_on service’s flash option.

wow, what a journey :smiley:

The problem I had:

  • Some light stay on when I used any kind of flash or toggle automation

I see in the logs from zigbee2mqtt that homeassistant always send a “on” plus the effect. So I end up with sending mqtt messages:

alias: MqttBlink
description: ""
trigger:
  - type: turned_on
    platform: device
    device_id: yyyyyyyyyyyyyyxxxxxxxxxxxxxxxxxx
    entity_id: uuuuuuuuuuuuuuxxxxxxxxxxxxxxxxxx
    domain: binary_sensor
condition:
  - condition: time
    after: "06:00:00"
    before: "21:00:00"
action:
  - service: mqtt.publish
    data:
      topic: zigbee2mqtt/0x001788010yyyyyyy/set
      #Light_Hall
      payload: "{\"effect\":\"blink\"}"
  - service: mqtt.publish
    data:
      topic: zigbee2mqtt/0x001788010ggggggg/set
      #Light_LivR_Couch
      payload: "{\"effect\":\"blink\"}"
  - service: mqtt.publish
    data:
      topic: zigbee2mqtt/0x001788010uuuuuuu/set
      #Light_My_Own_McDonalds_in_Basement
      payload: "{\"effect\":\"blink\"}"
  - service: mqtt.publish
    data:
      topic: zigbee2mqtt/0x001788010xxxxxxx/set
      #Light_Catroom
      payload: "{\"effect\":\"blink\"}"
  - service: mqtt.publish
    data:
      topic: zigbee2mqtt/0x001788010448a00a/set
      #Light_Kinddom_Garden
      payload: "{\"effect\":\"blink\"}"
  - service: mqtt.publish
    data:
      topic: zigbee2mqtt/0x001788010ppppppp/set
      #Light_Fireplace
      payload: "{\"effect\":\"blink\"}"
  - service: mqtt.publish
    data:
      topic: zigbee2mqtt/0x001788010wwwwwww/set
      #Light_Restroom
      payload: "{\"effect\":\"blink\"}"
mode: queued
max: 5

This works very good!

But because my next plan is to used special color-codes with flash, I think I need a kind of state-memory where the automation can revert then…

If you have no blink effect you can also use toggle with some delay:

alias: Kind-of-a-Light-Flash
description: ""
trigger:
  - type: turned_on
    platform: device
    device_id: yyyyyyyyyyyyyyxxxxxxxxxxxxxxxxxx
    entity_id: uuuuuuuuuuuuuuxxxxxxxxxxxxxxxxxx
    domain: binary_sensor
condition:
  - condition: time
    after: "06:00:00"
    before: "21:00:00"
action:
  - service: light.toggle
    data: {}
    target:
      device_id:
        - iiiiiiiiiiyyyyyyxxxxxxxxxxxxxxxx
        - gggggggggggggggghhhhhhhhhhhhhhhh
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 700
  - service: light.toggle
    data: {}
    target:
      device_id:
        - iiiiiiiiiiyyyyyyxxxxxxxxxxxxxxxx
        - gggggggggggggggghhhhhhhhhhhhhhhh
mode: queued
max: 5

1 Like

How do I know if my light supports it? Will there be an error in the logs if I try to use it and the light doesn’t support it? Or will the problem be silently ignored? Is there a difference in behavior/implementation of flash between zigbee vs wifi lightbulbs?

Blink should show up in Developer Tools as an effect if it’s available

1 Like

Alright, so it isn’t there on my list of effects:

I was asking because I’ve tried to use flash on the lightbulb, but it didn’t work → and yet I haven’t seen any error or nothing, so I wasn’t sure if it’s me, or the HA, or the lightbulb :wink:

Everything effect, but blink :rofl:

I’ll try it with one of my Hue bulbs.