There is but since it’s out of the scope of this blueprint, I’ll message you some links directly instead.
Hey @CurryBay,
I’ve come up with a solution that should not break anything and don’t require any additional input from your end. These are experimental right now so it’s understandable if you’d prefer to avoid it.
Experimental: Version 2.0 Beta 1
Github Link | Compare Changes | How to update
See historical changelogs here.
Multi-device Variant:
Github Link | Compare Changes | How to update
What’s Fixed
Existing scripts should not be affected this release. 🫳🏻🪵
-
iOS Notifications with Camera Snapshots showing
Failed to load attachment
.
Many thanks to @CurryBay for bringing this to my attention.
Things to check after updating:
- As usual, existing scripts should be loaded.
- If you have switched between either variants, check out this reply.
- Script should show
Version 2.0 Beta 1
orVersion 2.0 Beta 1 - Multi-device
.
Hey @samuelthng,
Thanks for the quick reply! I’ve tested the experimental version and it works, there isnt any Failed to load attachment
message now!
Thanks for the quick and excellent work, well done!
@samuelthng Thanks so much for putting this together. This is insanely useful for making my notifications easier to manage!
I might have missed it, but I’m looking for a way to pass variables/arguments from my automation into the script.
For example, I’d like to set up a single script for garage door notifications, with my message
being something like '{{garage_door_name}} is now {{garage_door_state}}.'
, of which I can pass both of these in from the automation, so I don’t need to author multiple separate scripts for each state change.
Is this possible and am I just overlooking something that has already been documented? Thanks!
Hey there @andyrak, thank you for trying out the script. It is not possible right now but it’s also something I’m looking at.
Who knows, your question might just motivate me to add it in faster.
P.s. 2023.11 also blessed us with this.
Delivery! @andyrak
Again this is experimental - I’m still testing out quirks of fields, totally understandable if you want to give it some time to become stable.
Experimental: Version 2.0 Beta 2
Github Link | Compare Changes | How to update
See historical changelogs here.
Multi-device Variant:
Github Link | Compare Changes | How to update
What’s Changed
Existing scripts should not be affected this release. 🫳🏻:wood:
- Android: Added
Show on Android Auto
option. -
Enable Timeout Action(s)
option to dynamically disable timeout actions - Fields Support Added! (requires Home Assistant 2023.11 or newer)
Things to check after updating:
- As usual, existing scripts should be loaded.
- If you have switched between either variants, check out this reply.
- Script should show one of:
Version 2.0 Beta 2
Version 2.0 Beta 2 - Multi-device
.
Preview:
Show/Hide: Script Fields with Templates
Example payload:
service: script.my_test_notifications
data:
field_title: >-
{{ state_attr("sun.sun", "friendly_name") }}
field_message: >-
{% if is_state("sun.sun", "above_horizon") -%}
The sun rose {{ relative_time(states.sun.sun.last_changed) }} ago.
{%- else -%}
The sun will rise at {{ as_timestamp(state_attr("sun.sun", "next_rising")) | timestamp_local }}.
{%- endif %}
Result:
Version 2 Beta 2 - 2 Nov 2023
- Deprecated:
📲 Notification Strategy
due to refactor. - Deprecated:
📲 Service to notify
due to refactor. - Added: Support for fields
- Added:
🏷️ Title
field - Added:
💬 Message
field - Added:
🏷️ Subtitle
field - Added:
📸 Attachment: Camera Entity: Camera Entity
field - Added: Options show/hide fields
- Added:
⌛️ Enable Timeout
and⌛️ Enable Timeout Action(s)
fields.
- Added:
- Added:
🚘 Show on Android Auto
option. - Added:
⌛️ Enable Timeout Action(s)
option and field.
Notes:
- When enabling boolean fields with value of false, be sure to toggle them to true once, and then to false.
There seems to be a bug where the boolean value is not passed if it’s enabled and value is false without the toggle.- If you rely on
📲 Service to notify
, do not upgrade,Version 1.6.1
will be the last version supporting that feature.
Thank you, installed version:
Home Assistant 2023.6.1
Frontend 20230608.0 - latest
Hey @trobnc, I’m certain it is due to the version now.
If you cannot update, you may try Version 1.4 or earlier.
Ask and ye shall receive, eh?
Cheers for the update! This is exactly what I was looking for!
Works like a charm.
The automation visual editor doesn’t support templates, so it’s not as “prettty”, but that’s no fault of yours.
For anyone else that comes in here and wants their message to be dynamic per automation trigger entity and state, here’s my snippet:
{{trigger.to_state.attributes.friendly_name}} is now {{trigger.to_state.state}}.
Thank you, this certainly was the issue!
Welcome, happy to help! Hope you managed to resolve it!
Hi All,
I have created a Notify Group like this:
notify:
- name: ALL_DEVICES
platform: group
services:
- service: mobile_app_marcolinos21
- service: mobile_app_s21anto
but when I select Device to Notify I have not the group I created:
Is there a way to send same notification to more than one device?
Thanks
Hey @marcolino7,
Multi-device is not officially supported at this point as it will interfere with the experience of the timeout feature for each device at this time.
However, you can find a “Multi-device” variant of the script (not groups, select each device individually).
You can find my experimental variants of the script here.
Hi Thanks for quick reply.
I also did a test. I edited the code of your official Blueprint (no beta), changind notify.mobile_app_{id}
to notify.{id}
and passing to service the notify.all_device
, and seems it work. It could be better way instead to notify every single devices?
Marco
Hi @samuelthng ,
better way, I created my group like this:
notify:
- name: mobile_app_alldevices
platform: group
services:
- service: mobile_app_marcolinos21
- service: mobile_app_s21anto
in this way I can use your standard blueprint and notify to a device group using services.
Marco
Yeah I’ve also tested that in one of my beta versions. The same solution was suggested by Joseph pretty early on.
The main reason why I’m not implementing it is because if one device responds to a timeout, the other devices would not be notified of the change and the notification becomes stale.
That then becomes an issue on android if users pick the persistent notification option, which causes the notifications to stay there indefinitely.
Also, that wouldn’t allow me to restrict the specific type of notification service used by users (which can be problematic for non-technical users).
I’m still looking into the best way forward nonetheless, appreciate the suggestion very very much!
Edit:
Found the solution. The Color option only works if it is not in a category which is silenced on the android phone.
Using another categorie fixed the problem. Just for your information if you run in similar problems
I really like your script. I just updated to the version 1.6.1 after running 1.1 before.
I have a problem with the icon color on my android device.
I have one script which works with the colors and another one which doesn’t. But I dont find the solution:
alias: Verbrauchs Notify
use_blueprint:
path: samuelthng/notifications.yaml
input:
notify_device: 52859422b0df7431586319b2259f2758b
title: Verbrauch für heute
message: >-
🔌: {{ (( states('sensor.verbrauch_daily_kwh') )) }} kWh \n\n ☀️: {{ ((
states('sensor.solar_daily_kwh') )) }} kWh \n\n 🔥: {{
((states('sensor.gas_daily') )) }} qm
enable_icon_color: true
icon_color:
- 102
- 240
- 125
confirm_enabled: false
dismiss_enabled: false
For any hints a will be thankful.
Hey Sebastian,
Thank you very much for the kind words and also for posting the solution.
I’m currently working on some setup migration on my end so I won’t be able to test this case out for a couple of days.
I’ll test it out on my device as well once my setup is ready, and hopefully fix it. Otherwise, I’ll get it addressed/raised if it’s a bug with the Notifications implementation from either the blueprint or with the HA Companion app.
Hey Samuel I just run into another issue. I am testing the “new” version with the image from the camera.
I trigger your script if my camera detects a person I send a snapshot. Some snapshots looking fine but others have an old image als content. So if I get an image and 1 minute after that I get the same image.
If I can debug anything just let me know.
Again thank you for your great work.
Got it. Sounds like a caching issue to me from first impressions, will check it out as well but can’t promise much - I don’t have any cameras, will test with fake camera entities.