Good eye! Yeah I missed that in the initial commit, should be fixed after V1.1
🔔 Notifications - Actionable Mobile Notifications Script, with optional Timeout Feature and Camera Snapshots [works with iOS/Android]
@samuelthng I have a few other ideas I’d like to see about implementing. Namely a clickAction so that if you tap on the notification it opens a URL/navigates to a specific spot in the app.
It’s a simple call under data, in the same spot as the icon and color. Unfortunately, it’s named clickAction for Android, and just url for iPhone… so there’s probably not a good way to implement this universally and easily.
clickAction: "lovelace/home" #Android
url: "lovelace/home" #iPhone
Another idea I had is in regards to timeouts.
I had a weird case today where the timeout occurred when my phone was without reception. It did not receive the clear_notification notification from the automation timing out, so the notification remained even though the script had already timed out.
It might be a bit cleaner to include the following in the notification itself if timeout is enabled. That way the app on the phone removes the notification instead of relying on home assistant to send a clear_notification to the device. This is also under data: in the notification setup and would only be set if clear_on_timeout and timeout_duration are both set.
timeout: 600 # How many seconds the notification should be received by the device
I’ve had a few different blueprints for notifications and this has quickly become my favorite by far!
Great suggestions yet again! Yeah we could probably work those in.
We might still need the current timeout just for the sake of triggering timeout action HA side, but using the same timeout variable.
I’ll give it some brain cell time
Exactly. I didn’t come up with a clean solution myself… I’m more of an ideas guy!
Eventually it could get so complicated you might as well just copy and paste all the code anyway!
- Fixed: Incorrect property used for timeout enablement.
- Added: Icon Color picker - Breaking Change
- Added: Notification Link - set a redirection link when you tap on the notification.
- Added: Device side notification clearing - clearing notifications will no longer get stuck!
Again, thanks to joe.cole1 for the insights in this minor release.
Also, thanks to RemyyB for identifying the incorrect variable and raising a PR.
Sorry to everyone for taking a week to fix this. 🙇🏻♂️
( Color picker is easy enough to configure, so it shouldn’t be absolutely breaking to warrant a major)
Clear Notificationis correctly set/unset
Enable Icon Colorare correctly set/unset
- All scripts using this blueprint are loaded in the scripts list
- If they are missing, don’t worry, do drop a message here with me tagged and we’ll get it fixed.
This script would notify the user that a new update is available, with an option to call the update service, or the skip update service.
Upon clicking the notification - not the action buttons - it will navigate the user to the Home Assistant updates page.
If nothing has been selected for 30 minutes, the notification will be cleared automatically without taking any actions.
alias: "\U0001F514 Home Assistant Core Update Notification"
title: My Awesome Home
message: New update available!
confirm_text: Update Now
- service: update.install
- service: update.skip
This is an Android only fix, iOS users may ignore this patch.
Enable Icon Color- No longer overrides icon colour if disabled.
Icon Colorhex template - Remove unrequired code, minor change.
Apologies for the frequent update - similar bug to last time, incorrect flag for
Enable Icon Color.
- Scripts with
Enable Icon Colordisabled, should not override icon colour on Android phones.
- As per usual, existing scripts should be loaded.
Fine to ignore if you don’t need icons for iOS, and won’t be creating new scripts anytime soon.
iOS Only- Thanks @ChrisMancini
- Fixed: Missing default values for a couple of inputs
- Updated: Input description style
- As per usual, existing scripts should be loaded
- Script should show
- iOS notifications do not respect
Clear on Timeoutsince Version 1.3
Version 1.4 beta testing is underway, to ensure I’ve covered enough use cases before releasing - estimate mid of July.
For your issues with iOS clear on timeout… I don’t have apple devices so I can’t test, but with my modifications to use notify. groups instead of individual devices, I needed to add back in your old style of clearing notifications so that when one device chose an action or dismissed it would do so on all devices. So my modified blueprint has both the “built into the notification” dismiss function as well as your older timer based clear notification.
Works great! That might be a good solution to cover all bases.
Yup thank you for the suggestion, that’s also exactly what I did! Just wanted to test ithe changes extensively before the next release.
There’s also be some additional features coming up!
Fine to ignore if you don’t use iOS, new additions are optional.
- iOS/macOS: Notifications will now clear after timeout
Lockscreen Visibilityoptions, details in blueprint label.
🏷️ Tagis no longer required for some features to work.
- During a timeout event, the script throws error into logs even when working properly, this is now fixed.
- As per usual, existing scripts should be loaded.
- Script should show
- You may clear the
tagfield if you have added one previously
It is no longer required unless using the script for complex cases.
There is at least one case where a user is unable to receive notifications on their iOS device
The issue is not reproducible on my end, but is probably due to an optional feature.
If this is happening to you, you may try to use an older version of the blueprint.
Known working version: Version 1.0
good job to both.
What should I change to use another service, i.e. pushover, if already integrated in HA?
This is an example I use for Internet disconnection:
Sorry for the italian language but it’s pretty clear.
I’m assuming you’re trying to call another action besides sending the notification alert?
If so, you have a couple of options:
You may simply add another action just like in this example below:
This applies to all action fields.
You may store all the actions you want into a separate script, then call the single script you’ve created to trigger all actions. The best part about this is it allows you to house more complex logic into that script and to compartmentalise functionality on your setup.
In “Device to notify” it doesn’t tell me any devices. Which one should I put?
My notification service is called notify.mobile_app_nanu
Hello @KameDomotics, thanks for taking time to try the script out.
The script only supports devices that has the official Home Assistant Companion app installed.
The domain expected would be
Could you check that you have your Mobile App integration in your Devices page?
Hi, yes I use the Companion App and I have the integration. I use it for push notifications and everything works. But with this script it doesn’t work, the notification service is not detected…
It’s not intended to use the notification service domain. Might be a difference in version as I’ve tried to reproduce, I’m still able to see devices with mobile apps on the latest versions.
I’ll take a look at using notification service as an option in the next revision.
Ok thanks, then I’ll wait for your news
Good work! Thanks!
Do you plan to include sending images (snapshots from cameras)?
Hey @Yannik, thank you for trying out the script, glad it worked out well for you.
I don’t yet intend to send snapshots yet as I don’t have any cameras at home to try.
Just curious - when you say snapshots from cameras, are the snapshots from images saved on the home assistant server or direct feed from a camera domain device?