anrolosia / shopping-list-with-grocy Goto Github PK
View Code? Open in Web Editor NEWA Shopping list integration with Grocy for Home Assistant
License: MIT License
A Shopping list integration with Grocy for Home Assistant
License: MIT License
What exactly have i to put into the form fields?
No matter what i fill in i get an error.
I used real IP addresses (192.168...) for grocy + mqtt, api key and mqtt user
There is a checkbox with no name.
But the integration stays red .
Logger: custom_components.shopping_list_with_grocy
Source: custom_components/shopping_list_with_grocy/apis/shopping_list_with_grocy.py:323
Integration: Shopping List with Grocy (documentation, issues)
First occurred: 11:13:28 (157 occurrences)
Last logged: 14:49:55
Unexpected error fetching None data: [Errno -2] Name does not resolve
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 225, in _async_refresh
self.data = await self._async_update_data()
File "/config/custom_components/shopping_list_with_grocy/__init__.py", line 158, in _async_update_data
return await self.api.retrieve_data()
File "/config/custom_components/shopping_list_with_grocy/apis/shopping_list_with_grocy.py", line 420, in retrieve_data
await self.update_refreshing_status("ON")
File "/config/custom_components/shopping_list_with_grocy/apis/shopping_list_with_grocy.py", line 323, in update_refreshing_status
self.client.connect(self.mqtt_server, self.mqtt_port)
File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 914, in connect
return self.reconnect()
File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 1044, in reconnect
sock = self._create_socket_connection()
File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection
return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
File "/usr/local/lib/python3.10/socket.py", line 824, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/local/lib/python3.10/socket.py", line 955, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name does not resolve
Logger: homeassistant.config_entries
Source: config_entries.py:807
First occurred: 14:37:07 (4 occurrences)
Last logged: 14:48:40
Config entry 'ShoppingListWithGrocy' for shopping_list_with_grocy integration not ready yet: [Errno -2] Name does not resolve; Retrying in background
Config entry 'ShoppingListWithGrocy' for shopping_list_with_grocy integration not ready yet: 'ascii' codec can't encode character '\xe4' in position 29: ordinal not in range(128); Retrying in background
Config entry 'ShoppingListWithGrocy' for shopping_list_with_grocy integration not ready yet: Cannot connect to host 192.168.1.222:102 ssl:default [Connect call failed ('192.168.1.222', 102)]; Retrying in background```
'\xe4' means ä
I'm getting a "Failed setup, will retry" message after attempting to configure the addon.
The full message from the system log is:
Config entry 'ShoppingListWithGrocy' for shopping_list_with_grocy integration not ready yet: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain', url=URL('xxx/api/system/db-changed-time'); Retrying in background');
I've removed the full path to my installation. My installation of Grocy was added via Home Assistances Ingress add-ons rather than a standalone installation.
Hi!
Is there a way to separate the items into the different shoppinglists it is possible to create in Grocy with this addon? In my installation i can not see that any of the sensors include witch shopping list the item is on?
I have 8 different lists today, so having all in one in HA makes this pretty much unusable for me.
I hope i have not missed anything obvious and thanks for all the hard work!
/Anders
I am getting this error when trying to add the integration. The message "Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble" comes up instead of starting the configuration. Grocy is the addon version.
Logger: aiohttp.server
Source: custom_components/shopping_list_with_grocy/config_flow.py:134
Integration: Shopping List with Grocy (documentation, issues)
First occurred: 10:46:19 AM (1 occurrences)
Last logged: 10:46:19 AM
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 67, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 234, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 146, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 148, in post
return await super().post(request)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
result = await method(view, request, data, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 71, in post
result = await self._flow_mgr.async_init(
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 831, in async_init
flow, result = await task
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 859, in _async_init
result = await self._async_handle_step(flow, flow.init_step, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File "/config/custom_components/shopping_list_with_grocy/config_flow.py", line 134, in async_step_user
cv.int, vol.In([0, 100, 200, 400])
AttributeError: module 'homeassistant.helpers.config_validation' has no attribute 'int'
If a shopping list item has a quantity value < 1 (e.g. 0.5kg flour) than it isn't shown in the list
Hi,
I want consume location as attribute.
In that way, if I check move on open, I can locate the product amount that is opened and in consume location.
That improve the ability to use Grocy in Home Assistant, like hosting seperate dashboard to satellite kiosk in location.
And it can show opened product and opened amount(which is already presented), with auto-entities or something.
Again, thanks for great effort.
Hello, I would like to know if it is possible to extend this software to interact, not only to grocy, but also to tandoor.dev?
thank you
It's me again, for another little problem.
I installed the grocy app on my iphone, but once outside my home, I don't have access to the grocy Home Assistant list! I have to do something special?
I have specified port 9192 and cut the SSL.
in the grocy app on my iphone, I put this as the server:
http://192.168.0.12:9192
with of course api
but when I'm outside, I no longer have my shopping list
Hello,
I can't build the card. I copied your example but I only have errors. do I need to change something in your example?
Ex: i don't have: binary_sensor.updating_shopping_list_with_grocy
Thank you.
Add custom user fields to the product sensors.
I have a lot of products in my Grocy and I am using the example UI(with changes).
But with this many products it's hard to find the one that I need so I wanted to make a custom sort to order the products with the most used ones on top.
For this I made a custom field in Grocy but it's not shown in the individual product sensor so I can't sort by it.
Please add the custom fields to the product sensor
Thank you
Hi,
I can't track amount opened in product sensor.
Also, I want to track where the product is, since in Grocy it can track product transfer.
Thanks again for great effort.
Hi
I run a script on my Grocy install that adds missing products and expired/out of date products to separate groups. This is particularly useful for the expired products since otherwise if you have a mix of in-date and out-of-date products you can't tell how many are still good and how many need to be thrown away
Anyway, to differentiate the products I add either one or two trailing spaces to the product name when they are created for the "Out of Date" and "Out of Stock" groups. However, Shopping List with Grocy (or MQTT, don't know which!) removes any trailing spaces from the names which means that there is only one sensor created :( I have tried changing the trailing spaces to a punctuation mark, eg "." and "!", but the same thing still happens.
Can Shopping List be made to respect the product names exactly as Grocy gives them?
Thanks :)
The Shopping List with Grocy integration is not loaded and in the core log i see this error:
Config entry 'ShoppingListWithGrocy' for shopping_list_with_grocy integration not ready yet: can only concatenate str (not "int") to str;
I use latest version from HA, grocy and this integration (0.7.0).
Hi I'm working on trying to get this setup in my home assistant instance but the MQTT doesn't have an option for the port I use. Is there an option to add a custom port?
Hi @Anrolosia !
This error has been showing in my HA logs:
Logger: homeassistant.helpers.template
Source: helpers/template.py:625
First occurred: 6 April 2023 at 16:32:03 (58 occurrences)
Last logged: 11:31:35
Template variable error: 'value_json' is undefined when rendering '{{ value_json.qty_in_shopping_list }}'
Any ideas?
Hi, Anrolosia!
Can you add qty_missing as attribute of individual sensor, 0 when there is enough and have value when product is missing?
In that way I can track which product is missing and dynamically trace them.
Thanks for your great work.
Hi! I installed the integration, but binary_sensor.updating_shopping_list_with_grocy that is mentioned in the docs and used by the sample card wasn't created. Other sensors like sensor.products_shopping_list_with_grocy were. Tried enabling debug logging for the integration, but logs show nothing.
Hello,
I'm wondering if maybe someone had problem with missing shopping_list_with_grocy services in HA. In dev area -> services I only see services from official shopping list component and shopping_list_with_grocy script. I don't see 4 services mentioned in docs. I'm on HA 2023.2.5.
Thanks
Hi Anrolosia!
Another enhancement suggestion that i would appreciate greatly: The possibility to use "Default quantity unit purchase" instead of "Quantity unit stock" in the shopping list. For example for some items like flour i have "grams" as the stock unit and "package" as the purchase unit. That's impractical in the shopping list as i might have 200g (one package) in the shopping list... What do you think?
Hello,
can you remove (or modify) validation on URL field for grocy URL? When using Grocy addon on HAOS host has name like "a0d7b954-grocy" but validation makes it not possible to use it.
Thanks
when I install the installation after entering all parameters I keep getting this error message
2022-12-22 11:42:17.517 WARNING (MainThread) [homeassistant.config_entries] Config entry 'ShoppingListWithGrocy' for shopping_list_with_grocy integration not ready yet: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain', url=URL('http://192.168.0.90:8123/api/hassio_ingress/inB-aTDbRNSNJz2Wj20-xpoFjyu-D8jUTTsfzgfEZW4/api/system/db-changed-time'); Retrying in background
If I copy paste the url part in a browser I do get an normal answer
Hi, I tryed to use your awesome integration to get product as , but I can't get get all product in sensor attribute since I'm not English native. I use Korean Alphabet since I'm Korean, and while I try to get product sensors by mqtt, it floods with logs like this:
2023-05-28 00:28:15.328 WARNING (MainThread) [homeassistant.components.mqtt.discovery] Received message on illegal discovery topic 'homeassistant/sensor/shopping_list_with_grocy_생수_2/state/config'. The topic contains not allowed characters. For more information see https://www.home-assistant.io/integrations/mqtt#mqtt-discovery
Is there any option I can use to get product as sensor?
Hi,
in Home Assistant 2023.11.0 RC, now Home Assistant have To-Do as own integration, and support integrating external to-do with Home-Assistant like Todoist.
Will this integration also support integration with Home Assistant To-Do?
I may be a little confused on what the shopping_list_with_grocy.update_note service actually does. I would assume from what is shown and its name it allows you to update the notes on a shopping list however it also still requires a product to be provided? From the dashboard example it seems like you are using the service to update the notes on a specific product AND list but when I call the service to test it out neither the notes on the product or shopping list change.
No matter which URL I use, I get the error "Grocy's URL is invalid, please use valid URL (http:// or https:// with either domain name or ip address)".
I am using the Grocy Add-On, and the Grocy Custom Integration, both of which installed and function without a hitch.
Hi,
I think having qty_unopened(or amount_unopened) can improve attribute.
It is very common practice to store unopened amount as separate value. And many Home Assistant card does not support attribute templating. So, it is not easy to get unopened amount in Home Assistant. If product sensor supports unopened amount as separate attribute, it will be much easier to get value.
Hi, I've been working on making lovelace settings to show dashboard like grocy app.
In individual product sensor, it's showing quantity unit id so I should define id to string in Home Assistant once again.
I wish I can get a quantity unit as string.
hello congratulations for the integration. the dashboard is very nice, however it would be useful to see the number of products available within the product button
Shopping list with grocy have option to get product sensor, and it’s super useful. I can have automation in home assistant, to warn shortage and remind me to buy groceries. Currently, product sensor has location in their attribute ‘location’.
But products are actually ‘in’ location, it’s not intuitive for smart home approach. It’s more of a ERP way of view.
So if I can get multiple product sensors in each location device such as fridge, it would be much easier to understand and fits in home assistant.
I installed the official Grocy component and opened port 9192 as per the HACS integration instructions. Once configured the interaction still doesn't work, could you help me?
after clicking on the send button
The component at fault appears to me
Could it be the fault of the fact that I set the Italian language?
Sorry for my English
Hi again,
Thanks for product sensor attributes, but I have some enhancement.
In Grocy, app adds all the child product quantity inside to show as quantity in summary. '∑' represents it's sum.
However, for parent product sensors produced by Shopping list with Grocy, it only show attribute.qty_in_stock as '0', which is useless since attribute.no_own_stock = 1 already shows it has now own stock.
And it is cumbersome to add calculation in Lovelace. I wish if integration supports this.
So in product sensor for parent product, I think it should show value of sum. Like Grocy app, adding ’∑‘ can represent it's sum of child product's quantity.
And I wish I can get some attributes in boolean, int or float, not string.
Is there any chance of including the product group in the entity data? I would find it far more useful to group the shopping list by product type (eg. "Dairy" or "Fruit & Vegetables") rather than by storage location.
Thanks :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.