{"record":{"id":"2497e7ab89f4f820","repo":"home-assistant/core","slug":"notify-missing-argument","errorCode":null,"errorMessage":"notify_missing_argument","messagePattern":"notify_missing_argument","errorType":"validation","errorClass":"ServiceValidationError","httpStatus":null,"severity":"warning","filePath":"homeassistant/components/bring/todo.py","lineNumber":257,"sourceCode":"\n        await self.coordinator.async_refresh()\n\n    async def async_send_message(\n        self,\n        message: BringNotificationType,\n        item: str | None = None,\n    ) -> None:\n        \"\"\"Send a push notification to members of a shared bring list.\"\"\"\n\n        try:\n            await self.coordinator.bring.notify(self._list_uuid, message, item or None)\n        except BringRequestException as e:\n            raise HomeAssistantError(\n                translation_domain=DOMAIN,\n                translation_key=\"notify_request_failed\",\n            ) from e\n        except ValueError as e:\n            raise ServiceValidationError(\n                translation_domain=DOMAIN,\n                translation_key=\"notify_missing_argument\",\n                translation_placeholders={\"field\": \"item\"},\n            ) from e\n","sourceCodeStart":239,"sourceCodeEnd":262,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/bring/todo.py#L239-L262","documentation":"Raised as ServiceValidationError when coordinator.bring.notify() raises ValueError, which the bring-api library does when the chosen BringNotificationType requires an item argument but none was supplied. It is a user-input error, not a network error: the service call is invalid before any request is made.","triggerScenarios":"Sending a notification type such as URGENT_MESSAGE (or any type flagged as requiring an item) with item=None. The library's notify(list_uuid, message, None) validates arguments and raises ValueError, which the integration maps to notify_missing_argument with field 'item'.","commonSituations":"Automations or scripts calling notification types that reference a product, forgetting the optional item field; UI integrations that omit the text parameter.","solutions":["Supply the item text (e.g. the product name) when calling notification types that require it.","Check the bring-api BringNotificationType enum docs/source for which types have ITEM required semantics.","If you do not want to reference a product, switch to a notification type that does not need an item."],"exampleFix":"// before\nawait todo_list.async_send_message(BringNotificationType.URGENT_MESSAGE)\n\n// after\nawait todo_list.async_send_message(BringNotificationType.URGENT_MESSAGE, item=\"Milk\")","handlingStrategy":"validation","validationCode":"def notification_needs_item(message: BringNotificationType) -> bool:\n    \"\"\"Return True for notification types whose API contract requires an item.\"\"\"\n    return message in _ITEM_REQUIRED_TYPES  # e.g. {BringNotificationType.URGENT_MESSAGE}\n\nif notification_needs_item(message) and not item:\n    raise ValueError(\"This notification type requires an item\")","typeGuard":"def is_item_message(message: BringNotificationType) -> bool:\n    \"\"\"Narrow to notification types that carry a product reference.\"\"\"\n    return message.value in _ITEM_REQUIRED_VALUES","tryCatchPattern":"try:\n    await todo_list.async_send_message(message, item)\nexcept ServiceValidationError as err:\n    if err.translation_key == \"notify_missing_argument\":\n        item = item or default_product\n        await todo_list.async_send_message(message, item)\n    else:\n        raise","preventionTips":["Check the BringNotificationType enum semantics before choosing a type.","Default the item argument in scripts/automations so user-visible errors never occur.","Treat ServiceValidationError as fixable input, not as a transient failure to retry."],"tags":["home-assistant","bring","validation","user-input"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}