Mealie smart home integration, free and open source

Your Mealie meal plan and shopping lists in Gladys: menus, scenes and widgets.
Mealie is a self-hosted recipe manager: your recipes, a meal plan for the week and shared shopping lists. This integration brings it into Gladys: one device shows today's and tomorrow's meals, the number of recipes and the items left to buy on each list; scenes can add an item to a list ("the milk is finished"), check one, plan a recipe, or send the menu of the day; two dashboard widgets show the menu and a shopping list, with buttons to add, check and plan from the wall tablet.
Tested against real Mealie 2.0.0 and 3.28 servers; not yet on a real Gladys installation: feedback welcome on the issues.
What you need
- Gladys Assistant 5.2.0 or later.
- Mealie 2.0 or later (Mealie 1.x has no household API), reachable from the Gladys machine: on the local network, or on the Internet in HTTPS.
- An API token of a Mealie user. It acts with the rights of that user, on the meal plan and the shopping lists of that user's household.
Getting started
1. Create an API token
In Mealie, click your avatar, open your profile, then API Tokens. Give
the token a name (for example Gladys) and click Generate. Copy the token:
Mealie shows it only once.
2. Configure the integration
In Gladys, Integrations → Mealie → Configuration:
- Mealie address: the address you open Mealie with, port included, for
example
http://192.168.1.2:9925orhttps://mealie.example.com. An address copied from the browser (…/g/home/recipes) works too. - API token: the token of step 1.
- Accept self-signed certificates: only for an
https://address whose certificate your browser does not trust either. - Refresh interval: how often Mealie is read, 5 minutes by default (1 to 15 minutes). What you do from Gladys shows at once.
- Language of the names and messages: the language of the feature names and of the texts of the scene actions (French by default).
Save, then click Test the connection: Mealie answers with its version, its household and what it holds.
3. Add the device
In Integrations → Mealie → Discover, add the Mealie device. Its values appear at once. When a shopping list is created in Mealie, the device offers Update in the Discover tab: its counter is added then.
The Mealie device
One device per Mealie household (the household of the token's user). Its features:
| Feature | Type | Value |
|---|---|---|
Breakfast today | Text | The recipes (or notes) of the meal plan, or "Nothing planned" |
Lunch today | Text | Same |
Dinner today | Text | Same |
Breakfast tomorrow | Text | Same, for tomorrow |
Lunch tomorrow | Text | Same |
Dinner tomorrow | Text | Same |
Recipes | Counter | Number of recipes in Mealie |
To buy: <list> | Counter | Items still to buy on each shopping list (unchecked) |
Two recipes for one meal show as Quiche lorraine · Salad. "Today" follows the
time zone of Gladys: right after midnight, tomorrow's meals become today's.
The names are given in the language of the configuration when the device is
added, and stay as they are then (a Gladys rule).
Dashboard widgets
In Dashboard → Edit dashboard, add a widget of the Mealie integration.
Meal plan
- Period: Today: the date and one row per meal of the day (breakfast, lunch, dinner, side, snack, drink, dessert).
- Period: Next 7 days: one row per day, today and tomorrow marked; tap a day to see its meals.
- Plan opens a short form (recipe, day, meal) and puts the recipe in the Mealie meal plan. An empty recipe lets Mealie pick one at random (its meal plan rules apply). The same recipe already planned for the same meal is not added twice.
- Refresh reads Mealie again.
- Open Mealie opens the meal planner, when Mealie has an
https://address (Gladys opens no other links).
Shopping list
The items still to buy on one list (setting Shopping list: its name in Mealie; empty: the first list created), with their quantity and note.
- Add opens a form with one field, Item: typed as it should read on the list. An item already on the list (upper case, accents and plural aside) is not added twice.
- Check opens a form listing the items: the chosen one is checked in Mealie, as in its app (unchecking it there undoes it).
- Refresh reads Mealie again.
- Open Mealie opens the list, when Mealie has an
https://address.
Scenes
Actions
| Action | Fields | Results |
|---|---|---|
| Add to the shopping list | Item, Shopping list (empty: the first) | Item added (yes/no), Item, list, items to buy |
| Check a shopping list item | Item, Shopping list | Item checked (yes/no), Item, list, items to buy |
| Add a recipe to the meal plan | Recipe (empty: random), Day, Meal | Recipe added (yes/no), Recipe, Date |
| Get the meals of a day | Day (today, tomorrow, day after tomorrow) | Breakfast, Lunch, Dinner, every meal of the day, meals planned |
| Get a shopping list | Shopping list | Items to buy (comma separated), number, list |
- An item is found the way you say it:
oeufsfindsŒufs,tomatoesfindsTomato. A list is found by its name, or by its beginning (grocforGroceries). - A recipe is found by its name or part of it, like the Mealie search box.
- An item already on the list is not added again: the result Item added is then "no". An item not on the list is not an error: Item checked is "no".
- The results go into the next actions of the scene, for example a message
Tonight: {{0.0.dinner}}(0.0: the position of the action in the scene; the message editor lists the results). - The meals snack, drink and dessert need Mealie 3.7 or later; an older Mealie knows breakfast, lunch, dinner and side.
Triggers
None. What changes in Mealie (a meal planned, a list growing) is a state of
the device: a scene starts on a change of To buy: Groceries or of
Dinner today with the usual "device state" trigger.
Scene ideas
- "The milk is finished": a button (or a voice assistant) runs Add to the
shopping list with
Milk. - The menu in the morning: every day at 7:30, Get the meals of a day
(today), then send
Lunch: {{0.0.lunch}}, dinner: {{0.0.dinner}}on Telegram. - On the way to the shops: when someone leaves work, Get a shopping list, then send its items if there are some.
- No dinner planned yet: at 17:00, if
Dinner todayis "Nothing planned", Add a recipe to the meal plan with no recipe (Mealie picks one), then announce it.
Refresh and use of the Mealie API
The integration reads Mealie on its own timer (Gladys does not poll it), at the interval of the configuration, and right after midnight. One reading is four requests: the meal plan of the next seven days, the shopping lists, the items to buy of every list (one request), the statistics; "who am I" (version and household) is read again once an hour. Mealie sets no API quota. A scene action or a widget reads Mealie again when the last reading is older than 30 seconds; what the integration changes is read again at once.
Only the values that change are sent to Gladys, and every value again every 6 hours.
Troubleshooting
- "API token refused": the token was deleted or belongs to another Mealie. Create a new one (step 1).
- "Mealie does not answer": check the address and the port from the
Gladys machine (
http://<address>:9925/api/app/aboutmust answer). The device badge then shows "unreachable", and its values stay the last ones read. - "certificate refused": tick Accept self-signed certificates, or use
the
http://address on the local network. - "Mealie 2.0 or later is needed": update Mealie.
- "no Mealie at this address": the address answers with another web page (a reverse proxy login page…). Use the address of Mealie itself.
- A list has no counter: open the Discover tab and click Update on the Mealie device.
- More details: set the
LOG_LEVELenvironment variable todebug; the logs never contain the API token.
Limits
- One Mealie household per integration: the household of the token's user.
- The device shows breakfast, lunch and dinner of today and tomorrow; the other meals (side, snack, drink, dessert) and the rest of the week are in the widget and in Get the meals of a day.
- Items are added as free text (Mealie does not parse their quantity), and are never deleted: checked items stay in Mealie until you clear them there.
- The Check form lists the first 50 items; the widget shows 7 items and the number of the others.
- Open Mealie appears only for an
https://address. - Not tested on a real Gladys installation yet; tested against real Mealie 2.0.0 and 3.28 servers.
Configuration settings
These are the settings Mealie asks for in its configuration screen in Gladys.
| Setting | Type | Required | Description |
|---|---|---|---|
| Your Mealie | section | No | In Mealie, open your profile, then API Tokens, generate a token and paste it below with the address of Mealie. Then add the Mealie device from the Discover tab. |
| Mealie address | string | Yes | The address you open Mealie with, port included (9925 by default with Docker). |
| API token | secret | Yes | Created in Mealie: profile → API Tokens → Generate. It acts with the rights of your user. |
| Accept self-signed certificates | boolean | No | Only for an https:// address whose certificate your browser does not trust either. |
| Refresh interval | select | No | How often Mealie is read. Gladys' own changes show at once. |
| Language of the names and messages | select | No | Names of the features (set when the device is added) and texts of the scene actions. |
How to install Mealie in Gladys
- In Gladys, open Integrations: Mealie appears in the catalog, next to the native integrations, with a community badge.
- Click Install. Gladys pulls the Docker image (
ghcr.io/guim31/gladys-mealie:1.0.1), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration). - Open the Configuration screen of the integration, fill in the settings, and save.
- You can also install it directly from its repository URL: https://github.com/guim31/gladys-mealie.
Mealie requires Gladys >=5.2.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.
Not running Gladys yet? It is free and open source: follow the installation guide to get started.
About external integrations
Mealie is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by guim31, not by the Gladys core team.
- Browse all integrations, native and community
- Build and publish your own external integration
- Source code on GitHub — source of this documentation