What version of Universal Notifier are you using?
v0.8.3
What version of Home Assistant are you using?
2026.7.3
The problem
When a channel is configured with an empty target field, Universal Notifier still forwards target: [''] (a list containing a single empty string) to the underlying notify.* service, instead of omitting the target key entirely. For notifiers that treat target as an override of a configured default (e.g. the built-in smtp notify platform), this empty override replaces the valid default recipient with an empty one, causing the downstream service call to fail.
Details provided by Claude:
Root cause
- config_flow.py always stores target as an empty string when the field is left blank, never as None:
"target": (user_input.get("target") or "").strip(),
(see the channel add/edit/import flows, e.g. around lines 309, 508, 584)
- init.py, Section H ("Routing dei Target nel Payload"), checks is not None instead of checking for emptiness:
conf_target_value = channel_conf.get(CONF_TARGET)
if conf_target_value is not None:
# Normalize: always produce list[str] regardless of input type
if not isinstance(conf_target_value, list):
if isinstance(conf_target_value, str) and "," in conf_target_value:
conf_target_value = [s.strip() for s in conf_target_value.split(",") if s.strip()]
else:
conf_target_value = [conf_target_value]
conf_target_value = [str(x) for x in conf_target_value]
if conf_target_value:
if srv_domain == "tts":
service_payload[ATTR_ENTITY_ID] = conf_target_value
elif srv_domain != "telegram_bot":
service_payload[CONF_TARGET] = conf_target_value
Because the stored value is "" (not None), the first if conf_target_value is not None: branch is entered. Since "" has no comma and is a string, it falls into the else branch and becomes [""]. That list is then passed through [str(x) for x in conf_target_value], remaining [""]. The second check, if conf_target_value:, evaluates a non-empty list (['']) as truthy — even though its only element is an empty string — so service_payload[CONF_TARGET] = [''] is set and forwarded to the notify service.
This affects every channel whose service domain is not tts and not telegram_bot (i.e. notify.*, including smtp, mobile_app, etc.) whenever the channel's target field is left blank.
Reproduction
- Configure a working notify.smtp (or notify. via the SMTP integration) with a default recipient set.
- Add a Universal Notifier channel, e.g. alias email_admin, service notify.email_admin, and leave Target empty.
- Call:
action: universal_notifier.send
data:
message: "test"
title: "test"
targets:
- email_admin
- notify.email_admin is called directly and succeeds.
- Calling it via universal_notifier.send fails. With homeassistant.components.smtp: debug logging enabled, the traceback shows:
smtplib.SMTPRecipientsRefused: {'': (555, b'5.5.2 Syntax error, cannot decode response...')}
confirming that Universal Notifier passed target: [''], which overrode the SMTP integration's configured default recipient with an empty address.
Suggested fix
Either:
- In config_flow.py, store None (or simply omit the key) instead of "" when the target field is blank, or
- In init.py, replace the is not None check with a truthiness/emptiness check, e.g.:
conf_target_value = channel_conf.get(CONF_TARGET)
if conf_target_value:
...
and additionally filter out empty strings after splitting on commas (already done for the comma-split path, but not for the single-value path).
Either change prevents an empty string from ever surviving into [""]/[''] and being forwarded as a target override.
What is your channels configuration for Universal Notifier?
Alias: email_admin
Service: notify.email_admin
Entity_id o chat_id target:
What actions did you take in the developer tools?
action: universal_notifier.send
data:
priority: false
bold_prefix: true
message: message
title: title
include_time: true
targets:
- email_admin
Anything in the logs? Paste it here!
smtplib.SMTPRecipientsRefused: {'': (555, b'5.5.2 Syntax error, cannot decode response...')}
What version of Universal Notifier are you using?
v0.8.3
What version of Home Assistant are you using?
2026.7.3
The problem
When a channel is configured with an empty target field, Universal Notifier still forwards target: [''] (a list containing a single empty string) to the underlying notify.* service, instead of omitting the target key entirely. For notifiers that treat target as an override of a configured default (e.g. the built-in smtp notify platform), this empty override replaces the valid default recipient with an empty one, causing the downstream service call to fail.
Details provided by Claude:
Root cause
"target": (user_input.get("target") or "").strip(),(see the channel add/edit/import flows, e.g. around lines 309, 508, 584)
Because the stored value is "" (not None), the first if conf_target_value is not None: branch is entered. Since "" has no comma and is a string, it falls into the else branch and becomes [""]. That list is then passed through [str(x) for x in conf_target_value], remaining [""]. The second check, if conf_target_value:, evaluates a non-empty list (['']) as truthy — even though its only element is an empty string — so service_payload[CONF_TARGET] = [''] is set and forwarded to the notify service.
This affects every channel whose service domain is not tts and not telegram_bot (i.e. notify.*, including smtp, mobile_app, etc.) whenever the channel's target field is left blank.
Reproduction
smtplib.SMTPRecipientsRefused: {'': (555, b'5.5.2 Syntax error, cannot decode response...')}confirming that Universal Notifier passed target: [''], which overrode the SMTP integration's configured default recipient with an empty address.
Suggested fix
Either:
and additionally filter out empty strings after splitting on commas (already done for the comma-split path, but not for the single-value path).
Either change prevents an empty string from ever surviving into [""]/[''] and being forwarded as a target override.
What is your channels configuration for Universal Notifier?
Alias: email_admin
Service: notify.email_admin
Entity_id o chat_id target:
What actions did you take in the developer tools?
Anything in the logs? Paste it here!