Sending notifications from a custom entity


I created an entity to gather “warning” events in the logbook, but that entity never sends a notification.


The current alerting and notification methods I have found are are “if thing A happens, show devices X, Y, and Z an alert”. Thus I see the event on my devices, and swipe/dismiss it. However I can’t see logbook entries for the alert events, e.g. what caused them, or when they were dismissed.


  • Create a new entity date_logger to receive automation actions
  • Create automations when existing entities cross a warning or critical threshold
  • Write the warning/critical event to date_logger
  • Trigger alert/notification based on the state of date_logger


  • Is this approach reasonable, or should I be using a different method?
  • What entity type is most suitable for use as a logbook warning logger?



I created a helper input_datetime.date_logger. As you can see from the name, I used entity type input_datetime.

Automation - works

I also created an automation:

alias: test persistent notification on
description: ""
  - platform: state
      - switch.front_door_dual_smart_plug_entry_left_plug
      hours: 0
      minutes: 0
      seconds: 0
condition: []
  - service: logbook.log
      name: test log
      message: this is a test log message for entry left plug
      entity_id: input_datetime.date_logger
mode: single

As expected, the automation creates logbook entries, for example:

test log  this is a test log message for entry left plug triggered by automation test persistent notification on  triggered by state of Entry left plug
1:25:06 PM - 19 seconds ago

Notification - does not work

Next is to trigger a notification on changes to input_datetime.date_logger. For this I created another automation:

alias: test date logger notification
description: ""
  - platform: state
      - input_datetime.date_logger
condition: []
  - service: notify.mobile_app_my_mobile
    metadata: {}
      message: logged a thing
mode: single

However this currently never triggers!

Adding a log does not change the state object of the entity, so the State trigger will not work there.