custom-components / grocy

Custom Grocy integration for Home Assistant
Apache License 2.0
156 stars 47 forks source link

Grocy component appears to be connecting but not seeing chores (Entity unavailable) #220

Closed dinki closed 2 years ago

dinki commented 2 years ago

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

Describe the bug I am running Grocy via docker on port 8100. I am only using it for chores. I do have chores assigned and I can pull data via api (curl). Grocy component appears to be connecting but not seeing chores (Entity unavailable).

 curl --insecure -X 'GET'   'http://192.168.0.25:8100/api/chores'   -H 'accept: application/json' -H 'GROCY-API-KEY: XXXXXXXXXXXXXXX'

Expected behavior Populate the chores sensor

To Reproduce Set up component. Enter http://192.168.0.25 for server, 8100 for port and valid API token used with curl command above

General information to help debugging:

Enabled debug logging and do not see any errors

What is your installed versions of Home Assistant, Grocy and this integration? HASS 2022.5.5 Grocy v4.2.2b

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

Have you added debugging to the log, and what does the log say? I do not see any errors

2022-05-28 15:55:19 INFO (MainThread) [homeassistant.setup] Setting up grocy
2022-05-28 15:55:19 INFO (MainThread) [homeassistant.setup] Setup of domain grocy took 0.0 seconds
2022-05-28 15:55:19 INFO (MainThread) [custom_components.grocy]
Grocy
https://github.com/custom-components/grocy/issues
2022-05-28 15:55:19 DEBUG (MainThread) [pygrocy.grocy_api_client] generated base url: http://192.168.0.25:8100/api/
2022-05-28 15:55:19 DEBUG (SyncWorker_8) [pygrocy.grocy_api_client] --> GET //api/system/config
2022-05-28 15:55:19 DEBUG (SyncWorker_8) [pygrocy.grocy_api_client] <-- 200 for //api/system/config
2022-05-28 15:55:19 DEBUG (SyncWorker_8) [pygrocy.grocy_api_client] b'{"MODE":"production","DEFAULT_LOCALE":"en","CALENDAR_FIRST_DAY_OF_WEEK":"","CALENDAR_SHOW_WEEK_OF_YEAR":true,"MEAL_PLAN_FIRST_DAY_OF_WEEK":"","CURRENCY":"USD","BASE_PATH":"","BASE_URL":"\\/","STOCK_BARCODE_LOOKUP_PLUGIN":"DemoBarcodeLookupPlugin","DISABLE_URL_REWRITING":false,"ENTRY_PAGE":"stock","DISABLE_AUTH":false,"AUTH_CLASS":"Grocy\\\\Middleware\\\\DefaultAuthMiddleware","REVERSE_PROXY_AUTH_HEADER":"REMOTE_USER","REVERSE_PROXY_AUTH_USE_ENV":false,"LDAP_ADDRESS":"","LDAP_BASE_DN":"","LDAP_BIND_DN":"","LDAP_BIND_PW":"","LDAP_USER_FILTER":"","LDAP_UID_ATTR":"","DEFAULT_PERMISSIONS":["ADMIN"],"GROCYCODE_TYPE":"1D","LABEL_PRINTER_WEBHOOK":"","LABEL_PRINTER_RUN_SERVER":true,"LABEL_PRINTER_PARAMS":{"font_family":"Source Sans Pro (Regular)"},"LABEL_PRINTER_HOOK_JSON":false,"TPRINTER_IS_NETWORK_PRINTER":false,"TPRINTER_PRINT_QUANTITY_NAME":true,"TPRINTER_PRINT_NOTES":true,"TPRINTER_IP":"127.0.0.1","TPRINTER_PORT":9100,"TPRINTER_CONNECTOR":"\\/dev\\/usb\\/lp0","FEATURE_FLAG_STOCK":true,"FEATURE_FLAG_SHOPPINGLIST":true,"FEATURE_FLAG_RECIPES":true,"FEATURE_FLAG_CHORES":true,"FEATURE_FLAG_TASKS":true,"FEATURE_FLAG_BATTERIES":true,"FEATURE_FLAG_EQUIPMENT":true,"FEATURE_FLAG_CALENDAR":true,"FEATURE_FLAG_LABEL_PRINTER":false,"FEATURE_FLAG_STOCK_PRICE_TRACKING":true,"FEATURE_FLAG_STOCK_LOCATION_TRACKING":true,"FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING":true,"FEATURE_FLAG_STOCK_PRODUCT_OPENED_TRACKING":true,"FEATURE_FLAG_STOCK_PRODUCT_FREEZING":true,"FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_FIELD_NUMBER_PAD":true,"FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS":true,"FEATURE_FLAG_CHORES_ASSIGNMENTS":true,"FEATURE_FLAG_THERMAL_PRINTER":false,"FEATURE_FLAG_DISABLE_BROWSER_BARCODE_CAMERA_SCANNING":false,"FEATURE_FLAG_AUTO_TORCH_ON_WITH_CAMERA":true,"USER_USERNAME":"Dinki","USER_PICTURE_FILE_NAME":null,"LOCALE":"en"}'
2022-05-28 15:55:19 DEBUG (MainThread) [custom_components.grocy] Finished fetching grocy data in 0.592 seconds (success: True)
2022-05-28 15:55:20 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.grocy
2022-05-28 15:55:20 DEBUG (MainThread) [custom_components.grocy.binary_sensor] Adding GrocyEntityType.EXPIRED_PRODUCTS binary sensor
2022-05-28 15:55:20 DEBUG (MainThread) [custom_components.grocy.binary_sensor] Adding GrocyEntityType.EXPIRING_PRODUCTS binary sensor
2022-05-28 15:55:20 DEBUG (MainThread) [custom_components.grocy.binary_sensor] Adding GrocyEntityType.MISSING_PRODUCTS binary sensor
2022-05-28 15:55:20 DEBUG (MainThread) [custom_components.grocy.binary_sensor] Adding GrocyEntityType.OVERDUE_CHORES binary sensor
2022-05-28 15:55:20 DEBUG (MainThread) [custom_components.grocy.binary_sensor] Adding GrocyEntityType.OVERDUE_TASKS binary sensor
2022-05-28 15:55:20 DEBUG (SyncWorker_2) [pygrocy.grocy_api_client] --> GET //api/system/config
2022-05-28 15:55:20 DEBUG (SyncWorker_2) [pygrocy.grocy_api_client] <-- 200 for //api/system/config
2022-05-28 15:55:20 DEBUG (SyncWorker_2) [pygrocy.grocy_api_client] b'{"MODE":"production","DEFAULT_LOCALE":"en","CALENDAR_FIRST_DAY_OF_WEEK":"","CALENDAR_SHOW_WEEK_OF_YEAR":true,"MEAL_PLAN_FIRST_DAY_OF_WEEK":"","CURRENCY":"USD","BASE_PATH":"","BASE_URL":"\\/","STOCK_BARCODE_LOOKUP_PLUGIN":"DemoBarcodeLookupPlugin","DISABLE_URL_REWRITING":false,"ENTRY_PAGE":"stock","DISABLE_AUTH":false,"AUTH_CLASS":"Grocy\\\\Middleware\\\\DefaultAuthMiddleware","REVERSE_PROXY_AUTH_HEADER":"REMOTE_USER","REVERSE_PROXY_AUTH_USE_ENV":false,"LDAP_ADDRESS":"","LDAP_BASE_DN":"","LDAP_BIND_DN":"","LDAP_BIND_PW":"","LDAP_USER_FILTER":"","LDAP_UID_ATTR":"","DEFAULT_PERMISSIONS":["ADMIN"],"GROCYCODE_TYPE":"1D","LABEL_PRINTER_WEBHOOK":"","LABEL_PRINTER_RUN_SERVER":true,"LABEL_PRINTER_PARAMS":{"font_family":"Source Sans Pro (Regular)"},"LABEL_PRINTER_HOOK_JSON":false,"TPRINTER_IS_NETWORK_PRINTER":false,"TPRINTER_PRINT_QUANTITY_NAME":true,"TPRINTER_PRINT_NOTES":true,"TPRINTER_IP":"127.0.0.1","TPRINTER_PORT":9100,"TPRINTER_CONNECTOR":"\\/dev\\/usb\\/lp0","FEATURE_FLAG_STOCK":true,"FEATURE_FLAG_SHOPPINGLIST":true,"FEATURE_FLAG_RECIPES":true,"FEATURE_FLAG_CHORES":true,"FEATURE_FLAG_TASKS":true,"FEATURE_FLAG_BATTERIES":true,"FEATURE_FLAG_EQUIPMENT":true,"FEATURE_FLAG_CALENDAR":true,"FEATURE_FLAG_LABEL_PRINTER":false,"FEATURE_FLAG_STOCK_PRICE_TRACKING":true,"FEATURE_FLAG_STOCK_LOCATION_TRACKING":true,"FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING":true,"FEATURE_FLAG_STOCK_PRODUCT_OPENED_TRACKING":true,"FEATURE_FLAG_STOCK_PRODUCT_FREEZING":true,"FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_FIELD_NUMBER_PAD":true,"FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS":true,"FEATURE_FLAG_CHORES_ASSIGNMENTS":true,"FEATURE_FLAG_THERMAL_PRINTER":false,"FEATURE_FLAG_DISABLE_BROWSER_BARCODE_CAMERA_SCANNING":false,"FEATURE_FLAG_AUTO_TORCH_ON_WITH_CAMERA":true,"USER_USERNAME":"Dinki","USER_PICTURE_FILE_NAME":null,"LOCALE":"en"}'
2022-05-28 15:55:20 DEBUG (SyncWorker_2) [pygrocy.grocy_api_client] --> GET /system/db-changed-time
2022-05-28 15:55:20 DEBUG (SyncWorker_2) [pygrocy.grocy_api_client] <-- 200 for /system/db-changed-time
2022-05-28 15:55:20 DEBUG (SyncWorker_2) [pygrocy.grocy_api_client] b'{"changed_time":"2022-05-28 15:49:40"}'
2022-05-28 15:55:20 DEBUG (SyncWorker_6) [pygrocy.grocy_api_client] --> GET /stock/volatile
2022-05-28 15:55:20 DEBUG (SyncWorker_6) [pygrocy.grocy_api_client] <-- 200 for /stock/volatile
2022-05-28 15:55:20 DEBUG (SyncWorker_6) [pygrocy.grocy_api_client] b'{"due_products":[],"overdue_products":[],"expired_products":[],"missing_products":[]}'
2022-05-28 15:55:20 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.grocy
2022-05-28 15:55:20 DEBUG (MainThread) [custom_components.grocy] Finished fetching grocy data in 0.614 seconds (success: True)
2022-05-28 15:55:20 DEBUG (MainThread) [custom_components.grocy.sensor] Adding GrocyEntityType.CHORES sensor
2022-05-28 15:55:20 DEBUG (MainThread) [custom_components.grocy.sensor] Adding GrocyEntityType.MEAL_PLAN sensor
2022-05-28 15:55:20 DEBUG (MainThread) [custom_components.grocy.sensor] Adding GrocyEntityType.SHOPPING_LIST sensor
2022-05-28 15:55:20 DEBUG (MainThread) [custom_components.grocy.sensor] Adding GrocyEntityType.STOCK sensor
2022-05-28 15:55:20 DEBUG (MainThread) [custom_components.grocy.sensor] Adding GrocyEntityType.TASKS sensor
2022-05-28 15:55:31 DEBUG (SyncWorker_7) [pygrocy.grocy_api_client] --> GET //api/system/config
2022-05-28 15:55:31 DEBUG (SyncWorker_7) [pygrocy.grocy_api_client] <-- 200 for //api/system/config
2022-05-28 15:55:31 DEBUG (SyncWorker_7) [pygrocy.grocy_api_client] b'{"MODE":"production","DEFAULT_LOCALE":"en","CALENDAR_FIRST_DAY_OF_WEEK":"","CALENDAR_SHOW_WEEK_OF_YEAR":true,"MEAL_PLAN_FIRST_DAY_OF_WEEK":"","CURRENCY":"USD","BASE_PATH":"","BASE_URL":"\\/","STOCK_BARCODE_LOOKUP_PLUGIN":"DemoBarcodeLookupPlugin","DISABLE_URL_REWRITING":false,"ENTRY_PAGE":"stock","DISABLE_AUTH":false,"AUTH_CLASS":"Grocy\\\\Middleware\\\\DefaultAuthMiddleware","REVERSE_PROXY_AUTH_HEADER":"REMOTE_USER","REVERSE_PROXY_AUTH_USE_ENV":false,"LDAP_ADDRESS":"","LDAP_BASE_DN":"","LDAP_BIND_DN":"","LDAP_BIND_PW":"","LDAP_USER_FILTER":"","LDAP_UID_ATTR":"","DEFAULT_PERMISSIONS":["ADMIN"],"GROCYCODE_TYPE":"1D","LABEL_PRINTER_WEBHOOK":"","LABEL_PRINTER_RUN_SERVER":true,"LABEL_PRINTER_PARAMS":{"font_family":"Source Sans Pro (Regular)"},"LABEL_PRINTER_HOOK_JSON":false,"TPRINTER_IS_NETWORK_PRINTER":false,"TPRINTER_PRINT_QUANTITY_NAME":true,"TPRINTER_PRINT_NOTES":true,"TPRINTER_IP":"127.0.0.1","TPRINTER_PORT":9100,"TPRINTER_CONNECTOR":"\\/dev\\/usb\\/lp0","FEATURE_FLAG_STOCK":true,"FEATURE_FLAG_SHOPPINGLIST":true,"FEATURE_FLAG_RECIPES":true,"FEATURE_FLAG_CHORES":true,"FEATURE_FLAG_TASKS":true,"FEATURE_FLAG_BATTERIES":true,"FEATURE_FLAG_EQUIPMENT":true,"FEATURE_FLAG_CALENDAR":true,"FEATURE_FLAG_LABEL_PRINTER":false,"FEATURE_FLAG_STOCK_PRICE_TRACKING":true,"FEATURE_FLAG_STOCK_LOCATION_TRACKING":true,"FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING":true,"FEATURE_FLAG_STOCK_PRODUCT_OPENED_TRACKING":true,"FEATURE_FLAG_STOCK_PRODUCT_FREEZING":true,"FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_FIELD_NUMBER_PAD":true,"FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS":true,"FEATURE_FLAG_CHORES_ASSIGNMENTS":true,"FEATURE_FLAG_THERMAL_PRINTER":false,"FEATURE_FLAG_DISABLE_BROWSER_BARCODE_CAMERA_SCANNING":false,"FEATURE_FLAG_AUTO_TORCH_ON_WITH_CAMERA":true,"USER_USERNAME":"Dinki","USER_PICTURE_FILE_NAME":null,"LOCALE":"en"}'
2022-05-28 15:55:31 DEBUG (MainThread) [custom_components.grocy] Finished fetching grocy data in 0.927 seconds (success: True)

JSON service data (if related to using a service) N/A

{

}

Additional context Add any other context about the problem here.

isabellaalstrom commented 2 years ago

Still the same problem? I find that it takes a while after first enabling the sensor for the data to show up.

dinki commented 2 years ago

@isabellaalstrom Unfortunately still nothing. I've tried with LAN IP as well as reverse proxy with port set to 443. Neither provide anything usable. Just entities that are unavailable. I should expect to see an error if the connection wasn't made, right?

Thanks for the help

marcelvriend commented 2 years ago

Can you try again with beta v4.3.1b?

And did you enable the Grocy entities in HA manually? They are disabled by default. Make sure to restart HA after enabling them. Your debug log looks like they are still disabled. The restart of HA is no longer needed with #218 (which will be part of the next release).

dinki commented 2 years ago

@marcelvriend I am quite embarassed. I have been using HA for many years and this is the first time I've run into a component that did not default the entities as enabled. I did read the instructions but despite that I did not make the connection. I have gone in and enabled the chores entities. They are now showing up but they are still undefined. I would guess that is what @isabellaalstrom was speaking to so I will give it time for them to populate.

Thank you both for the help. A kind suggestion would be to make the docs a little more explicit for folks like me who may also overlook.

dinki commented 2 years ago

Confirmed working with 4.3.1b . Thanks to you both!