Hi everyone. I used to have a fully functional Mealie integration. Since Mealie upgraded to version 1.0 their API changed quite excessively. Now my integration is broken.
sensor:
- platform: rest
resource: https://SCRUBBED/api/groups/mealplans/today
method: GET
name: Aandete vanaand
headers:
Authorization: Bearer SCRUBBED
#value_template: '{{ value_json.recipe.name | default }}'
value_template: '{{ value_json.recipe | default }}'
scan_interval: 300
json_attributes:
- slug
- name
If I go to developer tools and input the following:
{% set value_json = {
"date":"2023-07-11","entryType":"dinner","title":"","text":"","recipeId":"6ebd3831-8e33-47c2-b747-0dfca86df4aa","id":1,"groupId":"25bc5258-d60e-4a1b-a526-e664dd65d9cb","userId":"b3b8b456-b62b-4a60-9956-917a152d3c0b","recipe":{"id":"6ebd3831-8e33-47c2-b747-0dfca86df4aa","userId":"542307e7-0480-4145-a500-cbe55fc96e3e","groupId":"25bc5258-d60e-4a1b-a526-e664dd65d9cb","name":"Egg Fried Rice","slug":"egg-fried-rice","image":"egg-fried-rice","recipeYield":"4 serving(s)","totalTime":"15 Minutes","prepTime":"10 Minutes","cookTime":null,"performTime":"5 Minutes","description":"","recipeCategory":[{"id":"6f344325-a30b-4632-a016-7f81e306dc72","name":"Vinnige Aandete","slug":"vinnige-aandete"}],"tags":[],"tools":[],"rating":null,"orgURL":"https://www.foodnetwork.com/recipes/egg-fried-rice-2104339","dateAdded":"2023-01-09","dateUpdated":"2023-07-11T08:40:55.613456","createdAt":"2023-07-11T08:40:55.617002","updateAt":"2023-07-11T08:40:55.617017","lastMade":null}
} %}
{{ value_json.recipe.name }}
then I get the correct output, in this case “Egg Fried Rice”.
Without the default
part in my value_template
, I get warnings in my logs. With it in there, there are no errors and the thing is, HA actually gets the whole json back from Mealie.
What I would love to do is to have the name displayed in HA on an entity card. I used to have the picture being pulled through as well, but Mealie changed the location of the picture of the recipe, and now I will need more complex requests to get the picture entity of the recipe for the dish of today.
Later on it would be really cool if I can pull the recipe into HA as well to have that displayed. Then I don’t have to go to other locations, and can access everything inside HA itself.
Could someone please tell me what I am doing wrong? Why am I not seeing the name on my entity card for my sensor? It is just empty.