Blockly on OH 4.3 release
I just started my Blockly adventure. While testing relevant blocks to replace my Rules DSL step by step, I couldn’t get most of the new notifications block features (e.g. Icon, Tag) working as it was described in the blog .
(“sendNotification” is working with Rules DSL)
Clients:
iPhone 13 mini
iPad 7th Gen
The following script:
… resulted in the following notification:
Are the new “extensions” not working on iOS clients?
Is there any other config needed to get this working?
First of all I have to apologize that the blocks aren’t documented yet. I only noticed a few days ago that I forgot ( I was kind of sure I had done it …).
Regarding iOS I actually tested the Blocks on iOS as well. Can you explain what the problem is? Is it every notification not working or only the custom headers? I don’t understand what issue is you are trying to show with the notification screenshot.
hmerk
(Hans-Jörg Merk)
January 1, 2025, 10:28am
3
What version of openHAB iOS App?
If it is still V1, those new notification options are not showing up.
iPhone 13 mini: iOS 18.1.1
iPad 7th Gen: iOS 18.1.1
It is V2 I’m using.
Notification setting in iOS for openHAB App:
Not sure, but is there any config that can possible be changed in openHAB cloud to make this work?
stefan.hoehn:
First of all I have to apologize that the blocks aren’t documented yet.
We are so grateful that you and all other maintainers are providing such a great openHAB environment.
No need at all to apologize for anything
stefan.hoehn:
I don’t understand what issue is you are trying to show with the notification screenshot.
As per config, I’d expect the notification would show Icon, Tag, Media URL and On-Click Action.
However, only Header Title and Message are shown.
2 Likes
Marcus, I found where I “documented” the blocks - even though it is still not in the official docs, this might help you and others in the meantime:
openhab:main
← stefan-hoehn:blockly_notification_update
opened 10:16AM - 15 Jul 24 UTC
This is probably the most comprehensive block I have provided so far which suppo… rts the awesome cloud notification functionality that was provided recently. Kudos to all who have provided the cloud notifications and added them to the apps! ❤️
Thanks for the support during this implementation to Florian, Dan, Danny, Matthias (and the rest of the openHAB foundation gang who provided feedback and nice ideas to make it even better).
I tested all of the above use cases and I hope I covered most of it.
Note that the new blocks can completely replace the old ones (though they will not be automatically converted but it must be done manually). I will document this eventually in the blockly docs.
The new notification blocks:
<img width="553" alt="image" src="https://github.com/user-attachments/assets/969a5bec-fe9a-49d4-a3f8-ee11cae58cbe">
The block can be highly customized by showing or hiding the required inputs:
<img width="942" alt="image" src="https://github.com/user-attachments/assets/d3e6f4e5-7217-4804-b76a-d70507dae9b4">
Without user ids, it will result into a broadcast. Individual users can be address with a comma separated list:
<img width="691" alt="image" src="https://github.com/user-attachments/assets/f9a01eb1-ef6f-4fd8-970e-a46b42a357e8">
You can provide actions (directly or further down below via up to three clickable buttons in the notification)
<img width="592" alt="image" src="https://github.com/user-attachments/assets/e8b10b3a-a7f2-4e6c-aa02-d9f012325229">
Two different types of actions are available to attach to direct action or a button action
Action:
<img width="57" alt="image" src="https://github.com/user-attachments/assets/47000425-bd19-4067-b367-983ec85815da">
Button 1/2/3 Action
<img width="180" alt="image" src="https://github.com/user-attachments/assets/0d6b2010-e6a4-4130-a970-b1a9d97efffd">
Action Blocks
<img width="307" alt="image" src="https://github.com/user-attachments/assets/02d60e83-3a64-4557-9d28-92eaa9584b66">
Actions can be provided via blocks are generically via Strings:
<img width="886" alt="image" src="https://github.com/user-attachments/assets/0f604a54-6b58-4a4d-80e5-777daeb48b87">
**Many more examples:**
<img width="550" alt="image" src="https://github.com/user-attachments/assets/12e7cd90-3610-4f4e-9285-15259134978c">
Based on
https://www.openhab.org/addons/integrations/openhabcloud/#cloud-notification-actions
https://www.openhab.org/addons/automation/jsscripting/#cloud-notification-actions
Here is an example in the Android app with included media:
<img width="420" alt="image" src="https://github.com/user-attachments/assets/943fb412-1efe-4ed8-b306-222236dac62b">
maxmaximax:
As per config, I’d expect the notification would show Icon, Tag, Media URL and On-Click Action.
However, only Header Title and Message are shown.
Icon is only supported by Android, tag is not shown on iOS (not sure how exactly tag is used on Android) but can still be used to hide notifications.
Media URL and On-Click Action should work however.
Can you please share the full media URL?
Thank you!
When you do the official docs, it would be very helpful to have a table showing compatibility of each functionality with iOS vs. Android.
This is no valid media URL. You need to link to the image file that should be shown, not to the webpage showing the image.
It is a URL to a .png file. What’s wrong with that?
Are Action Buttons supposed to work on iOS?
I can’t get that working either…
It is no URL to a PNG file, it’s a URL to a Wikipedia page showing that image:
You need the link to the actual image:
Success!
Media URL is working now!
Thanks a lot for explaination!
Block config as follows:
On-click Action and Action Buttons are working as well. It needs a “tap hold” on the notification to make all of it visible. Seems I missed that quite important piece of information
3 Likes