Send selector to script

I want to create a browser_mod popup where I can select the program that my washing machine will run.

I have created this pop-up:

with this code:

tap_action:
  action: perform-action
  perform_action: browser_mod.popup
  target: {}
  data:
    content:
      - name: params
        label: Choose the laundry program to run
        selector:
          select:
            multiple: false
            options:
              - label: ECO (default)
                value: 11
              - label: Whites
                value: 13
              - label: Active Wear
                value: 12
    right_button: Submit
    right_button_action:
      service: ??

Now the value of each label should be sent to the script as a parameter, as the parameter defines the actual program to run and send it to the machine.

But how do I do this?

You don’t need browser mod for this, this is a core ability of a script entity.

  • Create a script with a field, use your defined selector for that field
  • Add the script as the entity to a button or tile
  • When you execute the script, you’ll get a popup asking you to choose a value for your selector, and run the script with that value.