Managing/Tracking Supplies of Various Things

Because I have a dog :dog2: that is somewhat sick and regularly needs to take its meds :pill:, I initially created a bunch of template sensors to track our supplies of the various kinds of pills Bona has to take. This worked, but resulted in 7 (template/input_number) entities per pill type, and Bona has to take 6 different kinds of pills. Thus, my configuration was full of very repetitive definitions.

So, I created an integration to make this a little easier. It’s HACS compatible but currently only available as a custom repository. The whole thing can be found here: https://github.com/nilsreiter/ha-inventory-manager.

Besides dog medicine, I also use it to track supply of dishwasher tabs.

The core idea is that there is a number entity to track the number of items (pills, tabs, …) we have, and a service that can be called every time some number of items is consumed. In addition, the integration allows to specify how many items are consumed at which time of the day. If this is specified, the integration also predicts when all items are gone, and can also warn a few days ahead of this day.

This is my first integration, and there are certainly bugs and oddities in it. But it was fun to write it and a good opportunity to take a dive into the home assistant code. Feel free to play around with it!

Dog photo for proof:

2 Likes

Best wishes to Bona from Maddy.

2 Likes

hi, thanks, this looks like it can save me a lot of manual helpers and automations, so I want to give it a try.

But it does not want to install.

I also tried with the beta version.

Download failed - Got status code 404 when trying to download https://github.com/nilsreiter/ha-inventory-manager/releases/download/v1.0.0/inventory_manager.zip
Download failed - Got status code 404 when trying to download https://github.com/nilsreiter/ha-inventory-manager/releases/download/v1.1.0-beta2/inventory_manager.zip
Traceback (most recent call last):
  File "/config/custom_components/hacs/base.py", line 709, in async_download_file
    raise HacsException(
    ...<2 lines>...
    )
custom_components.hacs.exceptions.HacsException: Got status code 404 when trying to download https://github.com/nilsreiter/ha-inventory-manager/releases/download/v1.0.0/inventory_manager.zip

Please try again with v1.0.1, I changed something in the metadata scheme (and I can now reinstall it).

1 Like

This will definitely be useful! Just the other day we had to look for a pharmacy that is open after hours. With this I can send a telegram message when stock gets low. I just need to convince my wife to capture new stock after shopping :wink:

Yes, keeping track of newly bought stuff is challenging.

What I did for dishwasher tabs:

  1. Have them delivered by PicNic
  2. Deliver PicNic e-mail to a specific address watched by home assistant
  3. Parse the bill sent by PicNic and store the result (which could also be done with an LLM)

That should in theory work for all shops that sent you receipts via e-mail.

last question (hopefully :wink: ), just to confirm:
Should I create own automation to subtract the configured evening usage? Or should the integration decrease the Supply automatically (which did not happen last night, so I assume own automation)?

Yes, you should create your own automation.

1 Like