Notifications to group

Hello,

I am doing my first notification to a group and I have some issues:

I configured in the configuration.yaml the group as follows:

notify:
  - name: all_mobile_devices
    platform: group
    services:
      - service: mobile_app_abc_iphone
      - service: mobile_app_sm_g970w

I have created a new automation that looks like and it’s saved in the automation.yaml:


- id: '1668627178xxx'
  alias: Water detected
  description: Water spell detected in the technical room ABC
  trigger:
  - type: moist
    platform: device
    device_id: da30dd20b2832ca13f3c6780eb7dbxxx
    entity_id: binary_sensor.shui_jin_tan_ce_qi
    domain: binary_sensor
  condition: []
  action:
  - service: notify.all_mobile_devices
  mode: single

When i try to run it it throws the following error:

Unable to find the service: notify.all_mobile_devices

What am I doing wrong ?

Thank you

Maybe this will help you:

thank you but i don’t think that is the issue. i can send notifications to the ios device is i enter it;s name directly. My issues is sending massages to the group.

I think it is because your notification has no message defined. So what text are you notifying?

Change:

  action:
  - service: notify.all_mobile_devices
  mode: single

To this code if you want to use a hardcoded text message (simple):

  action:
  - service: notify.all_mobile_devices
    data:
      message: Water spell detected in the technical room ABCl
      title: Water spill detected
  mode: single

Or to this code if you want to use a templated message (bit more advanced):

  action:
  - service: notify.all_mobile_devices
    data:
       message: {{ trigger.to_state.name }} has detected {{trigger.to_state}}
       title: {{trigger.to_state}} alert
  mode: single

For all available trigger variables to use in templated trigger notifications see:

https://www.home-assistant.io/docs/automation/templating/

Note: I am myself still fingering out how these trigger variables exactly work, so I cannot answer questions on that!

Extra info
I was struggling myself, perhaps my post with ask for help with solutions might help you on this topic:
https://community.home-assistant.io/t/automation-how-to-retreive-triggered-entity-and-zone-information-using-multiple-triggers-in-one-automation-dry-programming/488652/2

3 Likes