Game of Life page element and built-in page

A new page element runs Conway's Game of Life in an area (the whole display
by default), one per page. Start: random dots, one pattern, or the icons
whose names start with a text in turn or in random order. Edges: wrap
around, dead, or a hidden margin where gliders fly out of view (leftovers
that stay put in the margin are cleared, so a glider gun runs cleanly).
It restarts when the board is still or repeats within 16 generations
and/or after a number of generations, after a hold time (an empty board
at once).

logic/life holds the board and timing (tested), display/life_player runs
the board of the shown page, ticked before each frame; frames are paced
like scrolling text. The element reuses existing fields, so the page
format stays the same. The Icons tab has a library of 17 LifeWiki
patterns (checked with a simulation), and the built-in page "Game of
Life" shuffles through the life_ icons. About 12 KB flash, 8 KB RAM.

Version 2.17.0, tested on the display over OTA.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-20 17:52:25 +02:00
1 parent 948087077d
commit a91d2550d7
29 files changed
+1402 -31

No files matched your search

+8
View File
@@ -13,6 +13,14 @@
- **08:00–23:30:** the page: the chosen page (by default the built-in Clock page,
Pikachu with a thought bubble showing `HH:MM`, yawning from 17:00), or what the
[schedule and rules](web-ui.md#schedule) pick.
- **Game of Life** (a page element): the ESP32 runs the board (`logic/life`) and sends a
frame per generation with only the changed dots. Like scrolling text, the next frame
waits until the Nano has received and flipped the last one, so a busy board runs
slower than the chosen speed. Only the shown page runs; it pauses while the display is
off. Still or repeating boards are found by comparing a hash of the board with the
last 16 generations. With the hidden margin, gliders that leave the area are cleared
at the outer edge, and leftovers that stay put in the margin are cleared after 12
generations, so a glider gun keeps running cleanly.
- **Slow mode** (a switch in Home Assistant and the web UI, for less noise): the display
only changes every 1, 2, 5, 10, 15, 20, 30 or 60 minutes, on the clock (15 minutes =
:00, :15, :30 and :45). 30 seconds after each update the relay turns the display off;
+2 -1
View File
@@ -3,7 +3,7 @@
[← Back to the README](../README.md)
The dynamic pages on the display, drawn by the ESP32 itself (`python
tools/make_page_screenshots.py` makes these pictures again). The Clock page comes with the firmware (it can be changed, Reset brings back the original);
tools/make_page_screenshots.py` makes these pictures again). The Clock and Game of Life pages come with the firmware (they can be changed, Reset brings back the original);
the others are the example pages in [examples/home-pages.json](../examples/home-pages.json)
with their icons (import them in the web UI, System tab). They use this home's Home
Assistant entities: change them to yours in the page editor (`climate.home`,
@@ -14,6 +14,7 @@ replaces private parts of entity ids by these placeholders.
| Page | |
|---|---|
| **Clock** (from the firmware), day and from 17:00 | ![Clock](../Pictures/pages/clock-0000.png) ![Clock, evening](../Pictures/pages/clock-1700.png) |
| **Game of Life** (from the firmware): the `life_` patterns of the Icons tab in random order on the whole display, hidden margin, 4 generations per second, a new pattern when it stops changing or after 600 generations; random dots without patterns | ![Game of Life](../Pictures/pages/game-of-life.png) |
| **Weer**: clock, weather icon by state, humidity, temperature | ![Weer](../Pictures/pages/weer.png) |
| **Verwachting**: today (icon, temperature now, max/min) and the next 2 days (weekday, small icon, max/min); needs the [forecast sensor](home-assistant.md#weather-forecast) | ![Verwachting](../Pictures/pages/verwachting.png) |
| **Dag en nacht**: sun from 07:00, moon and stars from 19:00, date | ![Dag en nacht, day](../Pictures/pages/dag-en-nacht-0700.png) ![Dag en nacht, night](../Pictures/pages/dag-en-nacht-1900.png) |
+12 -2
View File
@@ -25,8 +25,9 @@ Bitmaps that pages or rules use are in their own subsection.
Dynamic pages: a background per time of day, a bitmap or an [icon](#icons) (e.g. Pikachu
from 00:00, yawning Pikachu from 17:00) with up to 16 elements on top. The preview is drawn by the ESP32, so it
is exactly what the display shows; drag the elements on it, or select one and use the
arrow keys. The Clock page (Pikachu, the default) is a normal page that can be changed;
its Reset button brings back the original. See the [pictures of the pages](pages.md).
arrow keys. The Clock page (Pikachu, the default) and the Game of Life page are normal
pages that can be changed; their Reset button brings back the original. See the
[pictures of the pages](pages.md).
| Element | Options |
|---------|---------|
@@ -38,6 +39,7 @@ its Reset button brings back the original. See the [pictures of the pages](pages
| Stopwatch | `4:05`, `0:04`, `0:04:05`; started in the [Stopwatch](#stopwatch) tab or Home Assistant |
| Image | An icon (or a bitmap) at a position, fixed or chosen by a Home Assistant state (`weer ` + `cloudy` = the icon `weer cloudy`, `weer default` when there is none) |
| Progress bar | Filled from the left by a Home Assistant number: value x multiplier / "full at" (a percentage: full at 100). Width, height, with or without a frame. Optionally the percentage on top (e.g. 42%, rounded down, in the chosen font): its dots invert the bar, so it stays readable on the filled and the empty part; left out when it doesn't fit inside (Small needs a height of 7 with a frame) |
| Game of Life | [Conway's Game of Life](https://conwaylife.com/wiki/Conway%27s_Game_of_Life) in an area (the whole display by default), one per page. Start: random dots (density %), one pattern, or the patterns whose names start with a text (e.g. `life_`) in turn or in random order, in the middle or at a random place. Edges: wrap around, dead, or a hidden margin (the world is 16 dots larger on every side, so gliders fly out of view and disappear). Speed in generations per second. It restarts when it stops changing (still, or repeating within 16 generations) and/or after a number of generations, after running on for a few seconds (an empty board at once) |
Every element has a position, alignment, font and overlay (on top, box that clears the
dots behind it, inverted). Entity ids can contain `{plex_user}`, replaced by the Plex user
@@ -98,6 +100,14 @@ size), show it on the display. "Make bitmap" turns an icon into a full screen bi
firmware: they are stored as icons at boot and can be edited, the firmware keeps the
originals.
**Game of Life patterns**: 17 famous patterns from [LifeWiki](https://conwaylife.com/wiki/)
(glider, the three spaceships, a copperhead turned to fly sideways, the Gosper glider gun,
pulsar, pentadecathlon, queen bee shuttle, figure eight, Kok's galaxy, beacon and the
methuselahs R-pentomino, acorn, diehard, thunderbird and pi-heptomino). Add adds one as
an icon named `life_...`, Add all adds the missing ones. A Game of Life element starts with
one of them, or goes through all icons whose names start with `life_`, also the ones you
draw yourself. The patterns live in the web page (RLE text), not in the firmware.
Firmware 2.10.0 made icons of all uploaded bitmaps that only pages used (backgrounds and
images, not shown by the schedule, a rule, the chosen page or the off image), once, after
the new firmware was marked as good. They keep their names and land on the same dots, so