home-assistant/core · warning · HomeAssistantError
sync_time_failed
sync_time_failed
Error message
Failed to sync time for {device_name}: {error} What it means
Raised by the bsblan `sync_time` helper (used by the `bsblan.sync_time` service/action) when reading `client.time()` or writing `client.set_time(...)` raises BSBLANError. It is wrapped in HomeAssistantError with translation key `sync_time_failed` and placeholders for the device name and the underlying error string, so the action call shows a clear failure in the UI.
Source
Thrown at homeassistant/components/bsblan/helpers.py:33
Args:
client: The BSB-LAN client instance.
device_name: The name of the device (used in error messages).
Raises:
HomeAssistantError: If the time sync operation fails.
"""
try:
device_time = await client.time()
current_time = dt_util.now()
current_time_str = current_time.strftime("%d.%m.%Y %H:%M:%S")
# Only sync if device time differs from HA time
if device_time.time.value != current_time_str:
await client.set_time(current_time_str)
except BSBLANError as err:
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="sync_time_failed",
translation_placeholders={
"device_name": device_name,
"error": str(err),
},
) from err
View on GitHub (pinned to 58a3fdb3ea)
Solutions
- Confirm the device is online (state entities updating) before running the sync action.
- Run the action again once reachable; it is idempotent — no write happens when times already match.
- In automations that call sync_time, tolerate failure by continuing on error rather than aborting the sequence.
- Update BSB-LAN firmware if the time parameter is consistently rejected.
Example fix
// automation script: don't abort the whole sequence on time-sync failure service: bsblan.sync_time data: device_id: "..." continue_on_error: true
Defensive patterns
Strategy: try-catch
Try / catch
try:
await async_sync_time(hass, client, device_name)
except HomeAssistantError:
LOGGER.warning("Time sync skipped for %s", device_name) Prevention
- Schedule sync_time automations for times the device is reliably awake (not during reboot windows).
- Set continue_on_error on sync_time actions in larger automations.
- Sync is idempotent — identical clocks cause no write, so periodic retries are cheap.
When it happens
Trigger: Invoking the `bsblan.sync_time` action while the device is unreachable, rejects the time write, or returns an unexpected response. The comparison `device_time.time.value != current_time_str` gates the write, so a matching clock does not attempt it.
Common situations: Automations that sync time on a schedule (e.g. after device power loss) firing while the device is offline or busy; devices whose firmware does not expose the time parameter in the expected form.
Related errors
- end_time_before_start_time
- invalid_device_id
- connection_failed
- unsupported_source
- unsupported_sound_mode
AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14).
Data as JSON: /api/errors/461696629a8eb2fa.
Report an issue: GitHub.