Group based on input_boolean status

Hi guys -

I’m at my wits end here and would really appreciate if someone could help me on the YAML for this.

I have a notify group set up in home assistant that would send notification to all the devices listed under the group. I also have individual input_boolean helpers for users that they can toggle if they ever want to be left out of the notification group.

I need the notify group to automatically include and exclude them based on their individual input_boolean status.

I’m not sure how to write the YAML for that. Here is what I have so far. I know it’s not much. Please help!

Notification group:

notify:
  - platform: group
    name: olympus_residents
    description: All mortal residents of Olympus residence
    services:
      - service: mobile_app_pixel_4a
      - service: mobile_app_tinkerpop_iphone
      - service: mobile_app_jays_iphone

input_boolean flag:

jay_mobile_notification:
  name: Jay - App Notification
  icon: mdi:bell-ring
tinkerpop_mobile_notification:
  name: tinkerpop - App Notification
  icon: mdi:bell-ring

Try it without the description line.

I’m sorry. I’m not sure I follow your suggestion. I’m not sure how to make the notify group include and exclude devices based on their input_boolean status.

You can’t modify the notify group on the fly. Check out Jeff Stone’s configuration to see an example of one way to accomplish what you are trying to do using multiple notify groups.

Another option would be to not use the notify group, but instead pass the data on to a script with a choose action for each device… something like:

alias: Notify - Self Selected
description: Notify everyone who has their boolean on
sequence:
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.your_boolean
            state: on
        sequence:
          - service: notify.mobile_app_pixel_4a
            data:
              title: '{{ title }}'
              message: '{{ message }}'
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.tinkerpop_mobile_notification
            state: on
        sequence:
          - service: notify.mobile_app_tinkerpop_iphone
            data:
              title: '{{ title }}'
              message: '{{ message }}'
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.jay_mobile_notification
            state: on
        sequence:
          - service: notify.mobile_app_jays_iphone
            data:
              title: '{{ title }}'
              message: '{{ message }}'

That’s exactly what I did right before you commented. I was also referring to Jeff’s config from Slacker Labs. Kudos to him :slight_smile:
Thanks a ton for pointing me in the right direction! :+1: