Comments (11)
It is an excellent ticket! It will be an enhancement because today there is not distinction between lists. I will work on it and publish an update
from shopping-list-with-grocy.
Great! Looking forward to it!
from shopping-list-with-grocy.
Hey @anha7196 , I just pushed a new version (0.7.0), with that you should be able to display different shopping lists, and add/remove products to them!
Be carefull, this release includes some breaking changes! You'll have to play with your dashboard a bit :)
Let me know if it's working for you :)
from shopping-list-with-grocy.
Hi Anrolosia! That was really quick!
I tried the new version and i saw you documented the changes to the services, looks great!
I could not figure out however if there is any attributes to identify which shopping list an item belongs to. Maybe that is not how you implemented it or do i need do reload data from grocy somehow?
Oh, i just noticed there is an error on the integration page: Retrying setup: can only concatenate str (not "int") to str.
Full error message in logs:
This error originated from a custom integration.
Logger: custom_components.shopping_list_with_grocy
Source: custom_components/shopping_list_with_grocy/apis/shopping_list_with_grocy.py:233
Integration: Shopping List with Grocy (documentation, issues)
First occurred: 14 June 2023 at 21:39:29 (1006 occurrences)
Last logged: 21:04:38
Unexpected error fetching None data: can only concatenate str (not "int") to str
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _async_refresh
self.data = await self._async_update_data()
File "/config/custom_components/shopping_list_with_grocy/init.py", line 189, 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 553, in retrieve_data
await self.parse_products(self.final_data)
File "/config/custom_components/shopping_list_with_grocy/apis/shopping_list_with_grocy.py", line 233, in parse_products
shopping_lists["list" + shopping_list_id] = {
TypeError: can only concatenate str (not "int") to str
from shopping-list-with-grocy.
You have to play with the list_x_qty attribute:
If a product is in a list, no matter which one, it will have dynamicaly 3 new attributes, list_x_qty, list_x_note and list_x_shop_list_id
You can do you own shopping list dashboard, and have an intermediary window/popup when you want to add a product to specify on which list, then you call the service with the list_id filled :)
from shopping-list-with-grocy.
It seems the list_x_qty attribute is not present for me, i guess because of the "str not int" error at startup i wrote about in the last post.
This is the attributes from a sensor.shopping_list_with_grocy_ item in my installation (removed the image stuff":
product_id: 110 id_in_shopping_list: 2336 qty_in_shopping_list: 150 qty_in_stock: 0 product_image: topic: homeassistant/sensor/shopping_list_with_grocy_product_110/state note: location: Kylskåp group: Charkuterier icon: mdi:cart friendly_name: Leverpastej
from shopping-list-with-grocy.
@anha7196 I'm curious, what is the entity_id of that product?? Because you shouldn't have id_in_shopping_list
anymore... Is there a _v1_
in your entity_id?
Also, with v0.7.1, I added a cast to str just in case, so if you're uptodate, you shouldn't have this error anymore
from shopping-list-with-grocy.
Yes, youŕe right! There is a _v1_
one with the new list_X attributes, and one without _v1_
with the id_in_shopping_list
attribute.
So it is expected behavior to have the old products as sensors still?
from shopping-list-with-grocy.
It was specified in the update that having products in double might be expected, in that case you have to hit the refresh service several times, or just delete the old sensor in Homeassistant
from shopping-list-with-grocy.
Ok, sorry for missing that. Refresh service seems to be dong nothing after many tries, so Iĺl have to delete manually.
I've made list for only my groceries now, works great! Thanks for the help!
from shopping-list-with-grocy.
No worries! I'm glad it works now
I'll close that ticket then, have a great one!
from shopping-list-with-grocy.
Related Issues (20)
- Config entry 'ShoppingListWithGrocy' for shopping_list_with_grocy integration not ready yet: can only concatenate str (not "int") to str; HOT 7
- Feature Request: location as device option HOT 3
- Default quantity unit purchase HOT 6
- UI HOT 6
- Attempt to decode JSON with unexpected mimetype: text/plain HOT 6
- MQTT Port not available HOT 2
- Custom user fields HOT 6
- Problems with component configuration HOT 5
- Quantity missing as attribute HOT 9
- Integration with Home Assistant To-Do? HOT 4
- Qty Aggregated as attribute for parent product sensor HOT 1
- binary_sensor.updating_shopping_list_with_grocy is not created HOT 9
- show Quantity Unit in Product sensor as string. HOT 1
- Can't track amount open in product sensor HOT 2
- Feature Request: Consume Location as attribute HOT 1
- Feature Request: Having qty_unopened as product sensor attribute HOT 1
- extend to tandoor.dev HOT 1
- update_note servcie [question] HOT 2
- Grocy url access with name is not working HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shopping-list-with-grocy.