Cycle through a set of Scenes

To give an idea of where I’m at with HA: I’ve been happily using running my system for about a year now and I am happy to tinker around with things.

I have an IKEA Styrbar remote and a set of smart bulbs with 3 scenes (cosy, watching TV, and eating) that I’d like to cycle through when I press the > button. I found a great walkthrough by Smart Home Junkie, but it’s quite old and it occurs to me that there might be a better way to achieve this in 2025.

So I have a dropdown Helper with the entity_ids of the Scenes called scene_selector:

  • scene.cozy
  • scene.watching_tv
  • scene.eating

It feels like a possible way forward is to create an Automation that triggers when I press > :

Then do:

action: input_select.select_next
metadata: {}
data:
  cycle: true
target:
  entity_id: input_select.scene_selector

This changes the state/value of input_select.scene_selector, which is nice to see.

At this point, it’d be really cool if it were possible to find a scene with the name of the current value of input_select.scene_selector, and then turn it on.

action: scene.turn_on
data:
  entity_id: input_select.scene_selector_living_room

The above doesn’t work. Is there a way to pass a variable to the scene.turn_on action? Thanks in advance!

1 Like
action: scene.turn_on
target:
  entity_id: "{{ states('input_select.scene_selector_living_room') }}"
1 Like

Also if you change your input select options to something that looks nice in a dashboard, like:

  • Cozy
  • Watching TV
  • Eating

You can still use it like this:

action: scene.turn_on
target:
  entity_id: "scene.{{states('input_select.scene_selector_living_room')|slugify }}"

Brilliant, thanks for your help! This works perfectly and I’m delighted that, all going well, I can can add/remove new scenes to this without touching the YAML :slight_smile:

Hi

I created a custom component that may help you.

See my comment in this thread about it: How To Cycle Through Scenes - #30 by 0x3333

Example of automation with it:

alias: TV Room - Switch 1
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.social_tv_switch_1
    from: "off"
    to: "on"
conditions: []
actions:
  - action: scene_sequencer.cycle
    metadata: {}
    data:
      scenes:
        entity_id:
          - scene.tv_all_on
          - scene.tv_afternoon
          - scene.tv_movies
          - scene.tv_all_off
      go_to_last_timeout: 5
mode: single

Best,

How do es one use this? Is there a GUI? If so, where? If not, where does this code get pasted?

The above code is an automation. You need to use the service like above using your scenes as parameter.

Hi, I’ve been grappling with the same challenge with 6 kitchen ZHA spotlights in 2 strips (recreating Deconz scene+button functionality). With the input selector sorted, the action was the last clue needed Thanks Heaps :slight_smile:

1 Like

You can add the (entity) YAML via the GUI