Models¶
Data models for BSB-LAN API responses.
Core types¶
EntityInfo¶
bsblan.EntityInfo
¶
Bases: BaseModel, Generic[T]
BSB-LAN parameter info with automatic type conversion.
This object holds info about specific objects and handles automatic type conversion based on data_type and unit.
The generic parameter T indicates the expected value type after
conversion:
EntityInfo[float]for temperature / numeric sensor valuesEntityInfo[int]for enums, weekdays and plain integersEntityInfo[time]for HH:MM time valuesEntityInfo[str]for string / datetime values
When the device returns "---" or "None" (sensor not in use, per
BSB-LAN's replaceDisabled setting), value is set
to None.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Name attribute. |
value |
T | None
|
Converted value, or None when sensor/parameter is inactive. |
unit |
str
|
Unit of measurement. |
desc |
str
|
Description of the entity. |
data_type |
int
|
Type of data (see DataType enum). |
error |
int
|
Error code (0 for no error). |
readonly |
int
|
Whether the value is read-only. |
readwrite |
int
|
Permission code: 0=read/write, 1=read-only, 2=write-only. |
precision |
float | None
|
Optional precision for numeric values. |
data_type_name |
str
|
BSB-LAN data type name (e.g., "TEMP", "ENUM"). |
data_type_family |
str
|
BSB-LAN data type family (e.g., "VALS", "ENUM"). |
read_write_permission
property
¶
Return explicit permission without treating absent default zeros as proof.
enum_description
property
¶
Get the description for ENUM values.
Returns:
| Type | Description |
|---|---|
str | None
|
str | None: The description of the ENUM value, or None. |
suggested_device_class
property
¶
Suggest HA SensorDeviceClass based on unit and data type.
Only PLAIN_NUMBER data types are considered sensor-like values. Returns None for ENUM, TIME, WEEKDAY, STRING, and other non-numeric types even if they carry a unit.
Returns:
| Type | Description |
|---|---|
str | None
|
str | None: The suggested HA device class (e.g., "temperature", "energy", "power"), or None if no mapping exists or the data type is not numeric. |
suggested_state_class
property
¶
Suggest HA SensorStateClass based on unit and data type.
Only PLAIN_NUMBER data types are considered sensor-like values. Returns None for ENUM, TIME, WEEKDAY, STRING, and other non-numeric types even if they carry a unit.
Energy counters (kWh, MWh, Wh) are mapped to "total_increasing", while other numeric measurements use "measurement".
Returns:
| Type | Description |
|---|---|
str | None
|
str | None: The suggested HA state class (e.g., "measurement", "total_increasing"), or None if the data type is not numeric or no mapping exists. |
convert_raw_value
classmethod
¶
Convert raw string values before pydantic validates types.
BSB-LAN always sends values as strings. This validator converts them to the correct Python type (float, int, time) before pydantic's type checking runs.
Some STRING-type parameters (e.g. "7968 kWh") embed a numeric
value with a unit suffix. When the unit field is empty and
the value matches <number> <known-unit>, the numeric part is
extracted and the unit field is populated automatically.
Source code in src/bsblan/models.py
read_write_permission distinguishes explicit readable/writable (True), denied
or write-only (False), and absent permission metadata (None). Firmware
readwrite codes are 0=read/write, 1=read-only, 2=write-only—not booleans. Missing
fields retain their legacy numeric defaults without granting affirmative proof.
Both permission fields require integer JSON values.
EntityValue¶
Heating¶
State¶
bsblan.State
¶
Bases: BaseModel
Object that holds information about the state of a climate system.
All fields are optional to support partial fetching via the include parameter. When using state() without include, all required parameters will be populated.
StaticState¶
bsblan.StaticState
¶
Bases: BaseModel
Class for entities that are not changing.
Sensor¶
bsblan.Sensor
¶
Bases: BaseModel
Object holds info about object for sensor climate.
Hot water¶
HotWaterState¶
bsblan.HotWaterState
¶
Bases: BaseModel
Essential hot water state information (READ from device).
This class contains only the most important hot water parameters that are typically checked frequently for monitoring purposes.
Note
This is for READING from the device. For WRITING parameters, use SetHotWaterParam with set_hot_water().
HotWaterConfig¶
bsblan.HotWaterConfig
¶
Bases: BaseModel
Hot water configuration and advanced settings (READ from device).
This class contains configuration parameters that are typically set once and checked less frequently.
Note
This is for READING from the device. For WRITING parameters, use SetHotWaterParam with set_hot_water().
SetHotWaterParam¶
bsblan.SetHotWaterParam
dataclass
¶
SetHotWaterParam(
nominal_setpoint: float | None = None,
reduced_setpoint: float | None = None,
nominal_setpoint_max: float | None = None,
operating_mode: str | None = None,
eco_mode_selection: str | None = None,
dhw_charging_priority: str | None = None,
legionella_function_setpoint: float | None = None,
legionella_function_periodicity: str | None = None,
legionella_function_day: str | None = None,
legionella_function_time: str | None = None,
legionella_function_dwelling_time: float | None = None,
operating_mode_changeover: str | None = None,
)
Parameters for setting hot water configuration.
Use this dataclass to pass parameters to set_hot_water(). Only one parameter should be set at a time (BSB-LAN API limitation).
Note
This is for WRITING to the device. For READING hot water data, use HotWaterState or HotWaterConfig. Schedules use bsblan.schedules.
Attributes:
| Name | Type | Description |
|---|---|---|
nominal_setpoint |
float | None
|
The nominal setpoint temperature. |
reduced_setpoint |
float | None
|
The reduced setpoint temperature. |
nominal_setpoint_max |
float | None
|
The maximum nominal setpoint temperature. |
operating_mode |
str | None
|
The operating mode (e.g., "0"=Off, "1"=On). |
eco_mode_selection |
str | None
|
Eco mode selection. |
dhw_charging_priority |
str | None
|
DHW charging priority. |
legionella_function_setpoint |
float | None
|
Legionella function setpoint temperature. |
legionella_function_periodicity |
str | None
|
Legionella function periodicity. |
legionella_function_day |
str | None
|
Day for legionella function. |
legionella_function_time |
str | None
|
Time for legionella function (HH:MM). |
legionella_function_dwelling_time |
float | None
|
Legionella dwelling time (min). |
operating_mode_changeover |
str | None
|
Operating mode changeover. |
Schedules¶
Heating and DHW share immutable observations and a separate partial-update payload. See the migration guide for breaking changes.
ScheduleMapping¶
bsblan.ScheduleMapping
¶
Bases: BaseModel
Independently confirmed weekday IDs for one target and schedule group.
ScheduleMappings¶
bsblan.ScheduleMappings
¶
Bases: BaseModel
Immutable weekday mappings; absent groups contain no mapping assertion.
validate_circuits
classmethod
¶
Normalize canonical JSON IDs without accepting coercion or collisions.
Source code in src/bsblan/schedules.py
freeze_heating
classmethod
¶
Capture a read-only copy, including the empty default collection.
Source code in src/bsblan/schedules.py
serialize_heating
¶
Serialize read-only internals as a normal JSON-compatible mapping.
ScheduleProfileIdentity¶
bsblan.ScheduleProfileIdentity
¶
Bases: BaseModel
Exact installation scope certified by a profile's independent evidence.
require_text
classmethod
¶
Reject absent provenance scope rather than accepting wildcard matches.
Source code in src/bsblan/schedule_profiles.py
ScheduleProfile¶
bsblan.ScheduleProfile
¶
Bases: BaseModel
Weekday mappings and their provenance for exactly one installation scope.
require_text
classmethod
¶
Require an auditable identifier and an evidence reference.
Source code in src/bsblan/schedule_profiles.py
require_mapping
¶
Require certification for at least one schedule group.
Source code in src/bsblan/schedule_profiles.py
ScheduleAvailability¶
bsblan.ScheduleAvailability
¶
ScheduleCandidateProbe¶
bsblan.ScheduleCandidateProbe
¶
Bases: BaseModel
Diagnostic compatibility only; weekday meaning still needs confirmation.
retry_required
property
¶
Return whether missing/inactive/transient data warrants another probe.
A diagnostic candidate is never enabled, even when compatible. Its proposed mapping requires independent active-table/weekday confirmation before use.
See profile evidence and compatibility before adding
profiles. The standard registry includes one narrowly scoped, verified RVS21
entry. ScheduleProfile.table_parameters declares immutable ID/name pairs covering
every mapped ID exactly once; a matching profile can then recognize each group's
active /JC layout without a caller schedule_table assertion.
ScheduleSnapshot¶
bsblan.ScheduleSnapshot
¶
Bases: BaseModel
A fresh immutable observation, not an atomic week or write verification.
retry_required
property
¶
Advise later reads for missing/inactive/possibly transient device data.
validate_week
¶
Require seven ordered days, UTC-compatible time and a valid target.
Source code in src/bsblan/schedules.py
ScheduleDay¶
bsblan.ScheduleDay
¶
Bases: BaseModel
One observed day; unavailable and unsupported text are never clear intent.
validate_status
¶
Keep structured values consistent with the observation status.
Source code in src/bsblan/schedules.py
ScheduleUpdate¶
bsblan.ScheduleUpdate
dataclass
¶
ScheduleUpdate(
monday: DaySchedule | None = None,
tuesday: DaySchedule | None = None,
wednesday: DaySchedule | None = None,
thursday: DaySchedule | None = None,
friday: DaySchedule | None = None,
saturday: DaySchedule | None = None,
sunday: DaySchedule | None = None,
)
A partial update: None leaves a day unchanged, an empty day requests clear.
__post_init__
¶
Reject raw values and defensively copy every populated day.
Source code in src/bsblan/schedules.py
DaySchedule¶
bsblan.DaySchedule
dataclass
¶
Up to three non-overlapping intervals; no slots expresses clear intent.
__post_init__
¶
Validate and defensively copy slots, preserving their order.
Source code in src/bsblan/schedules.py
from_bsblan_format
classmethod
¶
Parse active and disabled physical slots, never inactive entities.
Source code in src/bsblan/schedules.py
to_bsblan_format
¶
Serialize active intervals; a verified clear encoding is not known.
Source code in src/bsblan/schedules.py
TimeSlot¶
bsblan.TimeSlot
dataclass
¶
One naive, minute-precision interval with an exclusive end.
__post_init__
¶
Reject values that would be truncated or misrepresented on the bus.
Source code in src/bsblan/schedules.py
Device¶
Device¶
bsblan.Device
¶
Bases: BaseModel
Object holds bsblan device information.
is_bus_writable
property
¶
Return the gateway default write indicator, not per-parameter permission.
BSB/LPB active-table flags can permit individual parameters even when this indicator is false. PPS still uses a gateway-wide write enable setting.
supports_time_sync
property
¶
Return whether normal BSB/LPB time synchronization is supported.
busdest is optional but strictly integer when present: no coercion of booleans,
floats or numeric strings into a profile identity. Missing/null stays unknown.
is_bus_writable reflects the gateway default indicator. On BSB/LPB it is not an
absolute veto on individual active-table parameters; see
parameter permissions.
ApiVersion¶
bsblan.ApiVersion
¶
Bases: BaseModel
Object holding the BSB-LAN JSON-API version reported by /JV.
This is the JSON-API version (e.g. "2.0"), which is distinct from the
adapter firmware version reported by /JI. It is the documented,
firmware-independent signal used to select a compatible API configuration.
Info¶
bsblan.Info
¶
Bases: BaseModel
Object holding the heatingSystem info.
All fields are optional to support partial fetching via the include parameter.
DeviceTime¶
bsblan.DeviceTime
¶
Bases: BaseModel
Object holds device time information.