Commit 5785f41
committed
Light the rack from the cellar
The integration could tell you what to drink on a screen. The bottles are
in a rack, so this is the same answer in the room: an ESPHome node that
lights one block of LEDs per bin, and a Home Assistant package that turns
the inventory into what it paints.
A bin carries the drinking-window state the dashboard paints it with -
ready, drink-this-year, past, aging, no window - so the rack and
/cellartracker/cellar.html cannot disagree about a bottle. The rule is
the same one _drink_window_counts uses; a test runs the template beside
the coordinator over one cellar and compares, the way the dashboard's own
counts are checked.
The whole rack travels as 169 state characters, one per bin, which is a
single action call and fits inside a Home Assistant state. The node
therefore knows nothing about wine: it composes colours once per call and
each strand copies its own row out. A locator hides the overview rather
than destroying it, so a poll landing while you are looking for a bottle
does not take the answer away.
Two things the rewrite had to settle, both found by compiling it:
* `bit_bang` does not build on ESP32, so neopixelbus tops out at the
ten strands its RMT channels and I2S buses can be pinned to. Thirteen
rows needs FastLED, which takes a channel per strand as it transmits
and hands it back.
* Left without a `method`, every neopixelbus strand gets the same
default and they fight over it - which is a rack whose rows mirror
each other rather than a config that fails to compile.
Credentials are `!secret` references throughout, and the `api:` block is
on the `actions:`/`action:` spelling ESPHome moved to in 2024.8.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011au3uaZneMFTbnssPSwpLt1 parent 7a8e94c commit 5785f41
6 files changed
Lines changed: 1256 additions & 0 deletions
File tree
- examples
- esphome
- home_assistant
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
474 | 475 | | |
475 | 476 | | |
476 | 477 | | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
477 | 548 | | |
478 | 549 | | |
479 | 550 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments