HA Benachrichtigung per Push auf's Handy (notify.mobile_app_*)

Hi!

Mal eine dumme Frage: Kann man die “normalen” HA Benachrichtigungen als Push Notification auf das/ein Handy schicken? Ich meine diese Benachrichtigungen hier:

Diese Benachrichtigungen hätte ich gerne via notify.mobile_app_* als Push Notification auf dem Handy. Geht das? Wie mache ich das?

Schonmal danke für Eure Ideen! :slight_smile:

Beste Grüße und ein gutes neues Jahr

Thorsten

Du kannst
a) Es einfach dort wo die persistent notification baust direkt danach noch zusätzlich notify.mobile_app aufrufen oder ein blueprint bauen dafür
b) oder du baust eine Automation die als Trigger das event bekommt und schickst das weiter

  - trigger: persistent_notification
    update_type:
     - added
1 „Gefällt mir“

Cool! Vielen Dank! Ich glaube, so funktioniert es jetzt:

alias: Push notification
description: ""
triggers:
  - trigger: persistent_notification
    update_type:
      - added
    notification_id: ""
conditions: []
actions:
  - action: notify.mobile_app_iphone_15_pro
    metadata: {}
    data:
      message: "{{ trigger.notification.message }}"
      title: "{{ trigger.notification.title }}"
mode: single

Muss dann nur noch herausfinden, wie ich notify.mobile_app an alle hinbekomme… :thinking:

Hast du kein notify.all_devices?

Wenn ich das richtig verstehe, geht das nur über eine group, die definiert werden muss:

notify:
  - name: ALL_DEVICES
    platform: group
    services:
      - action: mobile_app_iphone_one
      - action: mobile_app_iphone_two
      - action: mobile_app_ipad_one
      - action: mobile_app_pixel_4_xl
  automation:
    - alias: "Notify Mobile app group"
      trigger:
        ...
      action:
        - action: notify.ALL_DEVICES
          data:
            message: "Something happened at home!"

Ja hast recht brauchst ne Gruppe

Ich teste gerade….

For the record.

So funktioniert es:

python_scripts/all_devices.py

mydata = data.copy()

notify_services = hass.services.services.get("notify", {})

for service_name in notify_services:
  if service_name.startswith("mobile_app_"):
      hass.services.call("notify", service_name, mydata, False)

alias: Push notification
description: ""
triggers:
  - trigger: persistent_notification
    update_type:
      - added
    notification_id: ""
conditions: []
actions:
  - action: python_script.all_devices
    metadata: {}
    data:
      message: "{{ trigger.notification.message }}"
      title: "{{ trigger.notification.title }}"
mode: single

Danke für die Hilfe!

2 „Gefällt mir“

Bin absoluter Anfänger und daher wohl auch andere Denkweise, da ich nicht wirklich viel Plan hab. Aber das geht doch mit mehreren Geräten doch deutlich einfacher, oder check ich da was nicht?

Beispiel mit zwei Geräten und funktioniert ebenfalls…

alias: "HA-Benachrichtigungen auf Handy pushen "
description: ""
triggers:
  - trigger: persistent_notification
    update_type:
      - added
    notification_id: ""
conditions: []
actions:
  - action: notify.mobile_app_handy_flamingo
    metadata: {}
    data:
      message: "{{ trigger.notification.message }}"
      title: "{{ trigger.notification.title }}"
  - action: notify.mobile_app_handy_lara
    metadata: {}
    data:
      message: "{{ trigger.notification.message }}"
      title: "{{ trigger.notification.title }}"
mode: single

Ja, klar, das geht schon. Musst dann aber wissen wie die Geräte heißen. Wildcards nach dem Motto notify.mobile_app_* gibt es eben nicht. Daher der Umweg über das Script…