sendBroadcastNotification with OH4.2: no icon

I tried to testing the new 4.2 feature for Notification Display Enhancements as explained here:
https://www.openhab.org/addons/integrations/openhabcloud/#dsl

I am struggling with the icon - I tried all kind of icons and spellings - but I do not see an icon on my iPhone or AppleWatch when push messages comes in.
Was anyone able to get this working?

My test rule:

sendBroadcastNotification("Test", "motion", "Tag",
                          "Title", null, null, null,
                          "Text=command:Shelly1:ON", null, null)

based on 4.2. docu:
sendBroadcastNotification(message, icon, tag, title, referenceId, onClickAction, mediaAttachmentUrl, actionButton1, actionButton2, actionButton3)

No (motion) icon for me :roll_eyes:
What I am doing wrong?
regards, Kai


my environment:
openHAB4.2 (running in a container)
iOS openHAB App 3.0.3(7)
AppleWatch App Version 3.0.3.7

Did you download the latest ios app as per the announcement blog? I don’t know what the version numbers are… I’m not an ios user :slight_smile:

yes, I did: AppleWatch App Version 3.0.3.7

@digitaldan ?

1 Like

So, i don’t think icon ever was supported on IOS, but this field has been in the sendBroadcastNotification call since the beginning, i’m not sure if it was just there for android or what.

It was there since the beginning as you mentioned - way before we started supporting it in the Android app :wink: Adding support for it in the iOS app shouldn’t be too hard though?

1 Like

On Android does this change the icon in the actual displayed notification on the OS or just when in the app? AFAIK , changing the notification icon is not normally possible on iOS (except for an exception for contact thumbnails for communication apps), we could display the icon in app if a notification comes in, but thats probably a small use case?

This is what one of my notifications looks like:


With rule from Blockly"

console.debug('Gate has Closed! ');
actions.NotificationAction.sendBroadcastNotification('Gate has Closed! ', 'presence', 'warn');

Icons from openHAB ā€œclassicā€ icons

EDIT: Only works with the latest Beta of App since upgrade to OH4.2.0

Both. Marks screenshot shows that both the app icon (left) as well as the specified icon (right) are shown, even though the exact presentation differs between devices. In the notification list either the specified icon is shown, or the app icon as default.

Yeah, so i can’t change the icon on the notification on iOS without requiring user interaction on the notification itself. The best we could do is create a custom UI for the notifications that shows the icon, but that would only be displayed on a long press, like how we show the media attachment and action buttons, there’s no way to change the icon on iOS in the general notifications view. I could also try and attach it as a media item i guess if one is not set, then at least it would show up on the right of the message as an image preview. I’ll play around with that maybe.

1 Like

Danny, as the latest PR for Android has been merged by now for Android :heavy_heart_exclamation:, when will it be available on the Play store? I am still on 3.14.

It it so great that all of you have implemented the new notifications… I wanted this for so long! It was my number one wish since ages!

As soon as I have the latest Android version I will start implementing the required changes for Blockly.

@mueller-ma already started rollout of version 3.15. It should already be available if you join the beta test.

I just joined the beta test. Now it is appearing :sunglasses:

And here is the PR: I love the possibilities!

2 Likes