{"id":15678289,"url":"https://github.com/edleckert/wine-cellar","last_synced_at":"2025-05-07T03:25:29.400Z","repository":{"id":227678102,"uuid":"772127350","full_name":"EdLeckert/wine-cellar","owner":"EdLeckert","description":"Home Assistant wine inventory integration with cellartracker","archived":false,"fork":false,"pushed_at":"2025-04-26T14:54:37.000Z","size":630,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-26T15:35:25.492Z","etag":null,"topics":["cellar-management","cellartracker","flex-table","home-assistant","home-assistant-custom","home-assistant-integration","integration","wine"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EdLeckert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-14T15:31:31.000Z","updated_at":"2025-04-26T14:48:57.000Z","dependencies_parsed_at":"2024-06-23T02:30:08.033Z","dependency_job_id":"4e7d8a27-abb4-4e63-aff8-32e1d10b133b","html_url":"https://github.com/EdLeckert/wine-cellar","commit_stats":null,"previous_names":["edleckert/wine-cellar"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdLeckert%2Fwine-cellar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdLeckert%2Fwine-cellar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdLeckert%2Fwine-cellar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdLeckert%2Fwine-cellar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EdLeckert","download_url":"https://codeload.github.com/EdLeckert/wine-cellar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252805446,"owners_count":21807005,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cellar-management","cellartracker","flex-table","home-assistant","home-assistant-custom","home-assistant-integration","integration","wine"],"created_at":"2024-10-03T16:19:36.245Z","updated_at":"2025-05-07T03:25:29.388Z","avatar_url":"https://github.com/EdLeckert.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wine Cellar\n\n\u003ch2 align=\"center\"\u003e\n  \u003ca href=\"https://www.cellartracker.com/\"\u003e\u003cimg src=\"./img/ct_logo.png\" alt=\"Cellar Tracker logo\" width=\"200\"\u003e\u003c/a\u003e\n  \u003cbr\u003e\n  \u003ci\u003eHome Assistant wine inventory custom integration for cellartracker.com\u003c/i\u003e\n  \u003cbr\u003e\n\u003c/h2\u003e\n\nThe `wine-cellar` implementation allows you to integrate your [Cellar Tracker](https://www.cellartracker.com/) data into Home Assistant.\n\n## Features\n\n- Sensor entity (per account) provides total bottle count.\n- Action provides detailed inventory.\n- Actions provide summaries of inventory.\n- Action immediately refreshes inventory from Cellar Tracker.\n\n## Disclaimer\nThis is an unofficial integration of Cellar Tracker for Home Assistant. The developer and the contributors are not in any way affiliated\nwith CellarTracker! LLC.\n\n\"CellarTracker!\" is a trademark of CellarTracker! LLC\n\n## Requirements\n- Cellar Tracker account - https://cellartracker.com\n- Flex Table Card - Available in HACS or https://github.com/custom-cards/flex-table-card/\n\n## Installation\n1. Install manually by copying the `custom_components/wine_cellar` folder into `\u003cconfig_dir\u003e/custom_components`.\n2. Restart Home Assistant.\n3. In the Home Assistant UI, navigate to `Settings` then `Devices \u0026 services`. In the `Integrations` tab, click on the `ADD INTEGRATION` button at the bottom right and select `Wine Cellar`. Fill out the options and save.\n   - Member Name - Your cellartracker.com Member Name (NOT your Email Address).\n   - Password - Your cellartracker.com password.\n## Usage\n\n### Sensor Entity\nA single sensor entity is provided for each linked CellarTracker account. This could be useful for a quick view of your total bottle count\nas well as a launch point to more detailed information, as shown here:\n\n\u003cimg src=\"/img/WineSensorEntity.png\" alt=\"Wine Sensor Button\" width=\"25%\"\u003e\n\nThis Tile Card provides the total bottle count, a link to a view with more information called `wine-inventory`, and an `icon_tap_action`\nto immediately refresh Home Assistant from the CellarTracker database.\n\n```\n- type: tile\n  entity: sensor.\u003cyourmembername\u003e_wine_inventory\n  name: Wine Inventory\n  tap_action:\n    action: navigate\n    navigation_path: wine-inventory\n  icon_tap_action:\n    action: call-service\n    service: wine_cellar.refresh_inventory\n    target:\n      entity_id: sensor.\u003cyourmembername\u003e_wine_inventory\n```\n\n### Inventory List Actions\nMore detailed views of the inventory are best presented with the [flex-table-card](https://github.com/custom-cards/flex-table-card).\nThe `flex-table-card` shows data in a tabular form, which works well for a wine database.\n\nConsider this list of wines as shown in a `flex-table-card`:\n\n\u003cimg src=\"/img/WineInventoryList.png\" alt=\"Wine Inventory List\" width=\"100%\"\u003e\n\nThe card definition for the above view demonstrates some advanced features of the card which can be used to mimic CellarTracker's display of icons.\nNotice the use of the `action` option to populate the table using the `wine_cellar.get_inventory` action.\n\n```\ntype: custom:flex-table-card\naction: wine_cellar.get_inventory\nentities:\n  include: sensor.\u003cyourmembername\u003e_wine_inventory\nclickable: true\nsort_by:\n  - ConsumeBy\n  - Vintage\ncolumns:\n  - name: \"\"\n    data: inventory\n    align: center\n    modify: |-\n      function getColor(wineColor) {\n        let color=\"red\";\n        switch(wineColor) {\n            case \"Red\":\n              color=\"DarkRed\"\n              break;\n            case \"White\":\n              color=\"Khaki\"\n              break;\n            case \"Rosé\":\n              color=\"LightPink\"\n              break;\n            default:\n              color=\"White\";\n              break;\n        }\n        return color;\n      }  function getIcon(wineType) {\n        let icon=\"mdi:glass-wine\";\n        switch(wineType) {\n            case \"Dry\":\n              icon=\"mdi:glass-wine\"\n              break;\n            case \"Sweet/Dessert\":\n              icon=\"mdi:glass-tulip\"\n              break;\n            case \"Sparkling\":\n              icon=\"mdi:glass-flute\"\n              break;\n            default:\n              icon=\"mdi:glass-wine\"\n              break;\n        }\n        return icon;\n      } '\u003cha-icon icon=' + getIcon(x.Category) + ' style=color:' +\n      getColor(x.Color) + ';\u003e\u003c/ha-icon\u003e'\n  - name: Barcode\n    data: inventory.Barcode\n    hidden: true\n  - name: Vintage\n    data: inventory.Vintage\n    modify: if(parseInt(x) == 1001) {\"N.V.\"} else{parseInt(x)}\n  - name: Wine\n    data: inventory.Wine\n  - name: ConsumeBy\n    data: inventory\n    modify: |-\n      ((parseInt(x.BeginConsume) || 9999) +\n       (parseInt(x.EndConsume) || 9999)) / 2\n    hidden: true\n  - name: Category\n    data: inventory\n    modify: x.Category + \" \" + x.Color\n  - name: Consume\n    data: inventory\n    modify: |-\n      let result = \n        x.BeginConsume == \"\" \u0026\u0026 x.EndConsume == \"\" \n        ? \"None\"\n        : x.BeginConsume + \"-\" + x.EndConsume;\n        parseInt(x.BeginConsume) \u003e new Date().getFullYear()\n          ? '\u003cdiv class=\"too-early\"\u003e' + result + '\u003c/div\u003e'\n          : parseInt(x.EndConsume) \u003c new Date().getFullYear()\n            ?'\u003cdiv class=\"too-late\"\u003e' + result + '\u003c/div\u003e'\n            : result\n  - name: Bin\n    data: inventory.Bin\n  - name: Price\n    data: inventory.Price\n    modify: if (x == 0 ) {\"N/A\"} else {\"$\" + parseFloat(x).toFixed(0)}\n  - name: Store\n    data: inventory.StoreName\ncss:\n  tr:has(\u003e td div.too-early): color:dimgray !important;\n  tr:has(\u003e td div.too-late): color:red !important;\n```\n\nAlternatively, you can use the `wine_cellar.get_distinct_inventory` action to view a list of distinct wines in your inventory,\nalong with a bottle count of each wine.\n\n### Inventory Summary Actions\n\nA group of actions is available to summarize the inventory by various fields. They are:\n\n- wine_cellar.get_countries\n- wine_cellar.get_locations\n- wine_cellar.get_producers\n- wine_cellar.get_types\n- wine_cellar.get_varietals\n- wine_cellar.get_vintages\n\nEach action returns a list that includes the following attributes:\n\n- group title\n- count\n- value_total\n- value_avg\n- percent\n\nYou can preview the data that will be provided to the `flex-table-card` for each action by using the `Developer tools` `Actions` tab.\n\nFor example, the following action call...\n\n```\naction: wine_cellar.get_countries\ntarget:\n  entity_id: sensor.\u003cyourmembername\u003e_wine_inventory\ndata: {}\n```\n\n...produces a result like:\n\n\n```\nsensor.\u003cyourmembername\u003e_wine_inventory:\n  countries:\n    - Country: Australia\n      count: 1\n      value_total: 25\n      value_avg: 25\n      percent: 2\n    - Country: France\n      count: 2\n      value_total: 72\n      value_avg: 36\n      percent: 5\n    - Country: Italy\n      count: 1\n      value_total: 29\n      value_avg: 29\n      percent: 2\n      ...\n```\n\nThe keys that are returned with each action are as follows:\n\n| Action          | Top level | Group title\n| -------          | --------- | -----------\n| `get_countries`  | countries | Country\n| `get_locations`  | locations | Location\n| `get_producers`  | producers | Producer\n| `get_types`      | types     | Type\n| `get_varietals`  | varietals | Varietal\n| `get_vintages`   | vintages  | Vintage\n\nThis is the card for the summary by Country shown in the following examples:\n\n```\ntype: custom:flex-table-card\ntitle: Bottles per Country\naction: wine_cellar.get_countries\nentities:\n  include: sensor.\u003cyourmembername\u003e_wine_inventory\nsort_by: Country-\ncolumns:\n  - name: Country\n    data: countries.Country\n  - name: Percentage\n    data: countries.percent\n    align: right\n  - name: Total Cost\n    data: countries.value_total\n    align: right\n    prefix: $\n  - name: Average Price\n    data: countries.value_avg\n    align: right\n    prefix: $\n  - name: Bottles\n    data: countries.count\n    align: right\n```\n\nWhen using the other Summary Actions, you will need to change some of the `name` and `data` values, as well as any `title`, `sort_by`, `modify`,\nor other relevant values. That is, every occurrence of `Country` and `countries` in the above example would need to be substituted using the table above.\n\nHere are examples of each action:\n\n\u003cimg src=\"/img/WineInventorySummary.png\" alt=\"Wine Inventory Summaries\" width=\"100%\"\u003e\n\n## Contribute\nFeel free to contribute by opening a PR or issue on this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedleckert%2Fwine-cellar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedleckert%2Fwine-cellar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedleckert%2Fwine-cellar/lists"}