Бытовая техника¶
KettleEntity¶
Умный чайник: управление температурой нагрева.
Sber Kettle entity -- maps HA water_heater entities to Sber kettle category.
Supports on/off control, water temperature reading, and target temperature setting.
KETTLE_CATEGORY
module-attribute
¶
Sber device category for kettle entities.
KettleEntity
¶
Bases: BaseEntity
Sber kettle entity for smart kettle devices.
Maps HA water_heater entities to the Sber 'kettle' category with support for: - On/off control - Current water temperature reading - Target temperature setting (60-100, step 10) - Child lock (read-only from HA attributes) - Water level and low water level indicators
Initialize kettle entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity_data
|
dict
|
HA entity registry dict containing entity metadata. |
required |
Source code in custom_components/sber_mqtt_bridge/devices/kettle.py
fill_by_ha_state
¶
Parse HA state and update kettle attributes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ha_state
|
dict
|
HA state dict with 'state' and 'attributes' keys. |
required |
Source code in custom_components/sber_mqtt_bridge/devices/kettle.py
create_features_list
¶
Return Sber feature list for kettle capabilities.
Returns:
| Type | Description |
|---|---|
list[str]
|
List of Sber feature strings supported by this entity. |
Source code in custom_components/sber_mqtt_bridge/devices/kettle.py
create_allowed_values_list
¶
Build allowed values map for temperature setting.
Returns:
| Type | Description |
|---|---|
dict[str, dict]
|
Dict mapping feature key to its allowed INTEGER values descriptor. |
Source code in custom_components/sber_mqtt_bridge/devices/kettle.py
to_sber_current_state
¶
Build Sber current state payload with kettle attributes.
Returns:
| Type | Description |
|---|---|
dict[str, dict]
|
Dict mapping entity_id to its Sber state representation. |
Source code in custom_components/sber_mqtt_bridge/devices/kettle.py
process_cmd
¶
Process Sber kettle commands and produce HA service calls.
Handles the following Sber keys:
- on_off: turn_on / turn_off (domain auto-detected from entity_id)
- kitchen_water_temperature_set: water_heater.set_temperature
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cmd_data
|
dict
|
Sber command dict with 'states' list. |
required |
Returns:
| Type | Description |
|---|---|
list[dict]
|
List of HA service call dicts to execute. |
Source code in custom_components/sber_mqtt_bridge/devices/kettle.py
VacuumCleanerEntity¶
Робот-пылесос: режимы уборки, управление.
Sber Vacuum Cleaner entity -- maps HA vacuum entities to Sber vacuum_cleaner category.
Supports start/stop/pause/return_to_base commands, status reporting, cleaning program (fan speed), and battery level.
VACUUM_CLEANER_CATEGORY
module-attribute
¶
Sber device category for vacuum cleaner entities.
VacuumCleanerEntity
¶
Bases: BaseEntity
Sber vacuum cleaner entity for robot vacuum devices.
Maps HA vacuum entities to the Sber 'vacuum_cleaner' category with support for: - Start/stop/pause/return_to_base commands - Status reporting (cleaning, charging, docked, returning, error, paused) - Cleaning program (fan speed) - Battery percentage
Initialize vacuum cleaner entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity_data
|
dict
|
HA entity registry dict containing entity metadata. |
required |
Source code in custom_components/sber_mqtt_bridge/devices/vacuum_cleaner.py
fill_by_ha_state
¶
Parse HA state and update vacuum cleaner attributes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ha_state
|
dict
|
HA state dict with 'state' and 'attributes' keys. |
required |
Source code in custom_components/sber_mqtt_bridge/devices/vacuum_cleaner.py
create_features_list
¶
Return Sber feature list for vacuum capabilities.
Returns:
| Type | Description |
|---|---|
list[str]
|
List of Sber feature strings supported by this entity. |
Source code in custom_components/sber_mqtt_bridge/devices/vacuum_cleaner.py
create_allowed_values_list
¶
Build allowed values map for vacuum features.
Returns:
| Type | Description |
|---|---|
dict[str, dict]
|
Dict mapping feature key to its allowed ENUM values descriptor. |
Source code in custom_components/sber_mqtt_bridge/devices/vacuum_cleaner.py
to_sber_current_state
¶
Build Sber current state payload with vacuum attributes.
Returns:
| Type | Description |
|---|---|
dict[str, dict]
|
Dict mapping entity_id to its Sber state representation. |
Source code in custom_components/sber_mqtt_bridge/devices/vacuum_cleaner.py
process_cmd
¶
Process Sber vacuum commands and produce HA service calls.
Handles the following Sber keys:
- vacuum_cleaner_command: start/stop/pause/return_to_base
- vacuum_cleaner_program: vacuum.set_fan_speed
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cmd_data
|
dict
|
Sber command dict with 'states' list. |
required |
Returns:
| Type | Description |
|---|---|
list[dict]
|
List of HA service call dicts to execute. |
Source code in custom_components/sber_mqtt_bridge/devices/vacuum_cleaner.py
HumidifierEntity¶
Увлажнитель воздуха.
Sber Humidifier entity -- maps HA humidifier entities to Sber hvac_humidifier.
HUMIDIFIER_CATEGORY
module-attribute
¶
Sber device category for humidifier entities.
HA_TO_SBER_HUMIDIFIER_MODE
module-attribute
¶
HA_TO_SBER_HUMIDIFIER_MODE = {'auto': 'auto', 'low': 'low', 'mid': 'medium', 'medium': 'medium', 'high': 'high', 'silent': 'quiet', 'sleep': 'quiet', 'night': 'quiet', 'strong': 'turbo', 'boost': 'turbo'}
Map HA humidifier modes to Sber-standard enum values (case-insensitive lookup).
HumidifierEntity
¶
Bases: BaseEntity
Sber humidifier entity for humidity control devices.
Maps HA humidifier entities to the Sber 'hvac_humidifier' category with support for: - On/off control - Target humidity setting - Work mode selection (when supported by the device)
Initialize humidifier entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity_data
|
dict
|
HA entity registry dict containing entity metadata. |
required |
Source code in custom_components/sber_mqtt_bridge/devices/humidifier.py
fill_by_ha_state
¶
Parse HA state and update all humidifier attributes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ha_state
|
dict
|
HA state dict with 'state' and 'attributes' keys. Attributes may include humidity, current_humidity, available_modes, and mode. |
required |
Source code in custom_components/sber_mqtt_bridge/devices/humidifier.py
update_linked_data
¶
Inject current humidity from a linked sensor entity.
When the HA humidifier entity does not provide current_humidity
in its attributes, an external humidity sensor can be linked to
supply the value for the Sber humidity feature.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
role
|
str
|
Link role name (only |
required |
ha_state
|
dict
|
HA state dict with 'state' containing the reading. |
required |
Source code in custom_components/sber_mqtt_bridge/devices/humidifier.py
create_features_list
¶
Return Sber feature list based on available humidifier capabilities.
Dynamically includes work mode and night mode features only when the HA entity supports them.
Returns:
| Type | Description |
|---|---|
list[str]
|
List of Sber feature strings supported by this entity. |
Source code in custom_components/sber_mqtt_bridge/devices/humidifier.py
create_allowed_values_list
¶
Build allowed values map for enum-based and integer-based features.
Returns:
| Type | Description |
|---|---|
dict[str, dict]
|
Dict mapping feature key to its allowed values descriptor. |
Source code in custom_components/sber_mqtt_bridge/devices/humidifier.py
to_sber_current_state
¶
Build Sber current state payload with humidifier attributes.
Includes online, on_off, target humidity, work mode, and night mode when values are available.
Per Sber C2C specification, integer_value is serialized as a string.
Returns:
| Type | Description |
|---|---|
dict[str, dict]
|
Dict mapping entity_id to its Sber state representation. |
Source code in custom_components/sber_mqtt_bridge/devices/humidifier.py
process_cmd
¶
Process Sber humidifier commands and produce HA service calls.
Handles the following Sber keys:
- on_off: turn_on / turn_off
- humidity: set_humidity (INTEGER 0-100, plain percentage)
- hvac_work_mode: set_mode (ENUM)
- hvac_night_mode: set_mode to sleep/normal (BOOL)
State is NOT mutated here -- it will be updated when HA fires a
state_changed event that is handled by fill_by_ha_state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cmd_data
|
dict
|
Sber command dict with 'states' list. |
required |
Returns:
| Type | Description |
|---|---|
list[dict]
|
List of HA service call dicts to execute. |
Source code in custom_components/sber_mqtt_bridge/devices/humidifier.py
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | |