This custom Home Assistant integration allows you to view, edit, and add recipes stored in a YAML file (www/recipes.yaml). It works with your custom Lovelace card to dynamically update recipes.
- ✅ Edit existing recipes in
recipes.yaml - ✅ Add new recipes dynamically
- ✅ Home Assistant service integration (
recipes.update_recipe) - ✅ Works with YAML-formatted recipes
- ✅ HACS-compatible 🎉
- Open HACS → Integrations.
- Click the three-dot menu (top-right) → Custom Repositories.
- Enter:
https://github.com/yourusername/ha-recipes - Select Integration as the category.
- Click "Add", then find Recipe Editor in HACS and install it.
- Restart Home Assistant.
- Download the
recipesfolder. - Place it in
/config/custom_components/(final path:/config/custom_components/recipes/). - Restart Home Assistant.
This integration automatically registers a service named recipes.update_recipe, which you can call from Developer Tools → Services or in automations.
Ensure your recipes file exists:
📂 Path: /config/www/recipes.yaml
📄 Example File (recipes.yaml)
recipes:
- id: pasta_bolognese
name: Pasta Bolognese
ingredients:
- 250g pasta
- 200g minced beef
- 1 can tomato sauce
instructions: Cook pasta, then add beef and sauce.Use the recipes.update_recipe service to modify a recipe.
service: recipes.update_recipe
data:
recipe_id: pasta_bolognese
new_yaml: |
name: Pasta Bolognese
ingredients:
- 250g pasta
- 200g minced beef
- 1 can tomato sauce
- 1 onion (chopped)
instructions: Cook pasta, sauté onion, then add beef and sauce.If recipe_id does not exist, a new recipe is added.
service: recipes.update_recipe
data:
recipe_id: chicken_soup
new_yaml: |
name: Chicken Soup
ingredients:
- 1 whole chicken
- 2 carrots
- 1 onion
instructions: Boil chicken with vegetables until tender.If your Lovelace card supports editing, you can trigger this service dynamically when a user submits changes.
Automatically add a recipe when a certain event occurs:
alias: Add Chicken Soup Recipe on Trigger
trigger:
- platform: event
event_type: homeassistant_start
action:
- service: recipes.update_recipe
data:
recipe_id: chicken_soup
new_yaml: |
name: Chicken Soup
ingredients:
- 1 whole chicken
- 2 carrots
- 1 onion
instructions: Boil chicken with vegetables until tender.Feel free to open an issue or pull request if you have improvements!
- Your Name
- GitHub: @yourgithubusername
This project is licensed under the MIT License.