Thank you for sharing your changes! Have added a link to your comment under the forks subheader, and will review the changes to be added in future versions!
P.S. may take awhile, got a bad case of COVID , will do testing and changes after Iām back.
Sounds good! Iām certainly no power user, so Iām sure it could be done better.
Another frustration I have that I donāt see a way to fix is the timeout function.
If you donāt clear the notification on timeout, the action buttons no longer work. But a timeout is required, so you either have to set a very long timeout (for example 24 hours) and donāt clear the notification, or you have to use a timeout action.
I think the answer for me is going to be create a blueprint without the timeout functionality for when I donāt need it, but I was curious of your thoughts.
Edit: For now Iāve created another blueprint without any timeout functions. Iām sure thereās a way to set a variable to either use or not use the timeout function if itās set, but I donāt have the know-how to do that!
Thatās a good point that I did not face in my use case.
Iāll have to do some digging into the docs to see if we can use some data payloads when triggering the script.
Itās a great suggestion and valid use case, Iāll add that to the list of things to think about!
Maybe just to help me understand better, could you go into a little more detail for your use case? The ideal flow youāre expecting the script to be capable of, and the context would be helpful!
I have this triggered from my garage door opening. I have it set to persistent, with the actions being Close Door and Dismiss.
I donāt want the notification to timeout, and thereās no action I want to perform after a timeout.
So I left timeout action blank and timeout time set to the default, 0.
The problem is the actions didnāt work, as it would see that as timing out immediately and the ātriggered byā would run with the timeout action (none)
So my other action buttons didnāt work, as the timeout action already āranā and the script was no longer listening for the other actions.
@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.
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!
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)
iOS notifications do not respect Clear on Timeout since 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.
You may clear the tag field if you have added one previously
It is no longer required unless using the script for complex cases.
Known Issues:
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: