Best practice parsing wine cellar data

Hi!

Pretty new to Hassio after making the change from Domoticz so don’t know my way around yet… I am currently looking for a solution getting my wine cellar data from cellartracker.com into Hassio.

What I want to track is:

  • Bottles in my cellar (total amount)
  • Bottles divided per country (% per country)
  • Total value (sum of price)
  • Consumed per month (amount + list of wines)
  • Added per month (amount + list of wines)

Cellartracker offers a csv export (read more here) that I’am planning to use. The CSV file contains the following fields:

CellarTrackerId (not unique); Location; Bin, Size; Price; Purchase Date; Vintage; Wine; Country; Region; Type; BeginConsume; EndConsume

My idea is to create a php script that downloads the CSV once an hour and then updates Hassio.

The first part is really simple but I don’t really know how to get the data in Hassio the best way. I was thinking about MQTT but doesn’t really know how to set up the sensor (?) to be able to display the way I want.

Or can Hassio (or any plugin) read the CSV data directly?

Anyone that can point me in the right direction?

I have a couple of php scripts doing something similar, albeit not wine data.

My php script parses the csv file, and for each value I want publishes the data to an mqtt topic.

Eg publish the number of bottles to wine/total_bottles.

You then setup a mqtt sensor in ha which which listens / subscribes to wine/total_bottles.

There are a few php mqtt libraries around, the simplest I found is bluerhino.

Hi!

Thanks, I’ve come a bit further regarding “static” values that I know only have X amount of values; for example Total number of bottles is always one number.

But e.g. I would also want to show bottles per different countries in a pie chart or bar graph.

In this case I don’t know how many countries I have represented but I know that each line would consist of Country, Number of bottles, % of bottles of all.

Any ideas how to save this?

BR,
Andreas

MQTT auto discovery might help you there! Send your messages as json to make it easier to parse in HA.

This will probably work! Will look into this the following weeks! Thanks!

Got it to work! Here’s the result!

1 Like

Wow that’s nice! Care to share your code?

Thanks.

I must say, I’m definitely a fan of your wine collection.

Might be time for me to invest in cellar tracker!

1 Like

Looks great, I would like to do something similar. Would appreciate any code/config you’d be willing to share @andreasy

Hi,

I created a cellartracker Python package https://github.com/mathroule/cellartracker. Now I need to finish the integration of the package in Home Assistant, then open a pull request to add the new integration.

2 Likes

@andreasy I’m a mad wine guy and this post has made me super happy. Do you mind sharing your code with me? I would love to set this up in my HA. Thanks

Coming from Homeseer to Home Assistant, It’s nuts how many integrations there are in HA. This is one I just looked up for the fun of it. Would love to get this running too.

UPDATE: Just installed AppDaemon, going to see if I can use Mathieu’s cool python package to build something.

Stumbled upon this last night and I am absolutely blown away by how awesome and neat this looks. My knowledge of python is really limited though I’d love to get something like this up and running on my Home Assistant. Would love to see some code or a write-up to help other wine lovers like me :slight_smile:

Yeah, one of my goals would be not only to summarize my collection but also recommend ready to drink wines by varietal. Would be fantastic when I open up the cellar to get an automatic recommendation.

Looks really great and spot on what I am looking for. Care to share the code?

Just keeping this one going. Another HA and CT user here. I have HA monitoring my wine cellar (ESPHome custom sensors) and would love to have even just the “restaurant” wine list on one all-inclusive Cellar page.

I’m not great with python, but am willing to help test functionality if needed.

A graphical cellar would be nice as well, but I won’t be greedy:)

This is precisely what I have been looking for!! Are there plans to complete the integration in home assistant? Or is it already done?? Regards, Yves

Is this project dead or can I use it somehow?

Hi all!

Sorry for being non-reactive, I have been working on another smart wine cellar project which you can find at www.smartwinecellar.xyz.

I hope I will find the time in the coming months to share the code, but right now it’s really really messy…

BR,
Andreas

I have used this one to integrate HA to CellarTracker - and it looks like it is the same “andreasy” uses: