Need a little help with logic on a notification script (routing notifications to specific devices)

Hello all,

Below is my current code. Can someone here help me with the default area based on the criteria below? Thank you all for your help.

I would like to have the default option ALWAYS send the message to the notify.family service but I would also like the default option to send the message to the “notify.tvs” service (I have created a notify group with my tvs in it called “notify.tvs”). BUT I would like the “notify.tvs” to ONLY send the message to the tvs if the helper called “input_boolean.text_notifications_tvs” is set to “on”.

text_notify:
  sequence:
    - condition: state
      entity_id: input_boolean.text_notifications
      state: 'on'
    - choose:
      - conditions:
        - condition: template
          value_template: '{{ who == "weston"}}'
        - condition: state
          entity_id: input_boolean.text_notifications_weston
          state: 'on'
        sequence:
        - service: notify.weston
          data:
            title: '{{ title }}'
            message: '{{ message }}'
      - conditions:
        - condition: template
          value_template: '{{ who == "clarice"}}'
        - condition: state
          entity_id: input_boolean.text_notifications_clarice
          state: 'on'
        sequence:
        - service: notify.clarice
          data:
            title: '{{ title }}'
            message: '{{ message }}'
      - conditions:
        - condition: template
          value_template: '{{ who == "parents"}}'
        - condition: state
          entity_id: input_boolean.text_notifications_parents
          state: 'on'
        - service: notify.parents_ios
          data:
            title: '{{ title }}'
            message: '{{ message }}'
      default: 
      - service: notify.family
        data:
          title: '{{ title }}'
          message: '{{ message }}'

Something like this maybe!

     default: 
      - service: notify.family
        data:
          title: '{{ title }}'
          message: '{{ message }}'
      - condition: state
        entity_id: input_boolean.text_notifications_tvs
        state: 'on'
      - service: notify.tvs
        data:
          message: '{{ message }}'
          title: '{{ title }}'
1 Like

Geeze, is it that simple? I apologize. I didn’t think it would be that straight forward. I will give this a go this evening and see if it works as we think. Thank you for your help!!