Automation to cycle through scenes NFC tag

The behavior I’m trying to accomplish by tapping an NFC tag with my phone

First tap. Scene 1 (Turn on light bright)
Next tap. Scene 2 (Set brightness 25%)
Next tap. Turn off light

Is this Doable?

Ok… I’ve figured this out.
Hopefully this helps someone else.

I’ve created 4 scenes
Bright
Dim
TV
Off

Then I created a text input helper
I set the value to Off (my lights were off)

I added an NFC Tag

In my automation
Using choice
I activate the scene based on the input text value and then set input text value to the current scene.

alias: Living Room Tag lights
description: ""
trigger:
  - platform: tag
    tag_id: 9dd1e13e-3fdc-427c-b046-f32f581b45ef
  - platform: tag
    tag_id: 9a9f6b58-e4db-4f6d-afd8-d2cac9476adb
condition: []
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: input_text.living_room_active_scene
            state: "Off"
        sequence:
          - service: scene.turn_on
            target:
              entity_id: scene.lrlights_warm_white
            metadata: {}
          - service: input_text.set_value
            data:
              value: Warm
            target:
              entity_id: input_text.living_room_active_scene
      - conditions:
          - condition: state
            entity_id: input_text.living_room_active_scene
            state: Warm
        sequence:
          - service: scene.turn_on
            target:
              entity_id: scene.living_room_dim
            metadata: {}
          - service: input_text.set_value
            data:
              value: Dim
            target:
              entity_id: input_text.living_room_active_scene
      - conditions:
          - condition: state
            entity_id: input_text.living_room_active_scene
            state: Dim
        sequence:
          - service: scene.turn_on
            target:
              entity_id: scene.living_room_tv
            metadata: {}
          - service: input_text.set_value
            data:
              value: TV
            target:
              entity_id: input_text.living_room_active_scene
      - conditions:
          - condition: state
            entity_id: input_text.living_room_active_scene
            state: TV
        sequence:
          - service: scene.turn_on
            target:
              entity_id: scene.living_room_off
            metadata: {}
          - service: input_text.set_value
            data:
              value: "Off"
            target:
              entity_id: input_text.living_room_active_scene
mode: single

Create an Input Select with the following four options (in this exact order):

  • Off
  • Warm
  • Dim
  • TV

Create the following automation:

alias: Living Room Tag lights
description: ""
trigger:
  - platform: tag
    tag_id: 9dd1e13e-3fdc-427c-b046-f32f581b45ef
  - platform: tag
    tag_id: 9a9f6b58-e4db-4f6d-afd8-d2cac9476adb
condition: []
action:
  - variables:
      selection: input_select.living_room_active_scene
      scenes:
        Off: lrlights_warm_white
        Warm: living_room_dim
        Dim: living_room_tv
        TV: living_room_off
  - service: scene.turn_on
    target:
      entity_id: "scene.{{ scenes.get(states(selection), 'living_room_off') }}"
  - service: input_select.select_next
    target:
      entity_id: '{{ selection}}'
mode: single