grocy icon indicating copy to clipboard operation
grocy copied to clipboard

Enabling meal plan makes sensors unavailable.

Open bditter opened this issue 1 year ago • 4 comments

Unless all relevant information is provided, I can't help you

Describe the bug Enabling the Meal Plan sensor causes any other enabled sensor to become unavailable.

Expected behavior All sensor displaying the relevant information.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Grocy integration'
  2. Click on Enable Meal Plan sensor
  3. Wait for 30-45 seconds.
  4. Any enabled sensors will become availiable.

General information to help debugging:

**What sensors do you have enabled? Are they working and/or what state are they in? Do you have the corresponding functions enabled in Grocy? Stock and Meal Plan

What is your installed versions of Home Assistant, Grocy and this integration?

**How do you have Grocy installed? Add-on or external? Add-On

Have you added debugging to the log, and what does the log say? This error originated from a custom integration.

Logger: custom_components.grocy.coordinator Source: helpers/update_coordinator.py:386 integration: Grocy (documentation, issues) First occurred: 11:38:19 AM (5 occurrences) Last logged: 12:21:16 PM

Error fetching grocy data: Update failed: 1 validation error for MealPlanSectionResponse name none is not an allowed value (type=type_error.none.not_allowed)

JSON service data (if related to using a service)

{

}

Additional context If you disable the Meal Plan sensor after 30-40 seconds or forcing a reload. All remaining enabled sensors will return to normal.

bditter avatar Sep 13 '24 16:09 bditter

Found a workaround, the issue is that the name for the section is blank. Go to Grocy and then configure section button in the top right.

Then add a section, example "Dinner" and make sure to move all meals from the default blank/unnamed section into a named section. Reload the integration and then it no longer crashes. grocy

mazetar avatar Oct 06 '24 16:10 mazetar

There is a validation error with the upstream library (https://github.com/flipper/pygrocy2/pull/2) there is a PR to fix this.

cliffordwhansen avatar Jan 05 '25 19:01 cliffordwhansen

Please test again there was a PR #323 which should fix this issue

Grocy Component Version: 2025.1.1

cliffordwhansen avatar Jan 09 '25 11:01 cliffordwhansen

btw this is also linked to this https://github.com/custom-components/grocy/issues/285

AlesZurek avatar Jan 26 '25 09:01 AlesZurek