How to use script select selector in chose

I’m trying to create a notification script, with a select selector to decide what type of notification’s sent.
I can’t find how to use the select selector to decide what happens though.

I’ve searched and tried various ways, but just cant get the templates right. How should something like this be done please?

alias: Notification
fields:
  type:
    selector:
      select:
        options:
          - Normal
          - Debug
          - Alarm
          - Emergency
    default: Normal
    name: Type
    description: Type to send
sequence:
  - choose:
      - conditions:
          - condition: template
            value_template: type == Normal
        sequence:
          - action: switch.turn_off
            metadata: {}
            target:
              entity_id:
                - switch.camspare_camera_feed
            data: {}
      - conditions:
          - condition: template
            value_template: type == alarm
        sequence:
          - action: switch.turn_off
            metadata: {}
            target:
              entity_id: switch.camfish_camera_feed
            data: {}
mode: single
description: ""

(the switches are just placeholders)

Your Template Conditions don’t have any templates…

condition: template
value_template: "{{type == 'Normal'}}"
1 Like

Thanks.

I couldn’t, and still can’t, get them right.. just meant to convey what I was trying to do.

Hopefully what I’m doing wrong’s obvious?

alias: Normal notification
fields:
  type:
    selector:
      select:
        options:
          - Normal
          - Debug
          - Alarm
    default: Normal
    name: Type
    description: Type to send
sequence:
  - choose:
      - conditions:
          - condition: template
            value_template: "\"{{type == 'Debug'}}\""
            enabled: true
        sequence:
          - action: notify.mobile_app_pixel_8
            metadata: {}
            data:
              message: Debug
      - conditions:
          - condition: template
            value_template: "\"{{type == 'Alarm'}}\""
            enabled: true
        sequence:
          - action: notify.mobile_app_pixel_8
            metadata: {}
            data:
              message: Alarm
      - conditions:
          - condition: template
            value_template: "\"{{type == 'Normal'}}\""
            enabled: true
        sequence:
          - action: notify.mobile_app_pixel_8
            metadata: {}
            data:
              message: Normal
mode: single
icon: mdi:cellphone-information
description: ""


I'm running the scripts manually. The templates don't seem to fire at all

Edit:

Scratch that, if I set the cases of everything correctly it works a treat :man_facepalming: