Home » Blog » Mealie and Home Assistant – Boost Your Home Approval Factor NOW!

Mealie and Home Assistant – Boost Your Home Approval Factor NOW!

Do you recognize this? You’re very enthusiastic about making your home smart, but your housemates are less pleased with all the automations in the house. But now I’ve found something that can significantly increase the Home Approval Factor with your housemates. Meet Mealie, a fantastic tool to centrally store your recipes. And, of course, you can integrate Mealie into Home Assistant so your housemates can see what’s on the menu every day. Let’s dive in!


⭐⭐⭐ NOTE: ⭐⭐⭐

This article accompanies a YouTube video. I wrote it for people who would rather read than watch a video. To keep doing this, I would like to ask you to also check out the video, leave a comment under the video, give the video a thumbs up, and subscribe to my YouTube channel. This means that the video is offered more often to new visitors so that they also stay informed of the latest Home Assistant tutorials.

Thank you for your support!

Ed

Click here to watch the video

Introduction

In this video, I will show you how to install and use Mealie. Additionally, I’ll demonstrate how to integrate Mealie into Home Assistant. For this tutorial, I am using Docker on my Synology NAS, but you can install it on any server using Docker. Unfortunately, there is currently no Mealie add-on within Home Assistant, so you will need to install Mealie on a different server. In theory, you can also install Mealie on your Home Assistant server. I did that using Portainer, but it made my Home Assistant installation unhealthy, so I reverted back from that setup.

What do you need?

You need a server running Docker. In my case, I use my Synology DS920+ NAS. Make sure you have the Container Manager installed on your Synology NAS. You can do this by going to the Package Center, searching for Container Manager, and installing it.

Now, there are a few things we need to do. First, we need to determine our UID and GID. There are a few ways to find this information, and we will discover it through SSH.

Activate SSH on your server.
  • Go to the interface of your Synology NAS or the server you are using.
  • Click on the menu and navigate to the Control Panel.
  • Click on Terminal & SNMP.
  • Check Enable SSH service.
  • Choose port 22.
  • Click Apply.
  • You will now receive a warning that enabling SSH provides access to your server and should be done cautiously. For now, this is not a problem. You can disable SSH again once we have determined the UID and GID.
  • Click OK.
Retrieve your UID and GID.

SSH is now activated. We can now determine your UID and GID.

  • Open the command prompt or terminal on your Windows or MAC computer.
  • Type: SSH followed by your username used on the server. Type an AT SIGN followed by the IP address of your server. Finally, specify the port. In our case, it is -P22.
  • Enter the password associated with your server username.
  • You will now see that you are logged into your server.
  • Now type id.
  • You will now see the UID and GID. In my case, it is 1026 and 100. Note down these values. You will need them later when we install Mealie.

Installing Mealie

We are going to install Mealie in Docker. If you’ve followed correctly, you should have just installed the Container Manager via the package center. Now, let’s first create a folder where the Mealie data files will be stored.

Creating a Shared Folder
  • Open Control Panel on your Synology NAS.
  • Select Shared Folder.
  • Click Create.
  • Select Create Shared Folder.
  • Give your folder a name, for example, docker.
  • Disable Restrict Access to Administrators Only.
  • Click Next.
  • You can choose to encrypt the shared folder if you wish. I’ll skip it for now.
  • Click Next.
  • Click Next again and click Next to confirm your settings.
  • Verify that the admin user and your account have Read and Write permissions, then click Apply.
  • Your shared docker folder is now created.
  • I had already created this docker folder earlier and will continue to use it in this tutorial.
Creating the Mealie folder

We are now going to create a Mealie folder within this docker folder.

  • Open File Station.
  • Click on the recently created docker folder.
  • Click Create and select Create folder.
  • Create a folder with the name mealie.
  • Open the new mealie folder.
  • Click Create again and select Create folder.
  • Now, create a folder with the name “data.”
Installing Mealie using a script

You now have everything set up to install Mealie. We will proceed by using a script that we’ll invoke through the Task Scheduler.

  • Go to the Control Panel.
  • Select Task Scheduler.
  • Click Create and choose Scheduled Task.
  • Now select User-Defined Script.
  • Give your task a name, for example, “Install Mealie.”
  • Select the root user.
  • Click on the Schedule tab.
  • Choose “Run on the following date.”
  • Now, select the Task Settings tab.
  • You can optionally select “Send run details by email” and enter your email address if you want to receive a notification via email when the installation is completed.
  • Now, enter the following code in the User-Defined Script field:
  • If you want to support my work, you can download this code for the price of a cup of coffee . However, it’s perfectly fine if you prefer to manually transcribe the code from the screen for free.
  • Modify the PUID and PGID in the code to match the UID and GID you obtained earlier via SSH.
  • Also, change the TimeZone to the TimeZone of your country.
  • If you have your domain, you can enter a subdomain as BASE_URL, or you can access Mealie later simply through the IP address of your Docker server.
  • Click OK.
  • Click OK again.
  • Enter the password for the user you use to log in to your Synology NAS.
  • Click Submit.
Running the Script
  • Select Install Mealie and click Run.
  • Click OK.
  • Mealie is now being installed.
  • You can track the progress of the installation in the Container Manager.
  • Click on the Menu icon and select Container Manager.
  • Click Container.
  • Click on Mealie.
  • Select the Log Tab.
  • The installation takes a few minutes. You can refresh the log periodically to check the progress. Along the way, you may encounter a Warning, but you can safely ignore it.
  • Eventually, a green icon will be displayed, indicating that Mealie is Healthy. At this point, Mealie is installed.
Starting Mealie for the first time.

We are now going to start Mealie for the first time. Open a new browser window and type the following URL:

http://192.168.68.139:9925/

Replace the IP address with the IP address of your server or use the subdomain you specified above if you have your domain. Mealie will now open and provide a notification that it’s the first time you are logging in. You can log in with the username: changeme@example.com and the password MyPassword. You can then immediately change this password.

I need your help!

You will be doing me a huge favor if you subscribe to my channel if you haven’t already. And, you help me a lot if you also give this video a thumbs up and leave a comment. This way, YouTube will present this video to new people and that will make the channel grow! In the description of the video, you will also find information about how you can sponsor me so that I can continue to make these tutorials for you.

Thank you!

Using Mealie

Let’s first log in with these credentials. Now that we’re logged in, we will proceed to change the Mealie login credentials.

  • Click on your profile name, initially set to ChangeMe.
  • Then click on Manage User Profile.
  • Here, you can modify your username, full name, and email address.
  • You can also change your password by clicking “Change Password.”
  • And, of course, you can update your profile picture.
  • Now that our profile details are updated, we can start adding recipes. This is incredibly easy because Mealie can import recipes from various recipe sites. Additionally, you can manually enter recipes.
  • Click on Create. You will now see an “Import” option.
  • If you click on it, you can enter the URL of a recipe and import it.
  • For example, I’ll use this recipe from allrecipes.com.
  • Copy the recipe URL and paste it into the Recipe URL field.
  • Click Create.
  • The recipe is now imported into Mealie.
  • Let’s choose another recipe and import it.
  • And let’s import another recipe, this time from a different site in a different language.
  • I have now imported three recipes and can view them in Mealie.
Planning recipes
  • Additionally, I can plan the recipes in the Meal Planner for the entire week.
  • I can even opt for a random recipe so Mealie selects one for me.
  • Another useful feature is the ability to create Shopping Lists. Here, I create a shopping list named Dinner.
  • Now, I can go to a recipe whose ingredients I want to add to the shopping list. Under the menu icon of the recipe, you will find various options, including the option to add the ingredients to a shopping list. You can easily choose which ingredients you want to add. Unfortunately, I haven’t found a way to synchronize this shopping list with Home Assistant yet, but if your Mealie is remotely accessible, you can use this shopping list when you’re at the supermarket.
  • Using the timeline feature, you can see how you use Mealie. I personally rarely use this feature.
  • Furthermore, you can categorize each recipe with categories, tags, and tools so that you can later filter them. You can even automatically assign tags during the recipe import.
  • When editing a recipe, you can select or create a category, tag, or tool. This makes it easy to filter your recipes.

How to integrate Mealie into Home Assistant

Now that you have Mealie up and running, you can start collecting all your recipes from different sites, so you have them centrally stored at home. Additionally, you can display the meal planning in Home Assistant, allowing your housemates to see what’s on the menu tonight. The integration is still a bit limited but setting it up is enjoyable, and it will certainly enhance the Home Approval Factor among your housemates!

Generating an API Token

First, we need to generate an API token in Mealie.

  • Go to your profile.
  • Click on Manage Your API Tokens.
  • Give your API Token a Name, for example, Home Assistant.
  • Click Generate.
  • Select the API Token and copy it to your clipboard.
Adding sensors to Home Assistant
  • Now, go to Home Assistant.
  • We are going to add some YAML code to the sensors.yaml file in Home Assistant. For this, you need the Studio Code Server or File Editor add-on in Home Assistant. If you haven’t installed either of these, do so first via Settings and Add-Ons. Go to the Add-On Store and search for Studio Code Server. Click install to install Studio Code Server. Select Show in Sidebar and start Studio Code server.
  • Now, go to Studio Code Server.
  • Open your configuration.yaml file and check if you see this line in it. If not, add it.
  • Then, open the sensors.yaml file. If it doesn’t exist yet, create it.
  • Add the following two code blocks to the sensors.yaml file. Make sure the URL and port match yours.
  • Replace the API token after Bearer with the API token you just copied to your clipboard.
  • You can type this code from the screen or download it for the cost of a cup of coffee if you want to support my work. The link can be found here. Additionally, you can find this code in the Mealie documentation.
  • Now that you’ve added this code, you need to restart Home Assistant.
  • Go to Developer Tools.
  • Click Check Configuration.
  • If your configuration is okay, click Restart.
  • Click Restart Home Assistant.
  • Click Restart again.
Creating a Generic Camera in Home Assistant
  • Once Home Assistant has restarted, we will create a Generic Camera.
  • Go to Settings > Devices & Services.
  • Click Add Integration.
  • Search for Generic Camera.
  • Click on Generic Camera.
  • Enter the following code in the Still Image field. Ensure the IP address and port match yours.
  • Click Submit.
  • If everything went well, you should now see an image of tonight’s recipe here. If you don’t see an image, check in Mealie if you have a recipe planned for tonight.
  • Select This image looks good and click Submit.
  • Select an Area and click Finish.
  • Now, click on the Generic Camera Integration and click on the camera you just added.
  • Give the camera a readable entity_id and a readable name.
  • Click Update.
Adding the camera to a dashboard in Home Assistant
  • Now, add the camera to a dashboard.
  • Open any dashboard.
  • Click the pencil in the upper right corner.
  • Click Add Card.
  • Search for the Picture Entity Card.
  • Select Mealie today’s meal in the entity field.
  • Enter a meaningful name like Dinner Tonight.
  • Select your generic camera in the Camera entity field.
  • Select the live Camera view radio button.
  • Click Save.
  • Click Done.
  • Your meal of the day is now visible in Home Assistant.

Conclusion

So, now you know how to install Mealie and use it in Home Assistant. I’m very excited about Mealie because I use recipes from various sites, and now I have everything neatly organized in my local environment. My housemates enjoy seeing what we’re going to eat. As a result, they’ve started using the Home Assistant App more frequently and are also using it more to control things like lights. For us, the Home Approval Factor has increased again since we started using Mealie. I’m curious to know if the same will happen to you. Let me know in the comments!

Thanks for watching, and I hope I’ve inspired you to install Mealie yourself. If my work saves you time, consider supporting me monthly, just like these wonderful people do. Unfortunately, the income from YouTube is insufficient to sustain this channel, and I need your financial support to continue this work. Thank you!

Oh, and don’t forget to give this video a thumbs up and subscribe to my channel if you haven’t already. I’ll see you soon in my next video!

Bye Bye!

#homeapproval #mealie #homeassistant #boostyourhome #recipes #synology #nas #docker


,

Back to all articles