Simple Inventory Integration/Card

I tried to find something that was just a simple system, Grocy and others do too much for my needs, and apparently I’m either really bad at Googling, or it doesn’t it. So, I present: Simple Inventory. It creates a sensor for each inventory you add, and each item has an optional threshold below which it gets added automatically to a to-do list, since I use categorized ones for my grocery shopping. It has some barebones features: sorting, filtering, expiration dates, categories. Easy to increment and decrement items via the mobile app.

I spent a day or two on this, it definitely needs some polish (and some tests, and probably lots of bugs fixed, and maybe someone who actually knows Python to take a look at it), but I’d really appreciate some feedback. PRs are also welcome.

3 Likes

Nice will give this a try. Was looking for something simple as well.

Let me know if it works for you!

Hello. Having trouble accessing the frontend card. How/where do I enable the card?

I have manually installed the integration and placed the folder inside custom_components. Added an inventory tab after restarting HA.
I have added the repo in HACS to installed the simple-inventory-card. I can see the .js folder under config-www-community-simple-inventory-card.
Added these lines in my lovelace.yaml file. Reload resources a few times, but I don’t see the card.

- url: /hacsfiles/simple-inventory-card/simple-inventory-card.js
  type: module

Hmm you shouldn’t need to add it to your lovelace.yaml file, at least I didn’t with mine. I added the repository as a custom one in HACS, clicked the download button, and restarted Home Assistant. Then I just need to search for “Simple Inventory” when adding a new card to the dashboard and it’s there.

Do you see anything in the browser console for errors? You should see something like “Simple Inventory Card 0.1.5” in there as well.

Do you see anything in the browser console for errors? You should see something like “Simple Inventory Card 0.1.5” in there as well.

Am I looking in the right area??

Close! It’s the tab titled “console”. You should see something like this:

I do need to point the url to the simple-inventory-card.js or it will not show up in the console, but I still don’t see the card anywhere. Not sure if this matters, but mine has a %c compared to yours.

Do you mind going to edit a dashboard, clicking the three dots menu, clicking “resources”, and letting me know if you see it listed there?

Yes, I can see it is listed. If it is working properly, where does the card appears?

:thinking: If you don’t see it when you do this:

You can try adding it manually - it should be something like:

type: "custom:simple-inventory-card" and that should give you the option to then use the visual editor and pick the inventory you want, otherwise you can add entity: sensor.your_inventory_name below it.

You can try adding it manually - it should be something like:

ok, that works. I can see it now.

Thanks for sticking with it, I’ll try to reproduce this issue and fix it.

Hello. You’ve have said It creates a sensor for each inventory you add and I have added a few test items to the list, but I do not see any sensors created. Could it be because I’ve added the card manually? Though it seems to accept any inputs I made. The only sensors I can see is sensor.items_expiring_soon which was created when I install the integration.
Edit: ok. I see those items created. It is under sensor.home_inventory for me.

Also, not sure what the expiry_threshold does. I have changed it from 7 to another number. It says it saved the changes, but when I go back to the same tab, it still shows at 7.

What does the threshold for the below image means? Does it warns me if the quantity is below the threshold number? How often does it check for quantity changes? I had it set to quantity: 1, threshold: 1. Perhaps the quantity needs to be below the threshold and not equal to??

It creates a sensor.whatever_inventory for any inventory you add, and then items are added to that inventory.

I noticed the bug with the expiry date and threshold being unable to change as well, I’ll have a fix up for that soon. The integration creates another sensor, sensor.items_expiring_soon that you can build automations off of if you’d like, the expiry_threshold is the amount of days before something goes bad that you want it added to the item_expiring_soon sensor.

The threshold under the Auto-add checkbox is for the value at which you want to auto-add it to the todo list you can choose in the dropdown. Like if you have 5 of something, but want to have it put on your shopping_list when it reaches 3 left. I should probably make it more clear by hiding the Threshold and Todo List sections unless you check the box.

This is definitely all stuff I’ll add to the README, and again, thanks for the feedback.

I was looking at something simple as this!
it works as you may expect.

thanks for creating this!

I did a big refactor - my apologies, but it is not backwards compatible. If you want to upgrade, I’d recommend deleting the simple_inventory.storage file in your homeassistant/.storage directory, and uninstalling the old version of the integration.

From here on I will be sure to keep the same data structure, and if there is an overhaul needed, to build out a migration system. There were a lot of bugs that got fixed as part of this, and I added a few additional features, one of them being each item can have it’s own specific expiration date notification threshold, rather than being a per-inventory setting. Inventories now can also be assigned to an area, and the global expiring items inventory is its own device. This will allow more and better automations to be built out around notifications for expiring items.

If you want to upgrade, I’d recommend deleting the simple_inventory.storage file in your homeassistant/.storage directory, and uninstalling the old version of the integration.

Thx. Done. Upgraded.My items do not have an expiry date to them. However, I would like to have a sensor to warn me if any particular item is below xx count. Perhaps this sensor will query the sensor.xx_inventory, quantity attribute for true and list the item name as a state?

So sort of like the functionality to add it to a to-do list, but instead a “items in low stock” type of sensor?

yes. Multiple sensors maybe needed base on the count that is low?

Examples:
dental floss- warns if the count is below 3
dish soap- warns me if the count is = or below 1