{"record":{"id":"bc7ff715ef073e42","repo":"home-assistant/core","slug":"not-a-water-heater-device","errorCode":"not_a_water_heater_device","errorMessage":"The selected device ({device_name}) is not a water heater. Please select the water heater sub-device.","messagePattern":"The selected device \\((.+?)\\) is not a water heater\\. Please select the water heater sub-device\\.","errorType":"validation","errorClass":"ServiceValidationError","httpStatus":null,"severity":"warning","filePath":"homeassistant/components/bsblan/services.py","lineNumber":178,"sourceCode":"            translation_domain=DOMAIN,\n            translation_key=\"config_entry_not_loaded\",\n            translation_placeholders={\"device_name\": device_entry.name or device_id},\n        )\n\n    return entry, device_entry\n\n\ndef _device_name(device_entry: dr.DeviceEntry) -> str:\n    \"\"\"Return the best available display name for a device.\"\"\"\n    return device_entry.name_by_user or device_entry.name or device_entry.id\n\n\ndef _ensure_water_heater_device(device_entry: dr.DeviceEntry) -> None:\n    \"\"\"Validate the service targets the water heater sub-device.\"\"\"\n    for domain, identifier in device_entry.identifiers:\n        if domain == DOMAIN and identifier.endswith(\"-water-heater\"):\n            return\n    raise ServiceValidationError(\n        translation_domain=DOMAIN,\n        translation_key=\"not_a_water_heater_device\",\n        translation_placeholders={\"device_name\": _device_name(device_entry)},\n    )\n\n\nasync def set_hot_water_schedule(service_call: ServiceCall) -> None:\n    \"\"\"Set hot water heating schedule.\"\"\"\n    entry, device_entry = _resolve_config_entry(service_call)\n    _ensure_water_heater_device(device_entry)\n    client = entry.runtime_data.client\n\n    days = _build_weekly_schedule_days(service_call)\n    dhw_schedule = DHWSchedule(**days)\n\n    LOGGER.debug(\"Setting hot water schedule: %s\", dhw_schedule)\n\n    try:","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/bsblan/services.py#L160-L196","documentation":"ServiceValidationError raised by `_ensure_water_heater_device` when the bsblan device passed to `set_hot_water_schedule` is not the water-heater sub-device. The check requires an identifier of the form `{something}-water-heater` in the domain-bsblan identifiers; the main controller device or a circuit device fails it. Translation key `not_a_water_heater_device` names the device.","triggerScenarios":"Calling `bsblan.set_hot_water_schedule` with the top-level BSB-LAN controller device (or a heating-circuit device) instead of the dedicated water heater sub-device created for DHW.","commonSituations":"Users selecting the 'BSB-LAN Controller' device in the picker or in YAML because it is the most prominent one; homes without a DHW circuit where no water-heater sub-device exists at all.","solutions":["Select the sub-device literally named/labeled as the water heater (identifier ending in `-water-heater`).","In YAML, confirm the device's identifiers via Developer Tools > Template before hardcoding.","If no water-heater sub-device exists, the boiler has no DHW circuit exposed — this action cannot be used."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"# template: confirm the chosen device is the water heater sub-device\n{{ device_attr(device_id, 'identifiers') | select('match', 'bsblan:.*-water-heater$') | list | length > 0 }}","typeGuard":"def is_water_heater_device(device_entry: dr.DeviceEntry) -> bool:\n    return any(\n        domain == \"bsblan\" and identifier.endswith(\"-water-heater\")\n        for domain, identifier in device_entry.identifiers\n    )","tryCatchPattern":null,"preventionTips":["Select the sub-device named 'water heater' in the picker, not the controller device.","Check identifiers in Developer Tools before hardcoding a device_id.","If no water-heater sub-device exists, the boiler exposes no DHW — don't use this action."],"tags":["home-assistant","bsblan","water-heater","device-id","validation"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}