|
| 1 | +## Know what to drink tonight |
| 2 | + |
| 3 | +Two new sensors answer the question a cellar inventory is actually for: |
| 4 | + |
| 5 | +| Sensor | What it counts | |
| 6 | +|---|---| |
| 7 | +| **Ready to drink** | Bottles whose drinking window includes this year | |
| 8 | +| **Past drinking window** | Bottles whose window ended before this year | |
| 9 | + |
| 10 | +Both come from the drinking-window years CellarTracker already exports — `BeginConsume` and `EndConsume`, shown as **From** and **To** in the bottle table — so there is nothing to configure. Bottles with no drinking window are counted in neither — the export does not say, so neither do we. |
| 11 | + |
| 12 | +A wine in the last year of its window counts as **ready**, not past. The bottle table shows that year in red, which is a nudge to drink it rather than a claim that it has gone over. |
| 13 | + |
| 14 | +Substitute your own account name for `alice`: |
| 15 | + |
| 16 | +```yaml |
| 17 | +type: entities |
| 18 | +entities: |
| 19 | + - entity: sensor.alice_ready_to_drink |
| 20 | + - entity: sensor.alice_past_drinking_window |
| 21 | +``` |
| 22 | +
|
| 23 | +Useful in an automation, too — a monthly reminder of what needs drinking: |
| 24 | +
|
| 25 | +```yaml |
| 26 | +trigger: |
| 27 | + - platform: numeric_state |
| 28 | + entity_id: sensor.alice_past_drinking_window |
| 29 | + above: 0 |
| 30 | +``` |
| 31 | +
|
| 32 | +## ⚠️ Requires Home Assistant 2024.11 or newer |
| 33 | +
|
| 34 | +Up from 2024.7. Home Assistant 2024.11 added the `config_entry` argument that a data coordinator must now be given; without it, a future Home Assistant release refuses to set the integration up at all. |
| 35 | + |
| 36 | +If you are on 2024.7 to 2024.10, stay on 0.0.17 until you can update Home Assistant. |
| 37 | + |
| 38 | +## ⚠️ The `Status` sensor now reports a time |
| 39 | + |
| 40 | +It used to read `Connected`. It now reports **when the cellar last synchronised**, which is what actually tells you a six-hourly integration is still alive. |
| 41 | + |
| 42 | +Nothing breaks. It keeps its entity ID, so dashboards and automations pointing at it keep resolving — and its old value never changed once the integration was running, so nothing could have been triggering on it. Existing installs keep the `_status` entity ID; new ones get `_last_synchronised`. |
| 43 | + |
| 44 | +Its two attributes are gone. They held a fixed API path and a line of setup advice, which the recorder then stored with every state write. Both are in the README. |
| 45 | + |
| 46 | +## New: diagnostics |
| 47 | + |
| 48 | +**Settings → Devices & Services → CellarTracker → ⋮ → Download diagnostics** now produces a report you can attach to a bug. |
| 49 | + |
| 50 | +It carries the totals, the coordinator's state, the list of columns your export contains, and one sample bottle. It does **not** carry your password, your username, the entry title, or anything about where a bottle is stored — the sample is built from a fixed list of fields rather than by removing the sensitive ones, so a column CellarTracker adds in future is left out rather than published. |
| 51 | + |
| 52 | +The column list is the useful part when an export changes shape, which is the usual cause of a cellar that suddenly reads zero bottles. |
| 53 | + |
| 54 | +## Fixes |
| 55 | + |
| 56 | +* **A rate-limited cellar now backs off** instead of knocking again on schedule. CellarTracker's `Retry-After` is honoured, bounded to six hours, and never shortens the refresh interval you configured. Previously HTTP 429 was indistinguishable from an unreachable server. |
| 57 | +* **The dashboard no longer stalls Home Assistant while it loads.** The bottle list was converted to JSON inside the web request, which on a large cellar blocked everything else Home Assistant was doing for the duration. It is prepared in the background now. |
| 58 | +* **The bottle table loads faster**, especially on a phone: it asks for only the columns it displays, roughly a tenth of the data. The full `/api/cellartracker/inventory` response is unchanged, so any card you built against it keeps working. |
| 59 | +* **A malformed export is reported as one.** A wine with a very long tasting note could exceed a parser limit and surface as an unexplained error; it now says the export could not be read. |
| 60 | +* **Changing currency warns you** that Home Assistant records cellar value as a long-term statistic in its old unit, and that you may need to clear that sensor's statistics. Changing currency relabels the value — it does not convert it. |
| 61 | +* **An unrecognised currency no longer becomes US dollars silently.** It says so in the log and tells you how to correct it. |
| 62 | +* Credential handling was hardened: an error from CellarTracker now carries only its HTTP status, so a request URL — which contains your password, because that is how their export API accepts it — cannot reach a log file or a diagnostics report. |
| 63 | + |
| 64 | +## Entity names are translatable |
| 65 | + |
| 66 | +Every sensor name now comes from the translation files rather than being hardcoded English, so a Home Assistant running in another language can show them translated. English names are unchanged. |
| 67 | + |
| 68 | +## Under the hood |
| 69 | + |
| 70 | +329 tests, up from 190. Each fix was written test-first and confirmed to fail against the code it replaced. |
| 71 | + |
| 72 | +**Full Changelog**: https://github.com/GuvHas/cellartracker/compare/0.0.17...0.0.18 |
0 commit comments