Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mealie to HA documentation example code. #3556

Open
6 tasks done
Shredder5262 opened this issue May 3, 2024 · 1 comment
Open
6 tasks done

Update mealie to HA documentation example code. #3556

Shredder5262 opened this issue May 3, 2024 · 1 comment
Labels
bug Something isn't working needs more info

Comments

@Shredder5262
Copy link

Shredder5262 commented May 3, 2024

First Check

  • This is not a feature request.
  • I added a very descriptive title to this issue (title field is above this).
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the Mealie documentation, with the integrated search.
  • I already read the docs and didn't find an answer.
  • This issue can be replicated on the demo site (https://demo.mealie.io/).

What is the issue you are experiencing?

in the documentation page https://docs.mealie.io/documentation/community-guide/home-assistant/ for the example rest api calls listed in home assistant, the existing lines...
value_template: "{{ value_json[0].recipe.name }}"
value_template: "{{ value_json[0].recipe.id }}"

work, but produce an error in the home assistant logs. On my own setup, I changed the lines to

value_template: "{{ value_json[0]['recipe']['name']}}"
value_template: "{{ value_json[0]['recipe']['id']}}"

and so far i get the same result, but no error message in the logs.

Steps to Reproduce

  1. Create a home assistant rest sensor in Configuration.yaml file
  2. paste the mealie rest api call for todays meal
    `#Mealie API Calls
  • platform: rest
    resource: "https://[mealieinstance]/api/groups/mealplans/today"
    method: GET
    name: Mealie todays meal
    headers:
    Authorization: Bearer [token]
    value_template: "{{ value_json[0]['recipe']['name']}}"
    force_update: true
    scan_interval: 30
  • platform: rest
    resource: "https://[mealieinstance]/api/groups/mealplans/today"
    method: GET
    name: Mealie todays meal ID
    headers:
    Authorization: Bearer [token]
    value_template: "{{ value_json[0]['recipe']['id']}}"
    force_update: true
    scan_interval: 30
    `
  1. Validate the yaml configuration and update/restart
  2. you should see the new sensors on the 'states' page that continue to pull in today's meal data
  3. Check logs for errors, there should no longer be an error when the rest api command runs.

Please provide relevant logs

not applicable.

Mealie Version

not applicable.

Deployment

Docker (Windows)

Additional Deployment Details

not applicable.

@Shredder5262 Shredder5262 added bug Something isn't working triage labels May 3, 2024
@boc-the-git
Copy link
Collaborator

@Shredder5262 can you please share the error message you're getting in HA, and what version of HA you're running? (I didn't see the actual error message here or in Discord)
I'm running 2024.4.3, and using the syntax you're saying gives errors, but I haven't seen any in my logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs more info
Projects
None yet
Development

No branches or pull requests

2 participants