home-assistant/core · error · HomeAssistantError

set_operation_mode_error

set_operation_mode_error

Error message

An error occurred while setting the operation mode

What it means

HomeAssistantError raised by the bsblan water-heater entity when `client.set_hot_water(SetHotWaterParam(operating_mode=str(bsblan_mode)))` raises BSBLANError, translation key `set_operation_mode_error`. The HA operation mode is already validated against operation_list by the base class before this point, so failure means the device rejected the numeric mode string or communication broke. Also reached via `async_turn_on` (which sets STATE_PERFORMANCE).

Source

Thrown at homeassistant/components/bsblan/water_heater.py:190

            raise HomeAssistantError(
                translation_domain=DOMAIN,
                translation_key="set_temperature_error",
            ) from err

        await self.coordinator.async_request_refresh()

    @override
    async def async_set_operation_mode(self, operation_mode: str) -> None:
        """Set new operation mode."""
        # Base class validates operation_mode is in operation_list before calling
        bsblan_mode = HA_TO_BSBLAN_OPERATION_MODE[operation_mode]
        try:
            # Send numeric value as string - BSB-LAN API expects numeric mode values
            await self.coordinator.client.set_hot_water(
                SetHotWaterParam(operating_mode=str(bsblan_mode))
            )
        except BSBLANError as err:
            raise HomeAssistantError(
                translation_domain=DOMAIN,
                translation_key="set_operation_mode_error",
            ) from err

        await self.coordinator.async_request_refresh()

    @override
    async def async_turn_on(self, **kwargs: Any) -> None:
        """Turn the water heater on."""
        await self.async_set_operation_mode(STATE_PERFORMANCE)

    @override
    async def async_turn_off(self, **kwargs: Any) -> None:
        """Turn the water heater off."""
        await self.async_set_operation_mode(STATE_OFF)

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Verify connectivity (entity state not unavailable) and retry.
  2. Confirm the target mode is in the entity's operation_list; `turn_on` maps to performance mode.
  3. Test the equivalent mode write in the BSB-LAN web UI to isolate device-side rejection.
  4. Enable debug logging to capture the underlying BSBLANError.
Defensive patterns

Strategy: try-catch

Try / catch

try:
    await client.set_hot_water(SetHotWaterParam(operating_mode=str(bsblan_mode)))
except BSBLANError as err:
    raise HomeAssistantError(translation_domain=DOMAIN, translation_key="set_operation_mode_error") from err

Prevention

When it happens

Trigger: Calling `water_heater.set_operation_mode` or `water_heater.turn_on` on a bsblan water heater while offline, or when the boiler rejects the mapped numeric operating mode for DHW.

Common situations: Automations turning DHW to performance mode in the morning while the device is briefly unreachable; boilers whose firmware doesn't accept mode writes on the DHW parameter set.

Related errors


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