awesome-ha-blueprints icon indicating copy to clipboard operation
awesome-ha-blueprints copied to clipboard

Bug - Send Web UI persistent notifications to Mobile Devices doesn't work

Open ElVit opened this issue 2 years ago • 14 comments

Blueprint name

Send Web UI persistent notifications to Mobile Devices

Home Assistant Core Version

2022.3.5

Home Assistant Installation Type

Home Assistant Operating System

Description

Blueprint doesn't work with the iOS Home Assistant App. The persistent notifications are not forwarded to my iPhone. But I can send a notification to my iPhone by sending notify.mobile_app_myiphone.

Automation YAML config

id: '1643998917699'
alias: Update notification to all iPhones
description: ''
use_blueprint:
  path: EPMatt/persistent_notification_to_mobile.yaml
  input:
    mobile_notify_service: notify.mobile_app_myiphone
    notification_id: '1234'

To Reproduce

  1. Create automation with this blueprint. Define only mobile_notify_service and notification_id = 1234
  2. persistent_notification.create (with messgae, title & notification_id = 1234)
  3. -> no notify message on my iPhone
  4. notify.mobile_app_myiphone (with message & title)
  5. -> I can see a notification message on my iPhone

Expected behavior

All persistent notifications with the ID="1234" shall be forwarded to my iPhone.

Actual Behaviour

I don't get any notifications to my iPhone. I get the follwing error in trace step details: Error: Error rendering data template: UndefinedError: 'dict object' has no attribute 'event'

Additional Details

  • [ ] I'd like to help developing a fix for this issue.

Screenshots

No response

Additional context

No response

ElVit avatar Mar 21 '22 11:03 ElVit

Hi @ElVit,

thank you for reaching out here, I'm sorry for my huge delay. It seems the event is not properly recognized after the automation has been triggered. Could you please share screenshots from the HA trace tool regarding the automation you're setting up with this blueprint?

Thank you for your patience!

EPMatt avatar Apr 11 '22 22:04 EPMatt

Hello,

I have the exact same error message, and my notification ID is set to http-login, see the details below:

Screenshot_20220708-154248

Blueprint name

Send Web UI persistent notifications to Mobile Devices

Home Assistant Core Version

2022.3.9

Home Assistant Installation Type

Home Assistant Core

Description

Blueprint doesn't work with the Android Home Assistant App. The persistent notifications are not forwarded to my Android. But I can send a notification to my Android by sending notify.mobile_app_pixel_5.

Automation YAML config

id: '1631811045862'
alias: Invalid login attempts notifications to Mobile Devices
description: ''
use_blueprint:
  path: EPMatt/persistent_notification_to_mobile.yaml
  input:
    mobile_notify_service: notify.mobile_app_pixel_5
    notification_id: http-login

To Reproduce

  1. Invalid login attempts
  2. persistent_notification.create
  3. -> no notify message on my Android
  4. notify.mobile_app_pixel_5 (with message & title)-> I can see a notification message on my Android

Expected behavior

All persistent notifications with the ID="http-login" shall be forwarded to my Android.

Actual Behaviour

I don't get any notifications to my Android. I get the follwing error in trace step details: Error: Error rendering data template: UndefinedError: 'dict object' has no attribute 'event'

Additional Details

  • [ ] I'd like to help developing a fix for this issue.

Screenshots

No response

Additional context

No response

Xx-Ness-xX avatar Jul 08 '22 21:07 Xx-Ness-xX

Hi

any update on this? Thanks

Xx-Ness-xX avatar Aug 11 '22 18:08 Xx-Ness-xX

Hello i have the same mistake. Core 2023.12.3 Supervisor 2023.11.6 Operating System 11.2 Frontend 20231208.2

Fruitsmart avatar Dec 19 '23 07:12 Fruitsmart

I've noticed the same issue in my setup 😞

niemtec avatar Dec 29 '23 15:12 niemtec

I was able to create a dummy automation with the following action and it worked:

service: notify.mobile_app_xxx
data:
  message: "{{ trigger.notification.message }}"
  title: "{{ trigger.notification.title }}"

niemtec avatar Dec 29 '23 16:12 niemtec

I was able to create a dummy automation with the following action and it worked:

service: notify.mobile_app_xxx
data:
  message: "{{ trigger.notification.message }}"
  title: "{{ trigger.notification.title }}"

Hi, could you please elaborate how you get this to work?

Xx-Ness-xX avatar Dec 31 '23 00:12 Xx-Ness-xX

Error rendering data template: UndefinedError: 'trigger' is undefined

grafik

Fruitsmart avatar Dec 31 '23 12:12 Fruitsmart

Hi, could you please elaborate how you get this to work?

Sure, I created a new automation that is triggered on "When persistent notification is updated" and set the above as a call service action.

So the automation looks like so:


alias: Notification Forward
description: ""
trigger:
  - platform: persistent_notification
    update_type:
      - added
      - updated
      - current
    notification_id: ""
condition: []
action:
  - service: notify.mobile_app_jakubs_iphone_15
    data:
      message: "{{ trigger.notification.message }}"
      title: "{{ trigger.notification.title }}"
mode: single

niemtec avatar Jan 02 '24 21:01 niemtec

@Fruitsmart it won't work in developer tools this way because trigger only exists in automation space.

niemtec avatar Jan 02 '24 21:01 niemtec

@niemtec Thank you very much, it's working perfectly. I thought I could test it in the developer tool. Thanks for that!

Fruitsmart avatar Jan 03 '24 10:01 Fruitsmart

@Fruitsmart glad it's working for you! Sorry, I could have been clearer with my initial comment... and maybe not type it out on a phone 😅

niemtec avatar Jan 03 '24 10:01 niemtec

@niemtec "Hi, does this automation still work for you? I'm getting the following error."

Error rendering data template: UndefinedError: 'dict object' has no attribute 'notification'

image

Fruitsmart avatar Apr 30 '24 07:04 Fruitsmart