Defining states in scene

Hi folks,

I have created 5 scenes for my bedroom.

I have created automations to launch these scenes.
And I am looking for modifying rules in order to create a condition based on the current scene.

Basically I want to create a little state machine:
If I press on button 1
If scene=1
scene=2
If scene=2
scene=3

I then would like to define a scene sensor and define a state to this sensor in the scene code

I will then use this state as a condition and also to display the current scene in the UI

If my logic is correct I am a bit stuck as a newbie to implement it.

Many thanks in advance for your kind help
Best

Gael

Ok I was a bit in a hurry posting… newbie mistake :slight_smile:
For other newbies, here is how I did:
In my automation.yaml, I define an input select like:

input_select:
  chambre_scene:
    name: Scene Chambre
    options:
       - scene1
       - scene2
       - scene3
       - ...

Then I added after each scene in the scene.yaml

input_select.chambre_scene: sceneXX

and finally in my automations I was able to select as input_select.chambre_scene

In addition, a Selection Frame as appear.

Lesson learned for the newbies:

  1. Read the FAQ of the forum
  2. Search the forum (which is actually written in the FAQ)