Make notification critical or not based on yaml (an input boolean)?

I have notifications that I may want to be critical based on whether, for example, I am home or not. I can do this by copying the notification service call twice into an IF/THEN, with different data/push/sound info, but it would be nice to not have to do this - is this possible? I would think that this yaml should work but it does not

service: notify.mobile_app_
data:
  title: Garage activity TEST
  message: TEST message
  data:
    tag: garage-notifications-test ##tagging doesnt work when critical is sent - thats ok and not the issue 
    push:
      sound:
        name: "default"
         volume: 1.0
         critical: {{ 0 if is_state('input_boolean.critical_notifier', 'off') else 1 }}

You don’t have quotes around your template.

         critical: "{{ 0 if is_state('input_boolean.critical_notifier', 'off') else 1 }}"

So it should be like this? that seems odd and when testing in dev tools/services gives this error

Failed to call service notify.mobile_app_iphone. extra keys not allowed @ data[‘sequence’][0][‘push’]. Got {‘sound’: {‘name’: ‘default’, ‘volume’: 1, ‘critical’: “{{ 0 if is_state(‘input_boolean.critical_notifier’, ‘off’) else 1 }}”}}

That error is telling you that volume and critical should not be indented under name, they should all be at the same depth.