Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Dynamic notification group based on zone #149

Open
lenwar opened this issue Jun 13, 2023 · 6 comments
Open

Feature request: Dynamic notification group based on zone #149

lenwar opened this issue Jun 13, 2023 · 6 comments

Comments

@lenwar
Copy link

lenwar commented Jun 13, 2023

It would be nice if we could have a dynamic (notification) group of all devices in a specific zone.

The purpose for this would be to be able to send a message to every device in zone XYZ. ("Washing machine is done", is only useful to people who are at home)

@gcobb321
Copy link
Owner

This can probably be done using automations and scripts with triggers and conditions and does not really apply to iCloud3. You can use the iCloud3 sensor.[devicename]_zone_name sensor to identify the zone someone is in.

@JtwoA
Copy link

JtwoA commented Jun 13, 2023 via email

@lenwar
Copy link
Author

lenwar commented Jun 13, 2023

Thank you both for your quick replies.

That is how I currently have it. But the only way I can get that working is by 'manually' going through each device, check whether or not it is 'Home' and send the notify-command. This of course works fine in practice, but I was looking for something cleaner.

A dynamic notification group would be much cleaner and easier to maintain.

I understand that you consider this (more or less) 'out of scope' for this integration, but I figured I'd ask anyway :)

@gcobb321
Copy link
Owner

Maybe there is some python script on JACS that will f do what you are looking for.

@woopstar
Copy link

You can create dynamic groups with automations:

automation:
  - alias: Create home group
    trigger:
      platform: homeassistant
      event: start
    action:
        service: group.set
        data_template:
          object_id: devices_at_zone_home
          entities: >-
            {%-
              for state in states.sensor
              if state.entity_id.endswith("zone_fname") and state.attributes.zone == 'home'
            %}
            {{ state.entity_id}}
            {%- endfor %}

@woopstar
Copy link

woopstar commented Oct 18, 2023

You can also loop through the device trackers or whatever you want. And change the triggers to when you want to update the group:

automation:
  - alias: Create home group
    trigger:
      platform: homeassistant
      event: start
    action:
        service: group.set
        data_template:
          object_id: devices_at_zone_home
          entities: >-
            {%-
              for state in states.device_tracker
              if state.attributes.integration == "iCloud3" and state.attributes.zone == 'home'
            %}
            {{ state.entity_id }}
            {%- endfor %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants