{"record":{"id":"ca07d3fe2bee765e","repo":"home-assistant/core","slug":"invalid-device-id-ca07d3","errorCode":"invalid_device_id","errorMessage":"Invalid device ID: {device_id}","messagePattern":"Invalid device ID: (.+?)","errorType":"validation","errorClass":"ServiceValidationError","httpStatus":null,"severity":"warning","filePath":"homeassistant/components/bsblan/services.py","lineNumber":135,"sourceCode":"    modify that day.\n    \"\"\"\n    return {\n        day_name: _convert_time_slots_to_day_schedule(service_call.data.get(attr_name))\n        for day_name, attr_name in _DAY_NAME_SLOT_ATTR_PAIRS\n    }\n\n\ndef _resolve_config_entry(\n    service_call: ServiceCall,\n) -> tuple[BSBLanConfigEntry, dr.DeviceEntry]:\n    \"\"\"Resolve device_id from a service call into a loaded BSBLAN config entry.\"\"\"\n    device_id: str = service_call.data[ATTR_DEVICE_ID]\n\n    device_registry = dr.async_get(service_call.hass)\n    device_entry = device_registry.async_get(device_id, include_child_devices=False)\n\n    if device_entry is None:\n        raise ServiceValidationError(\n            translation_domain=DOMAIN,\n            translation_key=\"invalid_device_id\",\n            translation_placeholders={\"device_id\": device_id},\n        )\n\n    # Find the config entry for this device\n    matching_entries: list[BSBLanConfigEntry] = [\n        entry\n        for entry in service_call.hass.config_entries.async_entries(DOMAIN)\n        if entry.entry_id in device_entry.config_entries\n    ]\n\n    if not matching_entries:\n        raise ServiceValidationError(\n            translation_domain=DOMAIN,\n            translation_key=\"no_config_entry_for_device\",\n            translation_placeholders={\"device_id\": device_entry.name or device_id},\n        )","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/bsblan/services.py#L117-L153","documentation":"ServiceValidationError raised when resolving a `device_id` passed to a bsblan service/action: the device registry lookup (`async_get(device_id, include_child_devices=False)`) returns None, meaning no device with that exact ID exists (or only a parent of a child device matches, since child devices are excluded). Translation key `invalid_device_id` includes the offending ID.","triggerScenarios":"Calling a bsblan action (set_hot_water_schedule, sync_time) with a stale, typo'd, or parent-device `device_id`, e.g. one copied from an old automation after the device was re-added and got a new registry ID.","commonSituations":"Devices removed and re-discovered (new device_id), automations/scripts with hardcoded old IDs, passing the hub/controller device instead of the sub-device, or YAML authoring with fabricated IDs.","solutions":["Re-pick the device in the action's device selector UI, which only offers valid current devices.","Update hardcoded device_id values in automations/scripts after re-adding an integration.","Find the current ID via Developer Tools > States or the device registry (include_child_devices=False means you must target the exact sub-device)."],"exampleFix":"// before\naction: bsblan.set_hot_water_schedule\ndata: {device_id: \"0a1b2c3d OLD_STALE_ID\"}\n// after — use the current device id from Developer Tools > States\naction: bsblan.set_hot_water_schedule\ndata: {device_id: \"9f8e7d6cCURRENT_ID\"}","handlingStrategy":"validation","validationCode":"# in Developer Tools > Template, verify the id resolves to a device\n{{ device_id | string in device_entities or (devices | selectattr('id','equalto',device_id) | list | length > 0) }}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pick devices through the action UI selector rather than typing IDs.","After re-adding an integration, sweep automations for hardcoded device_ids.","Target the exact sub-device, not a parent (child devices are excluded from the lookup)."],"tags":["home-assistant","bsblan","device-id","validation","service-action"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}