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

  1. Confirm the device is online (state entities updating) before running the sync action.
  2. Run the action again once reachable; it is idempotent — no write happens when times already match.
  3. In automations that call sync_time, tolerate failure by continuing on error rather than aborting the sequence.
  4. 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

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


AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14). Data as JSON: /api/errors/461696629a8eb2fa. Report an issue: GitHub.