Skip to content

Client

The main entry point for interacting with BSB-LAN devices.

BSBLAN

bsblan.BSBLAN dataclass

BSBLAN(
    config: BSBLANConfig,
    session: ClientSession | None = None,
    _close_session: bool = False,
    _firmware_version: str | None = None,
    _json_api_version: str | None = None,
    _supports_full_config: bool | None = None,
    _api_data: APIConfig | None = None,
    _device: Device | None = None,
    _initialized: bool = False,
    _available_circuits: set[int] | None = None,
)

Main class for handling connections with BSBLAN.

device_info property

device_info: Device | None

Return cached device metadata from the last /JI response.

supports_time_sync property

supports_time_sync: bool

Return cached support for the normal BSB/LPB time sync command.

initialize async

initialize() -> None

Initialize the BSBLAN client.

This performs minimal initialization for fast startup. Section validation is deferred until actually needed (lazy loading).

Source code in src/bsblan/bsblan.py
async def initialize(self) -> None:
    """Initialize the BSBLAN client.

    This performs minimal initialization for fast startup.
    Section validation is deferred until actually needed (lazy loading).
    """
    if not self._initialized:
        await self._fetch_firmware_version()
        await self._setup_api_validator()
        self._initialized = True

get_available_circuits async

get_available_circuits() -> list[int]

Detect which heating circuits are available on the device.

Reads the heating circuits check number first: when it is usable, the circuits it reports as configured are returned. Otherwise the operating mode probe parameters from CircuitConfig.PROBE_PARAMS are used as the discovery signal. Status parameters are not queried during discovery to keep setup lightweight and avoid excluding valid circuits when status data is unavailable.

This is useful for integration setup flows (e.g., Home Assistant config flow) to discover how many circuits the user's controller supports.

Returns:

Type Description
list[int]

list[int]: Sorted list of available circuit numbers (e.g., [1, 2]).

Example

async with BSBLAN(config) as client: circuits = await client.get_available_circuits() # circuits == [1, 2] for a dual-circuit controller

Source code in src/bsblan/bsblan.py
async def get_available_circuits(self) -> list[int]:
    """Detect which heating circuits are available on the device.

    Reads the heating circuits check number first: when it is usable, the
    circuits it reports as configured are returned. Otherwise the operating
    mode probe parameters from CircuitConfig.PROBE_PARAMS are used as the
    discovery signal. Status parameters are not queried during discovery
    to keep setup lightweight and avoid excluding valid circuits when
    status data is unavailable.

    This is useful for integration setup flows (e.g., Home Assistant
    config flow) to discover how many circuits the user's controller
    supports.

    Returns:
        list[int]: Sorted list of available circuit numbers (e.g., [1, 2]).

    Example:
        async with BSBLAN(config) as client:
            circuits = await client.get_available_circuits()
            # circuits == [1, 2] for a dual-circuit controller

    """
    if self._supports_full_config is False:
        logger.debug(
            "Basic single-circuit configuration detected; skipping circuit "
            "discovery and assuming only circuit 1 is available"
        )
        self._available_circuits = {1}
        return [1]
    if self._uses_pps_bus:
        return await self._get_available_pps_circuits()

    if configured := await self._get_circuits_from_check_number():
        self._available_circuits = set(configured)
        return configured

    available: list[int] = []
    for circuit, param_id in CircuitConfig.PROBE_PARAMS.items():
        try:
            response = await self._request(
                params={"Parameter": param_id},
            )
        except BSBLANError:
            logger.debug(
                "Circuit %d not available (operating mode request failed)",
                circuit,
            )
            continue

        # A circuit exists if the response contains the operating mode key
        # with an active value (not an empty dict, and not None/"---").
        param_data = response.get(param_id)
        if not is_param_value_active(param_data):
            logger.debug(
                "Circuit %d has no operating mode data (not supported)",
                circuit,
            )
            continue

        available.append(circuit)
    self._available_circuits = set(available)
    return sorted(available)

state async

state(
    include: list[str] | None = None, circuit: int = 1
) -> State

Get the current state from BSBLAN device.

Parameters:

Name Type Description Default
include list[str] | None

Optional list of parameter names to fetch. If None, fetches all state parameters. Valid names include: hvac_mode, target_temperature, hvac_action, hvac_mode_changeover, current_temperature, current_setpoint, room1_temp_setpoint_boost.

None
circuit int

The heating circuit number (1 or 2). Defaults to 1. Circuit 2 uses separate parameter IDs but returns the same State model with the same field names.

1

Returns:

Name Type Description
State State

The current state of the BSBLAN device.

Note

For BSB/LPB devices, hvac_mode.value is returned as a raw integer: 0=off, 1=auto, 2=eco, 3=heat. PPS devices normalize their raw operating modes to the same library values, but do not support eco.

Example

Fetch only hvac_mode and current_temperature

state = await client.state(include=["hvac_mode", "current_temperature"])

Fetch state for heating circuit 2

state_hc2 = await client.state(circuit=2)

Source code in src/bsblan/bsblan.py
async def state(
    self,
    include: list[str] | None = None,
    circuit: int = 1,
) -> State:
    """Get the current state from BSBLAN device.

    Args:
        include: Optional list of parameter names to fetch. If None,
            fetches all state parameters. Valid names include:
            hvac_mode, target_temperature, hvac_action,
            hvac_mode_changeover, current_temperature, current_setpoint,
            room1_temp_setpoint_boost.
        circuit: The heating circuit number (1 or 2). Defaults to 1.
            Circuit 2 uses separate parameter IDs but returns the
            same State model with the same field names.

    Returns:
        State: The current state of the BSBLAN device.

    Note:
        For BSB/LPB devices, hvac_mode.value is returned as a raw integer:
        0=off, 1=auto, 2=eco, 3=heat. PPS devices normalize their raw
        operating modes to the same library values, but do not support eco.

    Example:
        # Fetch only hvac_mode and current_temperature
        state = await client.state(include=["hvac_mode", "current_temperature"])

        # Fetch state for heating circuit 2
        state_hc2 = await client.state(circuit=2)

    """
    self._validate_circuit(circuit)
    section: SectionLiteral = cast(
        "SectionLiteral", CircuitConfig.HEATING_SECTIONS[circuit]
    )
    return await self._fetch_section_data(section, State, include)

sensor async

sensor(include: list[str] | None = None) -> Sensor

Get the sensor information from BSBLAN device.

Parameters:

Name Type Description Default
include list[str] | None

Optional list of parameter names to fetch. If None, fetches all sensor parameters. Valid names include: outside_temperature, current_temperature.

None

Returns:

Name Type Description
Sensor Sensor

The sensor information from the BSBLAN device.

Raises:

Type Description
BSBLANUnsupportedFeatureError

If validation leaves no supported sensor parameters on a PPS device.

BSBLANError

If the sensor request fails or the requested parameter names are invalid.

Example

Fetch only outside_temperature

sensor = await client.sensor(include=["outside_temperature"])

Source code in src/bsblan/bsblan.py
async def sensor(self, include: list[str] | None = None) -> Sensor:
    """Get the sensor information from BSBLAN device.

    Args:
        include: Optional list of parameter names to fetch. If None,
            fetches all sensor parameters. Valid names include:
            outside_temperature, current_temperature.

    Returns:
        Sensor: The sensor information from the BSBLAN device.

    Raises:
        BSBLANUnsupportedFeatureError: If validation leaves no supported
            sensor parameters on a PPS device.
        BSBLANError: If the sensor request fails or the requested parameter
            names are invalid.

    Example:
        # Fetch only outside_temperature
        sensor = await client.sensor(include=["outside_temperature"])

    """
    return await self._fetch_section_data("sensor", Sensor, include)

static_values async

static_values(
    include: list[str] | None = None, circuit: int = 1
) -> StaticState

Get the static information from BSBLAN device.

Parameters:

Name Type Description Default
include list[str] | None

Optional list of parameter names to fetch. If None, fetches all static parameters. Valid names include: temp_reduced_setpoint, heating_protective_setpoint, comfort_setpoint_max, cooling_comfort_setpoint_min, cooling_reduced_setpoint, and min_temp, max_temp on PPS.

None
circuit int

The heating circuit number (1 or 2). Defaults to 1.

1

Returns:

Name Type Description
StaticState StaticState

The static information from the BSBLAN device.

Example

Fetch only the reduced setpoint

static = await client.static_values(include=["temp_reduced_setpoint"])

Fetch static values for heating circuit 2

static_hc2 = await client.static_values(circuit=2)

Source code in src/bsblan/bsblan.py
async def static_values(
    self,
    include: list[str] | None = None,
    circuit: int = 1,
) -> StaticState:
    """Get the static information from BSBLAN device.

    Args:
        include: Optional list of parameter names to fetch. If None,
            fetches all static parameters. Valid names include:
            temp_reduced_setpoint, heating_protective_setpoint,
            comfort_setpoint_max, cooling_comfort_setpoint_min,
            cooling_reduced_setpoint, and min_temp, max_temp on PPS.
        circuit: The heating circuit number (1 or 2). Defaults to 1.

    Returns:
        StaticState: The static information from the BSBLAN device.

    Example:
        # Fetch only the reduced setpoint
        static = await client.static_values(include=["temp_reduced_setpoint"])

        # Fetch static values for heating circuit 2
        static_hc2 = await client.static_values(circuit=2)

    """
    self._validate_circuit(circuit)
    section: SectionLiteral = cast(
        "SectionLiteral", CircuitConfig.STATIC_SECTIONS[circuit]
    )
    return await self._fetch_section_data(section, StaticState, include)

device async

device() -> Device

Get BSBLAN device info.

Returns:

Name Type Description
Device Device

The BSBLAN device information.

Source code in src/bsblan/bsblan.py
async def device(self) -> Device:
    """Get BSBLAN device info.

    Returns:
        Device: The BSBLAN device information.

    """
    device_info = await self._request(base_path="/JI")
    try:
        device = Device.model_validate(device_info)
    except ValidationError as err:
        self.invalidate_schedule_profiles()
        msg = "Invalid /JI device metadata"
        raise BSBLANMalformedResponseError(msg) from err
    self._device = device
    return device

info async

info(include: list[str] | None = None) -> Info

Get information about the current heating system config.

Parameters:

Name Type Description Default
include list[str] | None

Optional list of parameter names to fetch. If None, fetches all info parameters. Valid names include: device_identification, controller_family, controller_variant.

None

Returns:

Name Type Description
Info Info

The information about the current heating system config.

Example

Fetch only device_identification

info = await client.info(include=["device_identification"])

Source code in src/bsblan/bsblan.py
async def info(self, include: list[str] | None = None) -> Info:
    """Get information about the current heating system config.

    Args:
        include: Optional list of parameter names to fetch. If None,
            fetches all info parameters. Valid names include:
            device_identification, controller_family, controller_variant.

    Returns:
        Info: The information about the current heating system config.

    Example:
        # Fetch only device_identification
        info = await client.info(include=["device_identification"])

    """
    return await self._fetch_section_data("device", Info, include)

time async

time() -> DeviceTime

Get the current time from the BSB-LAN device.

Returns:

Name Type Description
DeviceTime DeviceTime

The current time information from the BSB-LAN device.

Source code in src/bsblan/bsblan.py
async def time(self) -> DeviceTime:
    """Get the current time from the BSB-LAN device.

    Returns:
        DeviceTime: The current time information from the BSB-LAN device.

    """
    await self._ensure_device_metadata()
    self._validate_time_sync_supported()

    # Get only parameter 0 for time
    data = await self._request(params={"Parameter": "0"})
    # Create the data dictionary in the expected format
    time_data = {"time": data["0"]}
    return DeviceTime.model_validate(time_data)

set_time async

set_time(value: datetime) -> None

Set the time on the BSB-LAN device.

Parameters:

Name Type Description Default
value datetime

The local time of the heating system. Its date and time are written as they are, without timezone conversion.

required

Raises:

Type Description
BSBLANInvalidParameterError

If the year is out of range.

BSBLANError

If the device does not accept the new time.

Source code in src/bsblan/bsblan.py
async def set_time(self, value: datetime) -> None:
    """Set the time on the BSB-LAN device.

    Args:
        value (datetime): The local time of the heating system. Its date and
            time are written as they are, without timezone conversion.

    Raises:
        BSBLANInvalidParameterError: If the year is out of range.
        BSBLANError: If the device does not accept the new time.

    """
    await self._ensure_device_metadata()
    self._validate_time_sync_supported()
    if not Validation.MIN_YEAR <= value.year <= Validation.MAX_YEAR:
        msg = f"Invalid year: {value.year}"
        raise BSBLANInvalidParameterError(msg)
    # BSB-LAN 4.1 rejects a space between the date and the time
    response = await self._request(
        base_path="/JS",
        data=self._set_payload("0", value.strftime("%d.%m.%Y_%H:%M:%S")),
    )
    logger.debug("Response for setting time: %s", response)
    if response.get("0", {}).get("status") != 1:
        raise BSBLANError(ErrorMsg.TIME_SYNC_FAILED)

thermostat async

thermostat(
    target_temperature: str | None = None,
    hvac_mode: int | None = None,
    circuit: int = 1,
    target_temperature_high: str | float | None = None,
    *,
    cooling_operating_mode: int | None = None,
    temp_reduced_setpoint: str | float | None = None,
    temporary_mode: int | None = None
) -> None

Change the state of the thermostat through BSB-Lan.

Parameters:

Name Type Description Default
target_temperature str | None

The target temperature to set.

None
hvac_mode int | None

The HVAC mode to set as raw integer value. For BSB/LPB, valid values are 0=off, 1=auto, 2=eco, 3=heat. For PPS, valid values are 0=off, 1=auto, and 3=heat/manual; they are translated to PPS raw values before posting.

None
circuit int

The heating circuit number (1 or 2). Defaults to 1.

1
target_temperature_high str | float | None

The cooling comfort setpoint to set.

None
cooling_operating_mode int | None

The cooling circuit operating mode to set as raw integer value: 0=Protection, 1=Automatic, 2=Reduced, 3=Comfort. Not supported on PPS devices.

None
temp_reduced_setpoint str | float | None

The reduced (eco) room setpoint to set. Not supported on PPS devices.

None
temporary_mode int | None

Temporary operating mode override, active until the next time program switch point. Raw integer value: 0=No override, 1=Reduced, 2=Comfort. Only has an effect in automatic mode. Not supported on PPS devices.

None
Example

Set HC1 temperature

await client.thermostat(target_temperature="21.0")

Set HC1 cooling comfort setpoint

await client.thermostat(target_temperature_high="24.0")

Set HC1 cooling operating mode

await client.thermostat(cooling_operating_mode=1)

Set HC1 reduced setpoint

await client.thermostat(temp_reduced_setpoint="18.0")

Switch HC1 to comfort until the next time program switch point

await client.thermostat(temporary_mode=2)

Set HC2 mode

await client.thermostat(hvac_mode=1, circuit=2)

Source code in src/bsblan/bsblan.py
async def thermostat(  # noqa: PLR0913  # pylint: disable=too-many-arguments
    self,
    target_temperature: str | None = None,
    hvac_mode: int | None = None,
    circuit: int = 1,
    target_temperature_high: str | float | None = None,
    *,
    cooling_operating_mode: int | None = None,
    temp_reduced_setpoint: str | float | None = None,
    temporary_mode: int | None = None,
) -> None:
    """Change the state of the thermostat through BSB-Lan.

    Args:
        target_temperature (str | None): The target temperature to set.
        hvac_mode (int | None): The HVAC mode to set as raw integer value.
            For BSB/LPB, valid values are 0=off, 1=auto, 2=eco, 3=heat.
            For PPS, valid values are 0=off, 1=auto, and 3=heat/manual;
            they are translated to PPS raw values before posting.
        circuit: The heating circuit number (1 or 2). Defaults to 1.
        target_temperature_high: The cooling comfort setpoint to set.
        cooling_operating_mode: The cooling circuit operating mode to set
            as raw integer value: 0=Protection, 1=Automatic, 2=Reduced,
            3=Comfort. Not supported on PPS devices.
        temp_reduced_setpoint: The reduced (eco) room setpoint to set.
            Not supported on PPS devices.
        temporary_mode: Temporary operating mode override, active until
            the next time program switch point. Raw integer value:
            0=No override, 1=Reduced, 2=Comfort. Only has an effect in
            automatic mode. Not supported on PPS devices.

    Example:
        # Set HC1 temperature
        await client.thermostat(target_temperature="21.0")

        # Set HC1 cooling comfort setpoint
        await client.thermostat(target_temperature_high="24.0")

        # Set HC1 cooling operating mode
        await client.thermostat(cooling_operating_mode=1)

        # Set HC1 reduced setpoint
        await client.thermostat(temp_reduced_setpoint="18.0")

        # Switch HC1 to comfort until the next time program switch point
        await client.thermostat(temporary_mode=2)

        # Set HC2 mode
        await client.thermostat(hvac_mode=1, circuit=2)

    """
    self._validate_circuit(circuit)
    if self._uses_pps_bus:
        self._validate_bus_write_supported()

    self._validate_single_parameter(
        target_temperature,
        hvac_mode,
        target_temperature_high,
        cooling_operating_mode,
        temp_reduced_setpoint,
        temporary_mode,
        error_msg=ErrorMsg.MULTI_PARAMETER,
    )

    state = await self._thermostat_writer.prepare_state(
        target_temperature,
        hvac_mode,
        circuit,
        target_temperature_high,
        cooling_operating_mode=cooling_operating_mode,
        temp_reduced_setpoint=temp_reduced_setpoint,
        temporary_mode=temporary_mode,
    )
    await self._set_device_state(state)

discover_schedules async

discover_schedules(
    *, refresh: bool = False
) -> tuple[ScheduleAvailability, ...]

Return independent HC1, HC2 and DHW availability without writes.

Explicit mappings win; successful automatic mappings are reused in memory. Set refresh=True to discard cached trust and run fresh compatibility probes. Connection/auth/malformed errors propagate; retry discovery rather than creating a wrong-mapping repair. HA can defer this call until startup traffic settles; no discovery runs during ordinary initialization.

Source code in src/bsblan/bsblan.py
async def discover_schedules(
    self, *, refresh: bool = False
) -> tuple[ScheduleAvailability, ...]:
    """Return independent HC1, HC2 and DHW availability without writes.

    Explicit mappings win; successful automatic mappings are reused in memory.
    Set refresh=True to discard cached trust and run fresh compatibility
    probes. Connection/auth/malformed errors propagate; retry discovery rather
    than creating a wrong-mapping repair. HA can defer this call until startup
    traffic settles; no discovery runs during ordinary initialization.
    """
    return await self._schedules.discover(refresh=refresh)

invalidate_schedule_profiles

invalidate_schedule_profiles() -> None

Discard automatic mapping trust without I/O, e.g. after reconnect.

Manual overrides are unchanged. Existing clients retain their captured profile/table configuration; recreate the client to change that evidence.

Source code in src/bsblan/bsblan.py
def invalidate_schedule_profiles(self) -> None:
    """Discard automatic mapping trust without I/O, e.g. after reconnect.

    Manual overrides are unchanged. Existing clients retain their captured
    profile/table configuration; recreate the client to change that evidence.
    """
    self._schedules.invalidate_profiles()

probe_schedule_candidate async

probe_schedule_candidate(
    candidate_id: str,
) -> ScheduleCandidateProbe

Diagnose a named candidate read-only, without enabling schedule groups.

Currently accepts only "issue_1668_dhw": the seven exact DHW IDs reported in issue #1668. Compatibility is not proof of weekday meaning or the active table. The result always requires independent confirmation. This method is opt-in; discovery failures never trigger fallback scans.

Source code in src/bsblan/bsblan.py
async def probe_schedule_candidate(
    self, candidate_id: str
) -> ScheduleCandidateProbe:
    """Diagnose a named candidate read-only, without enabling schedule groups.

    Currently accepts only "issue_1668_dhw": the seven exact DHW IDs reported
    in issue #1668. Compatibility is not proof of weekday meaning or the
    active table. The result always requires independent confirmation.
    This method is opt-in; discovery failures never trigger fallback scans.
    """
    return await self._schedules.probe_candidate(candidate_id)

heating_schedule async

heating_schedule(*, circuit: int = 1) -> ScheduleSnapshot

Read seven fresh observations for heating circuit 1 or 2.

Explicit mappings override automatic evidence-backed profile resolution.

A returned snapshot may be incomplete; use its day outcomes and retry_required property rather than treating object presence as success.

Source code in src/bsblan/bsblan.py
async def heating_schedule(self, *, circuit: int = 1) -> ScheduleSnapshot:
    """Read seven fresh observations for heating circuit 1 or 2.

    Explicit mappings override automatic evidence-backed profile resolution.

    A returned snapshot may be incomplete; use its day outcomes and
    retry_required property rather than treating object presence as success.
    """
    return await self._schedules.read("heating", circuit)

set_heating_schedule async

set_heating_schedule(
    update: ScheduleUpdate, *, circuit: int = 1
) -> None

Write populated days using the same mapping as heating_schedule().

Validate the complete update before the first write. Each populated day requires a separate acknowledgement; failures report partial progress. Clear operations are rejected until their wire encoding is verified. The caller owns readback, publication, and handling partial failures.

Source code in src/bsblan/bsblan.py
async def set_heating_schedule(
    self,
    update: ScheduleUpdate,
    *,
    circuit: int = 1,
) -> None:
    """Write populated days using the same mapping as heating_schedule().

    Validate the complete update before the first write. Each populated day
    requires a separate acknowledgement; failures report partial progress.
    Clear operations are rejected until their wire encoding is verified.
    The caller owns readback, publication, and handling partial failures.
    """
    await self._schedules.write("heating", update, circuit)

hot_water_state async

hot_water_state(
    include: list[str] | None = None,
) -> HotWaterState

Get essential hot water state for frequent polling.

This method returns only the most important hot water parameters that are typically checked frequently for monitoring purposes. This reduces API calls and improves performance for regular polling.

Uses granular lazy loading - only validates the 6 essential params, not all 29 hot water parameters.

Parameters:

Name Type Description Default
include list[str] | None

Optional list of parameter names to fetch. If None, fetches all essential hot water parameters. Valid names include: operating_mode, nominal_setpoint, release, dhw_actual_value_top_temperature, dhw_current_setpoint, state_dhw_pump.

None

Returns:

Name Type Description
HotWaterState HotWaterState

Essential hot water state information.

Example

Fetch only operating_mode and nominal_setpoint

state = await client.hot_water_state( include=["operating_mode", "nominal_setpoint"] )

Source code in src/bsblan/bsblan.py
async def hot_water_state(self, include: list[str] | None = None) -> HotWaterState:
    """Get essential hot water state for frequent polling.

    This method returns only the most important hot water parameters
    that are typically checked frequently for monitoring purposes.
    This reduces API calls and improves performance for regular polling.

    Uses granular lazy loading - only validates the 6 essential params,
    not all 29 hot water parameters.

    Args:
        include: Optional list of parameter names to fetch. If None,
            fetches all essential hot water parameters. Valid names include:
            operating_mode, nominal_setpoint, release,
            dhw_actual_value_top_temperature, dhw_current_setpoint,
            state_dhw_pump.

    Returns:
        HotWaterState: Essential hot water state information.

    Example:
        # Fetch only operating_mode and nominal_setpoint
        state = await client.hot_water_state(
            include=["operating_mode", "nominal_setpoint"]
        )

    """
    return await self._hot_water.state(include)

hot_water_config async

hot_water_config(
    include: list[str] | None = None,
) -> HotWaterConfig

Get hot water configuration and advanced settings.

This method returns configuration parameters that are typically set once and checked less frequently.

Uses granular lazy loading - only validates the 16 config params.

Parameters:

Name Type Description Default
include list[str] | None

Optional list of parameter names to fetch. If None, fetches all config hot water parameters. Valid names include: eco_mode_selection, nominal_setpoint_max, reduced_setpoint, dhw_charging_priority, operating_mode_changeover, legionella_function, legionella_function_setpoint, legionella_function_periodicity, legionella_function_day, legionella_function_time, legionella_function_dwelling_time, legionella_circulation_pump, legionella_circulation_temp_diff, dhw_circulation_pump_release, dhw_circulation_pump_cycling, dhw_circulation_setpoint.

None

Returns:

Name Type Description
HotWaterConfig HotWaterConfig

Hot water configuration information.

Example

Fetch only legionella settings

config = await client.hot_water_config( include=["legionella_function", "legionella_function_setpoint"] )

Source code in src/bsblan/bsblan.py
async def hot_water_config(
    self, include: list[str] | None = None
) -> HotWaterConfig:
    """Get hot water configuration and advanced settings.

    This method returns configuration parameters that are typically
    set once and checked less frequently.

    Uses granular lazy loading - only validates the 16 config params.

    Args:
        include: Optional list of parameter names to fetch. If None,
            fetches all config hot water parameters. Valid names include:
            eco_mode_selection, nominal_setpoint_max, reduced_setpoint,
            dhw_charging_priority, operating_mode_changeover,
            legionella_function, legionella_function_setpoint,
            legionella_function_periodicity, legionella_function_day,
            legionella_function_time, legionella_function_dwelling_time,
            legionella_circulation_pump, legionella_circulation_temp_diff,
            dhw_circulation_pump_release, dhw_circulation_pump_cycling,
            dhw_circulation_setpoint.

    Returns:
        HotWaterConfig: Hot water configuration information.

    Example:
        # Fetch only legionella settings
        config = await client.hot_water_config(
            include=["legionella_function", "legionella_function_setpoint"]
        )

    """
    return await self._hot_water.config(include)

hot_water_schedule async

hot_water_schedule() -> ScheduleSnapshot

Read seven fresh DHW observations using an override or verified profile.

Missing/inactive values and unsupported intervals remain explicit day outcomes. Without an override, reuse a validated profile or lazily match and probe one. Schedule values are never reused from an earlier operation. No factory reset or default schedule parameter is requested.

Source code in src/bsblan/bsblan.py
async def hot_water_schedule(self) -> ScheduleSnapshot:
    """Read seven fresh DHW observations using an override or verified profile.

    Missing/inactive values and unsupported intervals remain explicit day
    outcomes. Without an override, reuse a validated profile or lazily match
    and probe one. Schedule values are never reused from an earlier operation.
    No factory reset or default schedule parameter is requested.
    """
    return await self._schedules.read("hot_water")

set_hot_water async

set_hot_water(params: SetHotWaterParam) -> None

Change the state of the hot water system through BSB-Lan.

Only one parameter should be set at a time (BSB-LAN API limitation).

Example

params = SetHotWaterParam(nominal_setpoint=55.0) await client.set_hot_water(params)

Parameters:

Name Type Description Default
params SetHotWaterParam

SetHotWaterParam object containing the parameter to set.

required

Raises:

Type Description
BSBLANError

If multiple parameters are set or no parameter is set.

Source code in src/bsblan/bsblan.py
async def set_hot_water(self, params: SetHotWaterParam) -> None:
    """Change the state of the hot water system through BSB-Lan.

    Only one parameter should be set at a time (BSB-LAN API limitation).

    Example:
        params = SetHotWaterParam(nominal_setpoint=55.0)
        await client.set_hot_water(params)

    Args:
        params: SetHotWaterParam object containing the parameter to set.

    Raises:
        BSBLANError: If multiple parameters are set or no parameter is set.

    """
    await self._hot_water.set_hot_water(params)

set_hot_water_schedule async

set_hot_water_schedule(update: ScheduleUpdate) -> None

Write populated DHW days using the client-configured schedule mapping.

None leaves a day unchanged. Unsupported clear intent fails before any writes. Acknowledgements are not readback proof; the caller owns refresh even when BSBLANScheduleWriteError reports a partial or uncertain result.

Source code in src/bsblan/bsblan.py
async def set_hot_water_schedule(self, update: ScheduleUpdate) -> None:
    """Write populated DHW days using the client-configured schedule mapping.

    None leaves a day unchanged. Unsupported clear intent fails before any
    writes. Acknowledgements are not readback proof; the caller owns refresh
    even when BSBLANScheduleWriteError reports a partial or uncertain result.
    """
    await self._schedules.write("hot_water", update)

BSBLANConfig

bsblan.BSBLANConfig dataclass

BSBLANConfig(
    host: str,
    username: str | None = None,
    password: str | None = None,
    passkey: str | None = None,
    port: int = 80,
    request_timeout: int = 10,
    schedule_mappings: ScheduleMappings = ScheduleMappings(),
    schedule_profiles: tuple[
        ScheduleProfile, ...
    ] = STANDARD_SCHEDULE_PROFILES,
    schedule_table: str | None = None,
)

Configuration for BSBLAN.

Shared schedule API

Read and write methods share the immutable manual overrides in BSBLANConfig.schedule_mappings. Heating mappings are configured under heating={1: profile_1, 2: profile_2} and selected by the same circuit identifier used by the read/write methods. Missing groups attempt evidence-backed automatic resolution using schedule_profiles, matching declared table_parameters or an asserted active schedule_table. The built-in RVS21 profile covers only the verified controller/build/bus/destination and integer-weekday layout. Unknown installations never receive guessed fallback IDs; schedule_profiles=() opts out.

discover_schedules(refresh=False) performs no writes and returns HC1, HC2 and DHW ScheduleAvailability outcomes independently. Manual overrides take precedence. Successful automatic mappings are reused in memory, never their schedule values. Use refresh=True for fresh discovery or synchronous invalidate_schedule_profiles() to discard trust without I/O. HA controls when to discover, so it can defer work until initial polling settles. Initialization never starts discovery, and the library does not impose a startup sleep.

Automatic groups require exact identity and seven compatible TIMEPROG parameters; unknown/incompatible groups need a repair/override, while incomplete probes need retries. Network/authentication/malformed exceptions propagate unchanged. Readers/setters use the same resolution lazily and raise BSBLANScheduleProbeError for inconclusive probes, not a mapping error. Reads fetch fresh values using cached mappings; automatic writes always refresh identity and compatibility first. Connection failures and observed metadata changes discard automatic trust; explicit refresh/invalidation handles known remote changes. Schedule setters validate and encode the entire update before discovery I/O. Fresh layout/value permission denials are both retained, and target/proof guards run before every actual schedule request attempt, including transport retries.

probe_schedule_candidate("issue_1668_dhw") performs an explicit read-only probe of the issue's seven decimal DHW IDs. Its immutable ScheduleCandidateProbe result is never enabled and always requires confirmation of weekday meaning. It does not populate the automatic mapping cache or run as a fallback on failure. See evidence-backed profiles for identity provenance, current limitations and consumer retry/repair guidance. See structured schedules and the breaking API migration guide.

BSB/LPB gateway buswritable=0 is a default indicator, not an absolute write veto. Schedule setters can proceed with explicit individual readwrite=0 evidence, checking fresh /JC structures for the populated IDs when needed. Explicit read-only/write-only flags remain denied; see parameter permissions.

The shared models describe mappings, snapshots, intervals, and partial updates. Schedule exceptions expose absent mappings and acknowledged/uncertain partial-write progress.