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:

Best wishes to Bona from Maddy.

1 Like