It’s supposed to be set by every camera entity and would come with a token specifically for external access.
You can try using Developer Tools States, select a camera entity in the set states section. It will show you all the attributes on the entity, and you should find entity picture there as a relative path to the image.
I’m looking to trigger notification after a certain time. How can I set this up?
Ex: If lights were left on for more than 30 minutes, I will get a notification.
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 %}
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.
Hi @samuelthng, I am trying your blueprint for the first time and it looks amazing! My congratulations for the great work.
I’m just having a small problem and that is that I would like to group several related notifications (group) and be able to replace them with new ones (tag) as reminders.
I have created a new script using your Blueprint and just set a message, disabled the action buttons (option 1 and option 2) and set the Group ID field to “tasks” and Tag to “dishwasher”. Then, I run the script and, when I check the traces, I see that neither the group nor the tag are being sent.
Firstly, welcome to the community, thank you for your kind words!
Secondly, it’s a bug on the blueprint - a miss on my end after the last refactor.
Thank you very much for bringing this to my attention, really appreciate it!
Here’s a fixed version that should resolve the missing tag and group data:
Hey @flrnwrzl, thank you for the kind words, makes the effort totally worth it!
The pictures from the camera entity are derived directly from it’s entity_picture attribute.
You can use this template to view the relative path to the image:
Wow thanks for the quick and detailed answer. I will try this weekend and give feedback. And maybe ask again if needed. But still amazed by this powerful script.
Maybe one thing as inspiration for a possible new feature in the fututre. The 1 thing I am missing is to add YAML code to message text. If this would work in the future…amazing.
As for yaml code, if you meant to use templates in the message, we can do that right now, but it is a little less pretty due to interface user interface limitations.
Check out the preview section in this changelog for some examples of using templates in the scripts.
Hello, so got it to work but as soon as I restart the token changes. is there a way to solve this? is there the possibility to save them somehow permanently?
Maybe save the snapshots to a www folder or so?
You can try the camera.snapshot service, this might be what you’re looking for. I have not used it myself, so won’t be able to advice much on it!
The service saves the image to a folder of your choosing if I’m not wrong. I don’t really like this method because if you’re accessing it externally it would be less secure than having the token attached.
Edit: @flrnwrzl oof sorry man, reply didn’t work somehow. So tagging you here instead.
Fore some reason when i try to send a notification with a snapshot of the camera attached using your script it takes too long to capture. So i never see whats happening.
I call the script in a automatiom when movement is detected via automation.
In different blueprint it works faster and very reliable. What can it be softwareside?
Yeah there can be differences based on how the integrations setup the entity’s image, or which source image is being used.
Do you have a link to the other blueprint? I could have a study to understand the mechanism used by the other blueprint, and if it’s more effective, could review having that as an optional alternative strategy.
Thank you for the really great blueprint!
How can I get notifications on android to be more noticeable? All I get is a notification banner, but I would like it to be able to make my phone ring/beep/etc for cases such as a home alarm or water leak sensor being triggered.
Here’s what I have so far:
alias: 🔔 Notifications (Version 2.0.1)
use_blueprint:
path: samuelthng/notifications.yaml
input:
notify_device: <my device id>
title: Home Alarm Triggered
message: Home Alarm Triggered
dismiss_enabled: false
run_timeout_actions: false
channel: alarm_stream
importance: high
visibility: public
icon: mdi:alarm-light-outline
You can try the following to set custom notification rules for specific notifications.
Firstly, you’ll have to set a group to the notification.
Next, run the script so that your phone registers the notification group you’ve created via the sent notification.
Finally, on your Android phone settings, configure the specific group (in notifications settings, under the Home Assistant Companion app) to have specific options. On my Samsung device, I’m able to set a custom ringtone and to make the notification a pop-up. YMMV.
I might also look into adding status bar icons in the next release so that you have a customisable visual indicator if the icon notification is missed.
P.S. Sadly we don’t have a Critical Notification equivalent option for Android. I’ll have to do some research.
Oh yeah I did study this blueprint before implementing the camera snapshot feature. I initially did not see the benefit of having to store a separate snapshot that has weaker security initially, when home assistant provided the entity picture basically free.
However, since it has its merits, I’ll take a look at the feasibility of adding this as an alternative strategy. No promises at this point!
P.S. sorry I still don’t have an actual camera to test in my home. So I’ll have to try it out, if it gets somewhere, will need to put it in beta for some time to get comments.
Thank you, I believe I had done that with the notification “channel”. In the alert script I had set the channel to “alarm_stream”, and then in the HA Companion app, I had configured the alerts for that channel as in the screenshot below: