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:
Iāve tried a number of suggestions but cannot get the notifications to be audible.
Until thatās sorted Iāve just put something in macrodroid to read notifications from home assistant and alert me with sound, TTS, and vibration
Hey @adoucette I seem to be able to reproduce the issue youāre describing on my S20 FE.
In the previous version of Android I recall being able to send urgent notifications, but it seems some of that functionality has changed.
Iāll take a look at this at my next availability, busy with the holiday season. If itās an issue with the app, Iāll try to come up with a minimal reproducible example for HA companion app.
Override camera entity: field_attachment_camera_entity
You may choose to override other fields if required.
If you wish to use templates for the field variables, check out the examples provided in the Preview section of this reply.
I would think if you are able to determine which camera entity triggered the automation, youād be able to map the camera entity dynamically either using templates or manually mapping using a choose block.
Example: Dynamic notification in automations using templates
Hereās a simple automation with two triggers (my homeās bypass helpers).
When the automation is triggered, the trigger variable will be set. You can find the details in the Traces ā Changed Variables page of your automation.
Using the trigger variable, you can create dynamic notifications like the following:
alias: My Test Automation
mode: single
# Two triggers.
trigger:
- platform: state
entity_id:
- input_boolean.bypass_disable_leave_home_automation
- platform: state
entity_id:
- input_boolean.living_room_disable_light_sensor
# Dynamic notification details based on automation trigger.
action:
- service: script.my_test_notifications
metadata: {}
data:
field_title: "{{ trigger.to_state.attributes.friendly_name }}"
field_message: >-
{{ trigger.from_state.state | title }} ā {{ trigger.to_state.state |
title }}
Hi, thanks so much for this awesome blueprint. Very well thought out and intuitive.
I am somewhat new to ios notificaitons with HA, and am running into some issues. I am attempting to send an alert to my phone when the home alarm is armed. This works fine. However, I also want to add an option to disarm the alarm, so I have toggled on Option 1, and added an action to disarm the alarm device. However, I donāt see any option when I receive the notification on my phone. I just get the message that the alarm is armed. When I click on the notification it just opens home assistant.
I feel like I am missing something basic here. Appreciate any tips anyone can provide.
Hey @statecowboy, thanks for trying out the script and for your kind words.
Firstly, on iOS, try to press and hold the notification and see if the option is there. No idea why Apple hides the notification options, but thatās how it is.
If it is not, would you mind sharing your notification script and the automation script? You can send it to me in a private message instead if thatās more appropriate for you.
Wow, thanks for the quick reply. So, sure enough holding on the alert brings up the options. Everything appears to be working as intended. I guess I was expecting the options to show up underneath of the alert. Now I know.
Hey @hazio, the script allows you to configure the notifications youāll see on your phone.
After youāve setup the script, you can use the script in any automation of your choice. You can think of it as a building block to help configure notifications for other automations.
A quick example for an automation that will call this script if a light was left on would be as so:
Example
description: "Triggers a notification script if light left on for 30 minutes"
mode: single
trigger:
- platform: state
entity_id:
- light.my_light_here # The entity_id of your light.
to: "on"
for:
hours: 0
minutes: 30 # Configure your duration here
seconds: 0
condition: []
action:
# Trigger a notification script created using this blueprint.
- service: script.light_left_on_reminder_here
metadata: {}
data: {}