custom-components / grocy

Custom Grocy integration for Home Assistant
Apache License 2.0
164 stars 50 forks source link

entities are unavailable since update #290

Open collateral87 opened 1 year ago

collateral87 commented 1 year ago

Describe the bug I have updated to Grocy 4.0.3 via Grocy Add-on 0.20.0 and since than, all my entities in this integration are unavailable. The integration itself is loading and the logs are clean.

Expected behavior Entities are unavailable

To Reproduce Updated to Grocy 4.0.3 via Grocy Addon 0.20.0

What is your installed versions of Home Assistant, Grocy and this integration? Homeassistant: 2023.9.2 Grocy: 4.0.3 Integration: 4.11.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?

grafik

grzech1983 commented 1 year ago

On my end logs show error:

Error fetching grocy data: Update failed: 2 validation errors for ProductDetailsResponse quantity_unit_stock -> name_plural none is not an allowed value (type=type_error.none.not_allowed) default_quantity_unit_purchase -> name_plural none is not an allowed value (type=type_error.none.not_allowed)

excalbian commented 1 year ago

In my case the error was similar, but different: Error fetching grocy data: Update failed: 1 validation error for BatteryDetailsResponse battery -> description none is not an allowed value (type=type_error.none.not_allowed). I looked, and the one test battery I have defined doesn't have a description, so I set one and the integration loaded correctly 👍.

What I'm not sure of is where there is a disconnect. Why is there validation asserting that the description (and other fields) can't be none when Grocy is allowing those values not to be set?

shbatm commented 1 year ago

I have a similar error:

Error fetching grocy data: Update failed: 1 validation error for BatteryDetailsResponse battery -> used_in none is not an allowed value (type=type_error.none.not_allowed)
XingLii commented 1 year ago

Probably one aswell since update - similar to shbatm but for MealPlanSectionResponse; ERROR (MainThread) [custom_components.grocy.coordinator] Error fetching grocy data: Update failed: 1 validation error for MealPlanSectionResponse name none is not an allowed value (type=type_error.none.not_allowed)

trunks403 commented 1 year ago

I have the same problem after i update to Grocy Addon 0.20.0, Does anybody if its possible to downgrade addon ?

saya6k commented 1 year ago

I have the same problem after i update to Grocy Addon 0.20.0, Does anybody if its possible to downgrade addon ?

I did downgrade to version 0.19.1, and now custom components works fine.

trunks403 commented 1 year ago

@saya6k, can you please explain to me how to downgrade many thanks

saya6k commented 1 year ago

@saya6k, can you please explain to me how to downgrade many thanks

Settings > System > Backups

I restored with partial backup named 'addon_a0d7b954_grocy_0.19.1'. If you did partial backup while upgrade, you can find this.

trunks403 commented 1 year ago

Thanks, ! That worked !

collateral87 commented 1 year ago

Any news on this issue? Does this regards every 0.20.0 addon Installation and is there a fix except of downgrading?

(Thank you for this nice and helpful integration)

Brouwertje commented 1 year ago

I fixed it by creating a section first. (name it food by example) When you create your mealplan, also add the created section to the meal for that day and the mealplan card works.

You can create a section at mealplan > Configure sections (top right)

collateral87 commented 1 year ago

Thank you for your help. My log says Error fetching grocy data: Update failed: 2 validation errors for ProductDetailsResponse quantity_unit_stock -> name_plural none is not an allowed value (type=type_error.none.not_allowed) default_quantity_unit_purchase -> name_plural none is not an allowed value (type=type_error.none.not_allowed). I have no idea how can i fix this.

sudoxnym commented 1 year ago

Hello, I am having a similar issue. I'm in the process of getting the logger going right now, but on my install I was able to narrow down the issue. Try disabling Meal Plan again (default state). After about 30-45 seconds it reloads and everything else works. Will update with logs asap.

Edit: I have the config set up for logger. I am unsure of where to go to view these logs though.

larsmartinx commented 1 year ago

Hello, I am having a similar issue. I'm in the process of getting the logger going right now, but on my install I was able to narrow down the issue. Try disabling Meal Plan again (default state). After about 30-45 seconds it reloads and everything else works. Will update with logs asap.

Edit: I have the config set up for logger. I am unsure of where to go to view these logs though.

When you say "disable Meal plan", how do you do this? I can't see any "Meal plan" in the Add-on configuration. I just installed the latest version as my first install a few days ago, and the only entity I get is update.grocy_update

karwosts commented 1 year ago

and the only entity I get is update.grocy_update

IIRC most of the entities are disabled by default, do you have any sensors you can enable on the integration page?

sudoxnym commented 1 year ago

image

This is where I am disabling it after enabling it. When you first install the integration all of the sensors are disabled.

larsmartinx commented 1 year ago

Hmm, there might be more things confusing me here. My add-on works (i can open the web UI in the Sidebar, I can add chores and recipes etc), but when installing the integration I'm asked for a URL, API key and port number. The API key I can find from the Grocy add-on, but what url and port do you use when it's running in a Home Assistant add-on? I thought running Grocy as an add-on with the Ingress thing removed the need for url and port in the config (sorry for mixing this question into the open issue case)

BottlecapDave commented 1 year ago

I just came across this issue too. I was also getting the error name_plural none is not an allowed value. The cause was that I had some quantity units that didn't have the Name in plural form field set. Once I set these, the integration started working again.

saschaludwig commented 1 year ago

I just came across this issue too. I was also getting the error name_plural none is not an allowed value. The cause was that I had some quantity units that didn't have the Name in plural form field set. Once I set these, the integration started working again.

I can confirm that! I also had quantities without plural form and that will break the integration.