Checking notifications’ history log is useful, to check if you missed some critical notifications.
Please make the feature to save notifications history.
You could limit no. of notifications or those with “critical status” or unlimited with dependency from the entire HA database recorder history.
20200515 040103 TPAD OS Updates / There are 5/5 ubuntu updates available.
20200515 100510 New Home Assistant Release / Home Assistant 0.110.0b2 is now available.
20200515 123626 HA 0.110.0b2 started
20200515 200002 Nexus TH / Sensor Timeout
20200516 232925 Test notification / Please check your configuration.yaml.
Probably not exactly what you want but you can kind of do this with traces. Make a script like this:
alias: Send and save notification
trace:
stored_traces: 100 # Max number of notifications in "log"
fields:
notifier:
name: Notifier
description: What comes after `notify.`
required: true
example: mobile_app_phone
default: mobile_app_phone
selector:
select: # List any notifiers you use here
- mobile_app_phone
title:
name: Title
required: true
selector:
text:
message:
name: Message
required: true
selector:
text:
multiline: true
data:
name: Data
required: false
selector:
object:
sequence:
if: "{{ data is mapping }}"
then:
service: "notify.{{ notifier }}"
data:
title: "{{ title }}"
message: "{{ message }}"
data: "{{ data }}"
else:
service: "notify.{{ notifier }}"
data:
title: "{{ title }}"
message: "{{ message }}"
Then any place you want to send a notification and have it “logged” use this script instead of directly doing a notify.whatever. The data of the service call should be identical.
If you want to see the log then go to the traces of this script. Once it hits 100 traces (or whatever you set stored_traces to) then it will start rotating out the oldest ones.
Kind of goofy I know but figured Id throw it out there.
thanks, it worked. I’m not sure that this was it, as I noticed also that notify.persistent_notification doesn’t log there, just persistent_notification.create
seems logic now, as it uses domain: persistent_notification
so I had to change all my automations…
Hi, i know this is an old post, but can you please help me make this work?
I have never - as in ever - done coding in raw yaml directly in home assistant, so i’m quite confused.
I directly copied your code into my automation.yaml file in the config folder and it throws a lot of errors that im not sure what to do with.
Is it not possible for me to directly copy what you posted?