Hue random color effect not supported anymore?

Hi there,

I had setup an automation which runs every few seconds and calls this:

service: light.turn_on
data_template:
  entity_id:
    - light.hue_color_spot_1_2
  effect: random

and this would turn this hue color spot light to a random color each time. I just updated Home assistant this morning to core-2021.12.1 and now this does not seem to work at all anymore.

This code does not work either if I manually run it using the development tools, so it’s not the automation per se which is the problem.

I saw some hue related changes in the change log and under breaking changes but it was not obviously related to this as far I can tell. Am I missing something?

The Hue integration is now using the new API created by Signify (Philips). The new API eliminated all effects (colorloop and random).

You’ll have to create your own method of selecting random colors. For example:

service: light.turn_on
target:
  entity_id: light.hue_color_spot_1_2
data:
  color_name: "{{ ['lawngreen', 'blueviolet', 'magenta', 'yellow', 'red'] | random }}"

Reference
Color names

2 Likes

Thanks. I actually did not realize that the random effect was a functionality in the Hue bridge. I thought it was something implemented by Home Assistant :slight_smile:

don’t suppose there is anything easy to bring back colorloop? There is a hue lab skill - is there a way of triggering that instead?

1 Like

You’re welcome!

Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions. For more information refer to guideline 21 in the FAQ.

Sure, your solution is actually brilliant, that way I can control which colors are used. So in that sense it’s even better than using the colorloop effect provided by the Hue bridge!

Thanks again!

1 Like

I would not say it’s random anymore…

1 Like

Please elaborate … it does not have to be “properly” random in my case, I just need rotating/alternating colors. It’s a christmas light automation where I have three Hue color G10 bulbs displaying alternating colors. For that, this works fine :slight_smile:

I very much enjoy the option to make all my lights in a room go to a completely random color. But you are correct, that might not be the case for you.
I use the random effect on a light group it would make all the lights individually a random color. The suggestion solution would make all the lights the same random color.

And then again, a complete random between all the colors the bulb can make or a random between the colors described is different too.

I’m not sure why HUE took out the option to use it…

1 Like

Probably because they thought few people needed a roomful of randomly colored lights, so they eliminated it (and colorloop). However, they added dynamic scenes whose functionality they continue to improve (since first released earlier this year).

Anybody figure out an elegant solution to this, I used the random and color loop effect pretty heavily with Hue.

3 Likes

Similar to the random approach above, I replaced the random color effect with a yaml that uses hs_color and two random values. 0-360, and 0,100 though I’m using 50-100 for the saturation value and may just change it to 100.

Still looking into a solution for colorloop though.

service: light.turn_on
target:
  entity_id: light.kids_room
data:
  brightness_pct: 100
  hs_color: '[{{ range(0, 360) | random }}, {{ range(50, 100) | random }}]'
2 Likes

BTW, where is the difference between:

service: light.turn_on
entity_id: light.sofaecke

or

service: light.turn_on
target:
  entity_id: light.sofaecke

or

service: light.turn_on
data:
  entity_id: light.sofaecke

as everything is working and you can find this or that in the docs and examples and usages?

They are all the same. Just different ways to call it. Each variation has been added over time to solve a problem. The “old ways” have never been removed to maintain backward compatibility.

See this for details

1 Like

More than great. Thanks for this link to your post.

It could be a script or a scene, it’s just up to you. In my case, I created it as a script. Then I have an automation with a time-based trigger (triggers every 5 seconds) and the specified action in the automation is to run this script. I could just as well have created this as a scene, and then had the automation activate that scene.

If you want random colors upon pressing a button, that should also work regardless of it being a scene or a script. A button can be set to activate a scene or run a script :slight_smile:

Yeah i’d love colorloop back as well

I want “colorloop” back as well. Where do we petition Signify (Philips); to return “colorloop” to the API.

Or has someone found a work around for “colorloop”?

1 Like