Automation to cycle through list of names and update input text

I am wanting to create a script or automation that when called, updates an input text entity with a name from a list. Each time the automation is called, I want it to update the input text with the next item on the list. The list will be 5 pre-defined names, however I also need to be able to temporarily remove names from the list using the front end. Big off/on buttons or tick boxes would be best.

My goal is to create a chore roster for my family of five. For five nights of the week we have a designated night to cook/clean. This has been easy to set up in HASS. But for two of the nights, we take it in turns. Previously I had written out this cycle on a calendar, but often a family member will be gone for a few weeks and the cycle is wrong. I need HASS to only cycle through the family members available.

I asked ChatGPT how to do this but its script contains functions that do not exist in HASS. Transcript

Is this a job for someone on Toptal, Fiverr or Upwork?

One way to do this would be to create a set of helpers; one Input boolean for each person and an Input select that has all the names from the booleans. This can be done in the UI or via yaml configuration.

input_boolean:
  person_a_chore_availability:
    name: Person A
  person_b_chore_availability:
    name: Person B
  person_c_chore_availability:
    name: Person C
  person_d_chore_availability:
    name: Person D
  person_e_chore_availability:
    name: Person E

input_select:
  chore_1:
    name: Who does chore 1 today
    options:
      - Person A
      - Person B
      - Person C
      - Person D
      - Person E

Then create a script to cycle through:

alias: Next Option Until Available
sequence:
  - repeat:
      until:
        - condition: template
          value_template: >-
            {% set available =
            expand('input_boolean.person_a_chore_availability',
            'input_boolean.person_b_chore_availability',
            'input_boolean.person_c_chore_availability',
            'input_boolean.person_d_chore_availability',
            'input_boolean.person_e_chore_availability') 
            | selectattr('state', 'eq', 'on') | map(attribute='name')
            | list %}
            {{ states('input_select.chore_1') in available}}
      sequence:
        - service: input_select.select_next
          data: {}
          target:
            entity_id: input_select.chore_1
mode: single

Here is a basic Entities card to demonstrate:

type: entities
entities:
  - entity: input_boolean.person_a_chore_availability
  - entity: input_boolean.person_b_chore_availability
  - entity: input_boolean.person_c_chore_availability
  - entity: input_boolean.person_d_chore_availability
  - entity: input_boolean.person_e_chore_availability
  - entity: input_select.chore_1
  - entity: script.next_option_until_available

Hi Drew, thank you so much. This worked perfectly.