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

Activating meal plan sensor crashes the component #325

Open
Calhendren opened this issue Jan 15, 2025 · 2 comments
Open

Activating meal plan sensor crashes the component #325

Calhendren opened this issue Jan 15, 2025 · 2 comments

Comments

@Calhendren
Copy link

Describe the bug
Activating the Meal Plan sensor will render all the sensors unavailable.

Expected behavior
Sensor should become unavailable, not crash others

To Reproduce
Steps to reproduce the behavior:

  1. Go to Grocy Custom Component
  2. Activate sensors including Meal Plan
  3. Wait 30 seconds
  4. All sensors will be marked as unavailable.

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?
I have tried not enabling the Meal Plan sensor and it works properly. It used to work before the pygrocy2 update, don't know if it's related or not.

What is your installed versions of Home Assistant, Grocy and this integration?
Home Assistant : 2025.1.2
Grocy : 4.3.0
Integration : 2025.1.1

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?
Here are the logs : home-assistant_grocy_2025-01-14T14-38-53.log

Additional context
I have tried debugging the issue myself, as I understand that it comes from the fact that product_qu_id should be a string, not an integer, and I've noticed it happens everytime I input a PRODUCT instead of a Recipe in the Meal Plan. Maybe it's something else, but maybe this will help ?

Kind regards,

@Calhendren
Copy link
Author

Update:
Removing "product" entries from the Meal Plan will make the sensor custom component work again.

@Bovive
Copy link

Bovive commented Feb 3, 2025

Happened to me too. Adding a product to a meal plan in Grocy will crash the HA component. Removing the product and restarting the component goes back to normal. This is my log error:

This error originated from a custom integration.

Logger: custom_components.grocy.coordinator
Source: helpers/update_coordinator.py:411
integration: Grocy (documentation, issues)
First occurred: 5:08:22 AM (2 occurrences)
Last logged: 9:58:53 AM

Error fetching grocy data: Update failed: 1 validation error for MealPlanResponse product_qu_id Input should be a valid string [type=string_type, input_value=24, input_type=int] For further information visit https://errors.pydantic.dev/2.10/v/string_type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants