Trying to create a color change automation w/ dropdown

I am trying to create an automation that chages a colour light bulb to the next color setting in a dropdown list. I have used a couple blueprints that do this, but I do not have a clue to turn this into lovelace automation.

Any hints, pointers on how to do this?

Greg

Does the state of the select/input_select need to stay put or can it change?

No sure what you are asking. I am guessing either would be ok.

Greg

I’m just trying to figure out how you want/need this automation to work… so far we know there’s a light and a color selection dropdown, but you haven’t provided enough info for us to know how they already relate to each other, how they need to function in relation to one another, what will trigger the automation, what conditions need to be met, etc.

Ah, sorry not enough coffee when I replied before.

We can start with a clean slate. I have a color lightbulb, and a remote switch with a spare button.
What I was hoping to have happen is for the light to go through a colour change with each press of the button. If something like this exists already I can use that. Like I said I have the blueprint for an IKEA switch, but too much of a NOOB here to know how to change it.

Greg

If you are already using the blueprint for other button functions on the remote, you probably don’t need an automation but a script. Scripts can be called like a service from a blueprint, automation, or dashboard button.

Your script could be something like:

alias: Change Input Select Update light color
sequence:
  - service: input_select.select_next
    data:
      cycle: true
    target:
      entity_id: input_select.color_names
  - delay:
      milliseconds: 100
  - service: light.turn_on
    data:
      color_name: "{{ state('input_select.color_names') }}"
    target:
      entity_id: light.example_light
mode: single

In your blueprint, you would then find the option for the button in question and select a Call Service action with script.change_input_select_update_light_color as the service.

1 Like

Thanks I will give that a try!
Thanks for your help!

Thanks for the hint @Didgeridrew! Im so happy to get it working with your help!

My lamp didnt support the Colors as a name, just push RGB Values so this script worked for me:

alias: Farbwechsel der Lampe RGB Kugel
sequence:
  - service: input_select.select_next
    data:
      cycle: true
    target:
      entity_id: input_select.rgb_color
  - delay:
      milliseconds: 100
  - service: light.turn_on
    data:
      rgb_color: "{{ states('input_select.rgb_color').split(',') }}"
    target:
      entity_id: light.iot_z_lampergb_kugel_licht
mode: single

The Value in the Helpers can be:
Helper Name: rgb_color
Option:
255,0,0
0,255,0
0,0,255
and so on

So when you add the script to an button action on a Ikea blueprint, you can change the colors on a button press.