Hi @redstone99, unfortunately the startup issue isn’t yet resolved, here’s the log from startup of alert2 (below). Subsequently in the log, my two notifiers notify.lovelace_notify and notify.mobile_app_6453 are set up. So it does not appear that we’re delaying until after all notifiers are established.
For the mobile one, that is a standard mobile app notificiation so seems like we should definitely be delayed until after that, so it seems like alert2 is starting before registered notifiers (but perhaps after the notifier system and persistent_notification themselves are set up).
For my custom one written in pyscript (lovelace_popup), it occurs to me alert2 wouldn’t actually know to wait as the system wouldn’t know a pyscript has a notifier. I’m not sure how I can force myself to be in the startup chain ahead of alert2 without modifying the manifest (which would be overwritten on an upgrade).
Given that it seems there can be notifiers being set up during HA startup that alert2 may not be aware are being set up until an alert fails during startup, I’m not sure the utility of trying to send alerts to notifiers that are not yet set up during startup. Even with error checking they will still get lost and never reported to yet-to-be-setup notifiers, so perhaps that phase needs a little retooling, probably some logging of the alert and either queuing up the alerts to send only once HA starts or the notifiers are available or something else.
I’m also not entirely sure why a throttle interval alert is the very first alert that appears to be being thrown in the logs before any other alerts.
2024-11-12 15:16:10.883 INFO (MainThread) [homeassistant.setup] Setting up alert2
2024-11-12 15:16:10.886 INFO (MainThread) [custom_components.alert2] Setting up Alert2
2024-11-12 15:16:10.894 WARNING (MainThread) [custom_components.alert2] _notify msg=[Throttling ending] Alert2 alert2_error: Did not fire during throttled interval
2024-11-12 15:16:10.896 WARNING (MainThread) [custom_components.alert2] Notifying ['all_devices']: [Throttling ending] Alert2 alert2_error: Did not fire during throttled interval
2024-11-12 15:16:11.192 INFO (MainThread) [homeassistant.setup] Setup of domain alert2 took 0.31 seconds
2024-11-12 15:16:11.258 INFO (MainThread) [homeassistant.setup] Setting up shopping_list
2024-11-12 15:16:11.258 INFO (MainThread) [homeassistant.setup] Setup of domain shopping_list took 0.00 seconds
2024-11-12 15:16:11.289 ERROR (MainThread) [custom_components.alert2] Exception {'message': 'Task exception was never retrieved', 'exception': ServiceNotFound('service_not_found'), 'future': <Task finished name='Task-1996' coro=<ServiceRegistry.async_call() done, defined at /usr/src/homeassistant/homeassistant/core.py:2697> exception=ServiceNotFound('service_not_found')>}
2024-11-12 15:16:11.290 ERROR (MainThread) [custom_components.alert2] Err reported: {'domain': 'alert2', 'name': 'error', 'message': "exception {'message': 'Task exception was never retrieved', 'exception': ServiceNotFound('service_not_found'), 'future': <Task finished name='Task-1996' coro=<ServiceRegistry.async_call() done, defined at /usr/src/homeassistant/homeassistant/core.py:2697> exception=ServiceNotFound('service_not_found')>}"}
2024-11-12 15:16:11.291 WARNING (MainThread) [custom_components.alert2] _notify msg=Alert2 alert2_error: exception {'message': 'Task exception was never retrieved', 'exception': ServiceNotFound('service_not_found'), 'future': <Task finished name='Task-1996' coro=<ServiceRegistry.async_call() done, defined at /usr/src/homeassistant/homeassistant/core.py:2697> exception=ServiceNotFound('service_not_found')>}
2024-11-12 15:16:11.292 WARNING (MainThread) [custom_components.alert2] Notifying ['all_devices']: Alert2 alert2_error: exception {'message': 'Task exception was never retrieved', 'exception': ServiceNotFound('service_not_found'), 'future': <Task finished name='Task-1996' coro=<ServiceRegistry.async_call() done, defined at /usr/src/homeassistant/homeassistant/core.py:2697> exception=ServiceNotFound('service_not_found')>}
2024-11-12 15:16:11.295 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/core.py", line 2735, in async_call
raise ServiceNotFound(domain, service) from None
homeassistant.exceptions.ServiceNotFound: Action notify.lovelace_popup not found
2024-11-12 15:16:11.309 ERROR (MainThread) [custom_components.alert2] Exception {'message': 'Task exception was never retrieved', 'exception': ServiceNotFound('service_not_found'), 'future': <Task finished name='Task-1995' coro=<ServiceRegistry.async_call() done, defined at /usr/src/homeassistant/homeassistant/core.py:2697> exception=ServiceNotFound('service_not_found')>}
2024-11-12 15:16:11.309 ERROR (MainThread) [custom_components.alert2] Err reported: {'domain': 'alert2', 'name': 'error', 'message': "exception {'message': 'Task exception was never retrieved', 'exception': ServiceNotFound('service_not_found'), 'future': <Task finished name='Task-1995' coro=<ServiceRegistry.async_call() done, defined at /usr/src/homeassistant/homeassistant/core.py:2697> exception=ServiceNotFound('service_not_found')>}"}
2024-11-12 15:16:11.310 WARNING (MainThread) [custom_components.alert2] _notify msg=Alert2 alert2_error: exception {'message': 'Task exception was never retrieved', 'exception': ServiceNotFound('service_not_found'), 'future': <Task finished name='Task-1995' coro=<ServiceRegistry.async_call() done, defined at /usr/src/homeassistant/homeassistant/core.py:2697> exception=ServiceNotFound('service_not_found')>}
2024-11-12 15:16:11.311 WARNING (MainThread) [custom_components.alert2] Notifying ['all_devices']: Alert2 alert2_error: exception {'message': 'Task exception was never retrieved', 'exception': ServiceNotFound('service_not_found'), 'future': <Task finished name='Task-1995' coro=<ServiceRegistry.async_call() done, defined at /usr/src/homeassistant/homeassistant/core.py:2697> exception=ServiceNotFound('service_not_found')>}
2024-11-12 15:16:11.312 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/core.py", line 2735, in async_call
raise ServiceNotFound(domain, service) from None
homeassistant.exceptions.ServiceNotFound: Action notify.mobile_app_6453 not found