WTH the 'flash: short' behavior is inconsistent between integrations

(EDIT: the topic was renamed from “WTH The “flash” effect on ZHA lights leaves them on instead of returning to previous state” to “ WTH the ‘flash: short’ behavior is inconsistent between integrations”)


I have some Zigbee lights (from Philips Hue and from IKEA Tradfri) paired either to Philips Hue bridge or to HA through ZHA.

When I use the flash: short (I’ve never tried with long) parameter of light.turn_on, the lights paired with the hue bridge seem to return back to their previous state (on or off). However, the lights paired with ZHA will always be left ON after blinking. WTH?

Also, I think the real-world light state (it’s on and emitting light) gets out-of-sync with the software HA state. (i.e. I think HA still thinks the light is off right after blinking, while it’s illuminating its surroundings. I’m not totally sure about this, though.

I wish I could help you more, but I don’t have much time to investigate it myself, and I’m writing this from my memory.


Semi-related thread, but still different enough: WTH is so difficult to make a light blink for a couple of seconds?

The documentation of service.lightturn_on is not exactly precise enough.

Personally if I were to turn a light on and ask it to flash, then I expect it to turn on an flash forever, where short would be flashes of a short duration, and long of a long duration.
If there would be a service call indicating the on time, then the total duration would only be that long.

In zigbee there is a function that is called “Identify” which - when the device accepts it - allows setting a “Trigger effect”. In my experience, the Trigger effect for lights is “breathe” by default. The Identify command also comes with a duration.
My guess is that the Hue bridge uses that to make the light “flash”.

As I have an automation which makes the light flash and keeps the final state as it was before, I checked it out and it turns out it has an action type “flash” which is not documented. Which I tested in a script and leaves the light on:

alias: Test Flash
sequence:
  - device_id: 37502f6423b5b7c825d845bc4774fca2
    domain: light
    entity_id: light.tz3000_dbou1ap4_ts0505a_9afc91fe_level_light_color_on_off
    type: flash
mode: single

I then tried the Identify function which is called press for an action:

alias: Test Flash
sequence:
  - device_id: 37502f6423b5b7c825d845bc4774fca2
    domain: button
    entity_id: button.tz3000_dbou1ap4_ts0505a_9afc91fe_identify
    type: press
mode: single

Which strangely enough had no effect on my light. Maybe the trigger effect is set to OFF, I didn’t check that out.

As you mention it is part of the turn_on service which is why it also gets turned on (I guess).
It would be nice if there was a just flash without influencing the rest of the state service.

I agree thatn when it is in the light_on service that the state at the end would be on, but when it is the “flash” action, then the state should be maintained.

I agree, and for that I opened WTH is so difficult to make a light blink for a couple of seconds?

THIS thread, however, is about… WTH the flash: short behavior is inconsistent between integrations‽ Either leave it on afterwards (like the ZHA integration, because it’s light.turn_on service), or leave it back to the same state afterwards (like Hue integration, because it’s just flashing).

I’m going to rename the thread.

1 Like

Ah ok, I misinterpreted that. Voting on the other one also :slight_smile: