Mealie in HA

Hi thx again :slight_smile:

1 Like

If you use the code from above, I think I remember, there was a typo or such a thing (itā€™s been a whileā€¦). If it doesnā€™t work on your first try, please report back, than Iā€™ll have a look at my file/automation. :slight_smile:

1 Like

Edit: with version 2024.8.1 ths issue underneath is fixed! :slight_smile: :+1:


If someone is using this, there is an issue in 2024.8.0 regarding REST sensors, so this will not work for now (the sensor setup is blocked).

For what I read on the issue, it should be solved in 2024.8.1.

The issue is here, and the PR is here. :slight_smile:

Thanks for this @my.spider.died. This is awesome.

It would not go well with the wife if she was adding recipes/items to the shopping list in Mealie while the automation is running. Items would disappear in the process. She would think she did something wrong and add them again. They would end up in HA multiple times.

My lovelace tab has

type: vertical-stack
cards:
  - type: entities
    entities:
      - entity: automation.mealie_transfer_shopping_list
  - type: todo-list
    entity: todo.grocery

Giving


After explaining to her that she can add items in Mealie or in HA, she is loving it. Before heading to the store, she has to turn on the automation so it will do the transfers.

Then, I have the following automation that turns off the Transfer Shopping List Automation when we get ā€˜Empty Listā€™.

alias: Mealie - Turn Off Transfer Automation
description: When the list is empty, turn off the transfer automation
trigger:
  - platform: state
    entity_id:
      - sensor.mealie_shopping_list_items
    to: Empty List
condition: []
action:
  - action: homeassistant.turn_off
    target:
      entity_id: automation.mealie_transfer_shopping_list
    data: {}
mode: single
1 Like

Glad itā€™s working so well for you @jeffcrum! :slight_smile:

Since writing the guide above, an official Mealie integration has been added in Home Assistant 2024.7, which includes a todo-list entity for each Mealie shopping list you have - Iā€™d recommend using that going forward as a more reliable approach to getting the data into Home Assistant from Mealie, rather than the rest sensor solution I documented before. (I havenā€™t tried this myself yet though!)

But then you can still use the ā€œTransfer Shopping Listā€ automation to move it to another list if needed. :slight_smile:

1 Like

Well, of course it has been added. I am always behind the times. LOL!

Glad it was added officially. But, as the saying goes ā€¦ If it ainā€™t broke ā€¦ blah blah blah.

1 Like

Hi

Iā€™ve set up Mealie before, using the old way:
Iā€™ve set up multiple rest sensors for mealie todays meal id and todays meal name

  • for every day0 ,1,2,3,4,5 and 6 i have 2 rest sensors for name and date

Should i get rid of that and use somehow the new integration?

However, i have this in my dashboard

type: vertical-stack
        cards:
          - show_state: true
            show_name: true
            camera_view: auto
            type: picture-entity
            entity: sensor.mealie_todays_meal
            camera_image: camera.mealie_recepten
            name: Lunch
            tap_action:
              action: navigate
              navigation_path: /lovelace-dashboard/mealie
          - type: markdown
            content: |-
              <table>
              {% for i in range(7) %}
                {% set index = i|string %}
                {% set meal_date = states("sensor.mealie_day" + index + "_date") %}
                {% set meal_name = states("sensor.mealie_day" + index + "_name") %}
                {% if meal_date != 'unknown' %}
                <tr>

                  {{ ['zo','ma','di','wo','do','vr','za'][strptime(meal_date, "%Y-%m-%d").weekday()] }}  {{ meal_name }}
                
                {% endif %}
              {% endfor %}
              </table>
            card_mod:
            style:
              ha-markdown:
                $: |
                  a { 
                    all:unset; 
                    color:white ! important;
                    cursor: pointer ! important;
                  }  

Should i adjust the dashboard?
Would love to hear what to do now.
Thx

FYI: Mealie version 2.0.0 is released and has breaking API endpoint changes.
For example /groups/mealplans is now /households/mealplans

You can read more about the changes at feat: Add Households to Mealie by michael-genson Ā· Pull Request #3970 Ā· mealie-recipes/mealie Ā· GitHub

I updated my blog post, about the HA week- and day meal integration (without the HACS module), with the required changes for this current latest version.

1 Like

I finally got tired of the ā€˜imported item unavailableā€™ error message that would appear after restarting HA and having to delete all the messages as a result of restarting so I came back to this thread to see if anything could be done and found that there is now a mealie integration. Iā€™ve only been using it for a few hours but WOW! what a breath of fresh air that is in comparison to doing it the old way. Nice job!

1 Like

I had some problems with mealie and i started over.
I installed the HA OS addon mealie
This is using ingress now
To reach the webui i enter http://x.x.x.x:8123/hassio/ingress/db21ed7f_mealie
In HA i added the integration and i need to fill in that url + api-token
if i do so, i get unexpected error
What am i doing wrong?

The ingress URL wonā€™t work with API calls, which the integration uses.
Use the direct http://x.x.x.x:port
The port is in the configuration page of the mealie add on.

Yes it works thx

What i also would like to doā€¦
Is it possible to have a button in the addon so i can cast the recipe to one of my google hub speaker?

That wouldnā€™t be possible directly as the add-on is just a shell around Mealie which doesnā€™t directly know about Home Assistant.
You could maybe do something with a script
Get todayā€™s meal
Then using this Action to get the details of the recipe and cast it
Thereā€™s a lot of data in a recipe so youā€™d have to parse that suitable for speech.

Its not intended to do for speech.
I just want to read that page on my hub which is in the kitchen.
I could cast the mealie dashboardā€¦
But where to put a button for that.

Ah, as you can tell Iā€™m not that familiar with Google Hubs so afraid Iā€™m not much help there.

That s ok.
You dont need to tell me how i should cast.
Im just thinking about ideas where to put such button

I want to cast a mealie recipe to google hub.
I come from a long way.
I use mealie as an addon in HA
First thing to do , before able to cast it, it had to be https
Mealie in home assistant is http

So i had to create reverse proxy using nginx managerā€¦ Then create a subdomain in cloudflare, and setup a reverse proxy in nginx manager + ssl certificate
Then i had to open 2 ports on my unifi setup
Now i can reach it from https
Next i created a button in home assistant to start a script where i start casting to a google home hub in my kitchen
This works
I can now see mealie on my hub, + i can even scroll in mealie
However
Before getting in mealie, i need to log in mealie
And there im stuck.
Cause when i set my cursor in my user field (or even password field) , i dont get a keyboard to type, so i cant log in
Stuck here
Really looking forward for a solution for this

Casting from phone is not a good idea cause you cant scroll on the hub
Who can help so i can type in or something?