Mastering Smart Pantry Management: Integrating Grocy with Home Assistant
- #home_assistant
- #grocy
- #pantry
- #inventory
- #integration
- #hacs
- #automation
- #smart_home

Introduction: Why Integrate Grocy with Home Assistant?
Managing a household involves keeping track of groceries, cleaning supplies, tools, chores, and more. Grocy is a self-hosted web application that helps with all of this—inventory tracking, shopping lists, meal planning, chores, tasks, even managing a car fleet or library.
While Grocy is powerful on its own, integrating it with Home Assistant brings added value through automation and visibility in your smart home ecosystem.
Benefits of Integration
By integrating Grocy into Home Assistant, you can:
Get notifications for items nearing expiration (reduce food waste)
Automatically add items to shopping lists when stock runs low
Display inventory, shopping lists, and chores on dashboards
Trigger automations based on stock levels or tasks (e.g., play reminders)
Combine inventory data with other sensors (e.g., temperature/humidity)
This transforms Grocy from a passive tracker into an active component of your smart home.
Prerequisites
Before starting, make sure you have the following:
Grocy Instance: Installed (e.g., via Docker or web server) and accessible on your network.
Home Assistant: Running and configured (OS, Container, Supervised, etc.).
HACS (Home Assistant Community Store): Required to install the Grocy integration.
💡 If HACS isn't installed, follow the official documentation to add it first.
Grocy Setup: Generating an API Key
The Home Assistant integration communicates with Grocy via its API.
Log in to your Grocy instance.
Go to Settings (gear icon).
Find the API Keys section.
Click Add, name it (e.g., “Home Assistant”), and save.
Copy the API key immediately (you won’t see it again).
🔐 Keep this key safe, like a password.
Home Assistant Integration Setup (via HACS)
Assuming HACS is installed:
In Home Assistant, open HACS > Integrations.
Click the + button.
Search for Grocy.
Choose the “Grocy” integration (typically by hassio-addons
).
Click Download, select a version, then Download again.
Restart Home Assistant after download.
After restarting:
Go to Settings > Devices & Services.
Click + Add Integration.
Search for Grocy.
Enter your Grocy URL and API key.
Submit. If successful, Home Assistant adds Grocy entities.
Understanding Grocy Entities in Home Assistant
The integration exposes sensors such as:
sensor.grocy_expired_products
: Products past expiration
sensor.grocy_expiring_products
: Products expiring soon
sensor.grocy_missing_products
: Products below min stock
sensor.grocy_shopping_list
: Items on the shopping list
sensor.grocy_overdue_chores
: Chores past due date
sensor.grocy_due_soon_chores
: Chores due soon
sensor.grocy_overdue_tasks
: Overdue tasks
sensor.grocy_due_soon_tasks
: Tasks due soon
Each sensor also includes attributes with detailed data (e.g., item names, quantities), which are especially useful for dashboards and automations.
Using Grocy Data in Home Assistant
Dashboards
1. Basic Sensor Display
Use the standard Entities card to show raw sensor values (e.g., "Expiring Products: 3").
2. List Display (Markdown Card)
Use a Markdown card with Jinja2 templating to show item names.
Example (Expiring Products):

NGC 224
Author bio: