Condition on script parameter

Hello all,

I have many automations and many scripts and in order to see if they all work, I nearly always notify myself. I get about 50 notifications per day (detected movement, no movement detected for 5 min, …). After a few months, I would like to filter notifications between two categories: debug and essential. Debug being the ones mentioned above and essential being notifications of use.

I have created two booleans: input_boolean.notify_debug and input_boolean.notify_essential, which I can turn off/on in the UI.

I have a script to simplify my notitications (notify_phone) which I can easily call from within my automations. There are a few parameters (title, message, sound) and I just added a new one (category).

Now for the script, I cannot seem to test the condition on the parameter ‘category’. I tried different things, but it does not work. Can anyone help me or point me in the right direction? It’s the condition part.

alias: "Stuur smartphone notificatie"
fields:
  title:
    example: "Home Assistant"
  message:
    example: "test message"
  sound:
    example: "something.wav"
  category:
    example: "essential or debug"
sequence:
- condition: or
  conditions:
  - condition: and
    conditions:
    - condition: template
      value_template: >
        "{{ category  == 'debug' }}"
    - condition: state
      entity_id: input_boolean.notify_debug
      state: "on"
  - condition: and
    conditions:
    - condition: template
      value_template: >
        "{{ category  == 'essential' }}"
    - condition: state
      entity_id: input_boolean.notify_essential
      state: "on"
- service: notify.mobile_app_iphone
  data_template:
    title: "{{ title }} -- {{ category }}"
    message: "{{ message }}"
    data:
      push:
        sound: "{% if sound != '' %}Bloom.caf{% else %}{{ sound }}{% endif %}" #>

I have also tried:
{{ category }} == ‘debug’
but also no success

value_template: "{{ category  == 'debug' }}"

If you use a multiline template with the > character, you don’t put the template in quotes, otherwise it would be interpreted as a string.

aha, still many things to learn. It fixed it and now I can live a debug-free notification life.
Thanks a lot! :slight_smile: