L_B
(Laith Budairi)
July 2, 2024, 6:07am
1
I am trying to find a way to send a notification to my Openhab app on my IPhone/Android. Basically what I am trying to do is suppose I have a widget for live camera, and let’s say there was a trigger (doorbell ring), when that trigger occurs, I want my phone to open Openhab app to that specific widget automatically and/or play a sound/ring on my phone.
Is there any add-on that can help me achieve what I mentioned? If not, is there a way to configure this from the rules? I saw that there is a play sound action in the rules but, I am not sure how to connect that to my device.
hmerk
(Hans-Jörg Merk)
July 2, 2024, 6:15am
2
Our free service myopenHAB is your friend.
Just check the documentation found under
1 Like
Sorry , unfortunately I couldn’t figure out from the link , about opening a custom tab from habpanel/page from the notification. I am also having a similar requirement. I would like to send a notification which can open an url.
L_B
(Laith Budairi)
July 3, 2024, 8:40am
4
Thank you, I managed to configure it, but I only managed to send a notification to my phone. I couldn’t find a way to redirect that notification to a custom clickable widget
L_B
(Laith Budairi)
July 3, 2024, 8:41am
5
I only managed to send a notification so far
It seems basic html is respected in notification. You can even use iframe. It works on habot.
hmerk
(Hans-Jörg Merk)
July 3, 2024, 5:24pm
7
Additional functionality for notifications is work in progress. Unfortunately, those additions will not make it into the next release.
2 Likes
L_B
(Laith Budairi)
July 4, 2024, 6:48am
8
I see, but at the moment there isn’t a way to open OpenHAB app on mobile automatically when there is a trigger right? While I am not using my phone.
hmerk
(Hans-Jörg Merk)
July 4, 2024, 7:04am
9
No, there isn’t.
You can see what is planned in this issue
opened 03:58PM - 25 Jun 24 UTC
enhancement
# Mobile Notification Enhancements
Using this ticket to coordinate changes be… tween our various projects to support new notifications features. This includes:
* click action - Allowing the user to specify an 'action' to execute when a mobile notification is clicked
* button actions - Allowing the user to provide addition custom buttons (long press on notification) that execute an 'action' when clicked
* media attachments - Allowing the user to provide a URL to media that will be attached to the notification
## Message Payload Keys (Proposal)
* `title` - Title of the notification
* `on-click` - Click Action (see action format)
* `actions` - Button Actions
* * Format is `["title1" : "action", "title2" : "action",...]`
* * See Action Format for `action`
* `media-attachment-url` - URL of media (must be reachable by device)
## Action Format
An action can be either a `command`, `ui`, `http` or `https` action.
### Command Action
`command:itemName:commandString`
Example: `command:KitchenLights:ON`
### UI Action
`ui:$itemCommandSyntax`
where `$itemCommandSyntax` is the same syntax as defined at https://next.openhab.org/docs/mainui/about.html#ui-command-item
Example
* `ui:navigate:/page/my_custom_page`
* `ui:popup:$target` (where $target is "page: + a page ID", or "widget: + a widget ID", etc...)
* `ui:sheet:$target`
**OR**
`ui:$path`
where `$path` is either `/basicui/app?.....` for sitemaps (native sitemap renderer will be used) or `/some/absolute/path` for navigating the view. `$path` in either case starts with a `/`
Example
* `ui:/basicui/app?w=0000&sitemap=main` (use the WebUI to get sitemap URL locations)
* `ui:/page/page1` (will force the browser to go to this page)
### http | https action
`https://openhab.org`
This will open the link in a embedded browser, and is meant for loading external web pages.
## Sample Payload
This is what may be sent from the binding to openHAB Cloud
```json
{
"media-attachment-url": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/07/OpenHAB_logo_2.svg/541px-OpenHAB_logo_2.svg.png",
"message": "Test Notification",
"title": "openHAB",
"on-click": "ui:popup:widget:myKitchenWidget",
"actions": [
{
"title": "Turn Kitchen Lights ON",
"action": "command:KitchenLightst:ON"
},
{
"title": "Turn Kitchen Lights OFF",
"action": "command:KitchenLights:OFF"
},
{
"title": "View Kitchen",
"action": "ui:navigate:/page/Kitchen"
}
]
}
```
## Associated Tickets
Android: https://github.com/openhab/openhab-android/issues/3193 (original discussion here)
IOS: https://github.com/openhab/openhab-ios/pull/764
Cloud: https://github.com/openhab/openhab-cloud/pull/462
MainUI: https://github.com/openhab/openhab-webui/pull/2622
Cloud Addon: #16938
openhab-js: https://github.com/openhab/openhab-js/pull/351
Docs: #16941 and https://github.com/openhab/openhab-docs/pull/2320
## TODO
Checklist for implementation:
- [x] Binding
- [x] openHAB Cloud
- [ ] Android app
- [ ] iOS app
- [x] Main UI
- [x] Docs
Notify maintainers of other UIs:
@openhab/webui-maintainers
@openhab/android-maintainers
@openhab/ios-maintainers
Sample Screen Shot (IOS)

1 Like
krishgcek
(Krishgcek)
July 4, 2024, 8:06am
10
The chrome pwa app opens when the notification is received.
digitaldan
(Dan Cunningham)
July 5, 2024, 4:52am
11
Actually this functionality will make it in to 4.2 which is due out in the next few days, stay tuned!
4 Likes
L_B
(Laith Budairi)
July 9, 2024, 5:10am
12
Yes, I updated my OpenHAB to 4.2, but couldn’t manage to apply the action, no action button or action is executed when I click on notification:
Not sure if you read the release blog post , but if you had, there we mention that the clients are not ready for this new feature yet.
Both for iOS and Android App is already worked on implementing the required changes, but as of today, there is only backend support, not frontend support.
However was it super important to get the backend support into 4.2.0, so we can ship the updated apps later and before having 4.3.0.
1 Like
I think the openHAB app itself cannot do this due to security rules by the OS — on Android you can use Tasker, Llama or MacroDroid for automation tasks like this.
1 Like
digitaldan
(Dan Cunningham)
July 9, 2024, 4:01pm
15
There is a link in the blog post to the new iOS client (TestFlight) where all the mentioned features work.
2 Likes
system
(system)
Closed
August 20, 2024, 8:02am
16
This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.