-
Notifications
You must be signed in to change notification settings - Fork 28
possible to change persistent notifications to regular notifications? #12
Comments
Hi, Thanks for your sugestion, but this will not work if the user has not defined a
You are better off construction your ovn notify action like you have in your examples and disable the sensor:
- platform: authenticated
enable_notification: 'False' |
ok in understand, though users not having notify.notify must be an extreme minority ;-) still, if one has notify.notify, it is safe to make that adjustment?
second: if the notification is disabled, what would be the correct trigger for a notify action picking up the sensors activity? |
I would not recomend that, it wil break on updates.
This adds a sensor |
Then it will trigger on every IP.... automation:
trigger:
platform: template
value_template: "{{ is_state_attr('sensor.last_successful_authentication', 'new_ip', 'true') }}" |
that would be great, thank you! |
What about letting the user define another notify service, but by default it would use |
@tjorim That will get to messy. |
Hello. This doesn't work for me. The new_ip attribute never changes from false to true. |
hi,
thanks for the last update.
creating persistent notifications for each new authentication has certain ramifications on the system, i would like to prevent. Would like to change to regular notifications.
could the line
self.hass.components.persistent_notification.create('{}'.format(ip_address + ' (' + geo_country + ', ' + geo_region + ', ' + geo_city + ')'), 'New successful login from')
be adapted to
self.hass.components.notify.notify('{}'.format(ip_address + ' (' + geo_country + ', ' + geo_region + ', ' + geo_city + ')'), 'New successful login from')
and have regular notifications?
the user can always add an automation to create pers. notifications for each or certain regular notification if so desired (by creating a dedicated template, i include one here)
btw this works also the other way round ;-)
The text was updated successfully, but these errors were encountered: