Designing a 3D-printed part in OpenSCAD with ChatGPT and Claude Code

I recently learned that fixing a Dallas sidewalk takes a right-of-way permit, a wait of several weeks, and an inspection of the finished repair. I think crews laying fiber-optic cable left a hole in a sidewalk near me, and they didn’t seem burdened by any of that. It’s 6 in (150 mm) across, wide enough for a foot, and several feet deep, on a stretch where people walk their dogs, and it had probably been there for at least a year. I didn’t have much hope of the city fixing it quickly, so I printed a temporary plug for it (GitHub). I designed the first version with ChatGPT and the second with Claude Code, and having an LLM write OpenSCAD worked better than I expected.

A round white printed plug sitting nearly flush in a concrete sidewalk next to a curb ramp
The current plug (v2), which went through a stress simulation and stays under the 1/4 in edge height the Americans with Disabilities Act (ADA) allows on a walkway.

OpenSCAD models are code, so a language model can write one like any other program. This is the cap from the current plug’s model, which Claude Code wrote (a hollow stem under it sits in the hole), a 2D profile spun around the vertical axis with rotate_extrude. Paste it into OpenSCAD and press F5 to see it:

flange_r = 95;       // rests on the concrete, held down with double-sided tape
plastic_h = 5.2;     // cap thickness, sitting on 1 mm of tape
plastic_rim_h = 1.9; // short vertical edge
top_land = 0.8;      // printed cap-face down, this keeps the chamfer off the bed
bevel_run = 1.5;     // 1.5 mm in over 2.5 mm up, a 60 degree chamfer

rotate_extrude($fa = 2) // $fa: facet angle in degrees, for a smooth circle
  polygon([
    [0, 0],
    [flange_r, 0],
    [flange_r, plastic_rim_h],
    [flange_r - bevel_run, plastic_h - top_land],
    [flange_r - bevel_run, plastic_h],
    [0, plastic_h],
  ]);

ChatGPT in 2024

My first message to ChatGPT (GPT-4o) was “can you help me make a openscad model for a hole plug with beveled edges?” It got close to the shape I wanted in a few replies, but it couldn’t see what it had made, so I was the renderer. I pasted each version into OpenSCAD, looked at it, and described what was wrong. It turned the taper upside down four times and kept closing the bottom of the stem I’d asked to leave open. It took about 60 messages, including a detour into adding text on top that I dropped, to get a prototype I could print.

That plug was a hollow stem under a solid cone that stood 15 mm above the sidewalk, printed in white PLA, the most common printer filament. I didn’t expect it to last long, since PLA has a reputation for not holding up outdoors, but it fit, and it and its spare each lasted about a year. The cone’s thin edge eventually broke when someone stepped on it, dropping the plug into the hole.

The broken first plug, pieces of white PLA wedged below the surface inside the round hole
The first plug (v1) after it broke, wedged in the hole. Even printed in PLA, it lasted about a year.

Claude Code in 2026

For the second version Claude Code ran the tools instead of me. It rendered the model with OpenSCAD, sliced it in PrusaSlicer (which turns a model into printer instructions) to get print times, and ran a stress simulation in CalculiX to decide how to support the cap. The result is a flat mushroom with a solid cap over radial ribs, printed in PCTG instead of PLA, that stands about 6 mm above the sidewalk. That keeps it under the 1/4 in vertical edge the ADA allows.

Looking back, this is probably a good example of how much tools like Claude Code, which let the model run commands and read their output, changed things over the last year. The model checked its own work instead of waiting for me to describe each render, which is the same idea as giving a coding agent a check to run, applied to a physical part. Whenever the design changed, it re-ran the simulation, which ruled out some of the ideas for making the plug stronger.

The plug went in at the start of November and is holding up so far. The OpenSCAD model, the simulation and the print settings are in pawl/sidewalk-hole-plug.

Using a local LLM to redact text before it goes to a cloud model

I’d like to find more uses for local models, but the open-weight models that come closest to even a small hosted model like Claude Haiku need well over 100 GB of memory. Redacting text before it goes to a cloud LLM doesn’t need a model that smart, so it’s what I use a local model for most. The one I use, Qwen3.8 27B, runs on my 16 GB GPU with llama.cpp, and it caught 38 of 40 fake secrets I planted in my logs.

Where it’s practical, I’d rather not give an LLM personal details the task doesn’t need, which is the least-privilege rule that OWASP’s Top 10 for LLM applications applies to sensitive data. Plenty of people connect Claude to their whole inbox, and that’s a reasonable trade for the convenience, but it’s not one I make. The local model reads the text first and marks what to redact, and only the redacted copy goes to the cloud. Some things will slip through, so this is for text that wouldn’t be a big deal to leak. Anything really sensitive never goes to a cloud model at all, and the local model does the task itself.

Patterns first, then the model

Regexes catch fixed formats like email addresses, phone numbers, account numbers and API keys, and they’re cheap enough to run over everything. Rather than writing my own, I’d start from the pattern recognizers in Microsoft’s Presidio, an open-source detector for personal data, which check card numbers against their checksum and parse phone numbers with Google’s libphonenumber, and gitleaks’ rules for API keys and tokens. They can’t catch values with no fixed shape, like a person’s name, a street address or a password typed into a sentence.

The local model gets the text after the regex pass, with line numbers, and returns what else to redact. This is a cut-down version of my script, for any OpenAI-compatible server such as llama.cpp’s llama-server:

import json, os, urllib.request

PROMPT = """Flag anything in this text that would be harmful if it leaked:
passwords, API keys and tokens, Wi-Fi keys, people's names, street addresses,
public IP addresses, account numbers, government IDs, medical details.
Each line starts with its number and a tab.
For each item give the line number and the exact text copied from that line.

{text}"""

SCHEMA = {"type": "object", "required": ["items"], "properties": {"items": {"type": "array", "items": {
    "type": "object", "required": ["line", "text"],
    "properties": {"line": {"type": "integer"}, "text": {"type": "string"}}}}}}


def flag(lines):
    numbered = "\n".join(f"{i}\t{line}" for i, line in enumerate(lines, 1))
    body = {
        "messages": [{"role": "user", "content": PROMPT.format(text=numbered)}],
        "temperature": 0,
        "max_tokens": 4096,  # a model can loop on a chunk until the context fills
        "response_format": {"type": "json_schema", "json_schema": {"name": "redactions", "schema": SCHEMA}},
    }
    req = urllib.request.Request(f"{os.environ['LLAMA_URL']}/v1/chat/completions",  # e.g. http://localhost:8080
                                 data=json.dumps(body).encode(), headers={"Content-Type": "application/json"})
    choice = json.load(urllib.request.urlopen(req, timeout=900))["choices"][0]
    if choice["finish_reason"] == "length":
        raise ValueError("cut off, so this chunk wasn't reviewed")
    items = json.loads(choice["message"]["content"])["items"]
    # keep a span only if it is really on the line the model named
    return [it for it in items if 1 <= it["line"] <= len(lines) and it["text"] and it["text"] in lines[it["line"] - 1]]


def redact(lines):
    for it in flag(lines):
        lines[it["line"] - 1] = lines[it["line"] - 1].replace(it["text"], "[redacted]")
    return lines

I send 60 to 150 lines per request. The model can hallucinate a match, and without the check in the last line of flag() a hallucinated match would count as a catch even though nothing got redacted.

Measuring what it misses

A model that flags nothing looks fast and clean, so I measure how much it catches with planted values. A script appends fake values (API tokens, passwords, Wi-Fi keys, names and emails, public IPs) to every 15th line of a copy of real log lines. I borrowed the idea from the fake-data generator in Microsoft’s presidio-research, which fills sentence templates with fake personal details. A planted value counts as caught when a flagged span on its line contains it or is part of it. I also compare what each model flagged on the real lines against Qwen3.8 27B, since the planted values are only a few shapes of secret.

These come from several runs on my homelab’s logs, each with 20 or 40 planted values and each timed against Qwen3.8 27B in the same sitting. Gemma 4 26B-A4B and Qwen3.6 35B-A3B are mixture-of-experts models, which use only 4B and 3B of their parameters per token.

ModelPlanted values caughtRun time vs Qwen3.8 27B (lower is faster)
Qwen3.8 27B, quantized to 4-bit20 of 20 in one run, then 36 of 40 and 38 of 40 with two versions of the model file (compared below)1.00x
IBM’s Granite 4.2 8B15 of 201.82x
Google’s Gemma 4 26B-A4B18 of 200.34x, with one chunk timed out
Qwen3.6 35B-A3B36 of 400.64x

Each score is a single run, so a gap of two values could be noise. Qwen3.6 35B-A3B scored about the same as Qwen3.8 on the planted values and ran faster, but it was faster because it flagged less. On the real log lines it flagged a bit over half as many items, and what it skipped included public IPs and DNS names. So before I believe a speedup on this job, I rerun the planted-value test.

Same model, new quantization

The 4-bit file I run comes from Unsloth, which publishes quantized versions of open models. It re-cut Qwen3.8 27B with version 3.1 of its quantization recipe (“Dynamic 3.1”), replacing the 3.0 file:

 Dynamic 3.0Dynamic 3.1
Planted values caught36 of 4038 of 40
Public IPs on the planted copy it missed and the other caughtabout 20about 20
Values on the real log lines it missed and the other caught115
Tokens writtenbaseline11% fewer, so faster

None of the 15 values 3.1 missed was private (mostly the contact URLs web crawlers put in their User-Agent), so I switched to 3.1. A new file under the same model name moved what gets redacted in both directions, so I rerun the planted-value test whenever the model file changes.

Misses add up in long documents

Catching 95% of sensitive values isn’t enough for a document full of them. If a document holds 40, the chance that none slip through is 0.95^40, about 13%. So I don’t send a redacted copy of a document full of personal details at all. I work out what the cloud model needs locally, like a few totals, and send only that. Logs are a better fit, since only a few values per chunk are sensitive and the rest are mostly hostnames.

Dedicated PII models

I haven’t run a dedicated model for personally identifiable information (PII) against my planted values. PrisMark, a small single-author benchmark on synthetic English text, ranked a local LLM first:

ToolKindPrivate values fully maskedPII-like text wrongly flagged (order IDs, public figures)Time per example
Gemma 4 12Blocal LLM93.6%6%1.25 s
NVIDIA’s GLiNER PII modelsmall named-entity recognition model87.9%51%30 ms
Qwen3.5 9Blocal LLM87.3%16%1.25 s
Microsoft’s Presidiorules plus named-entity recognition56.5%56%14 ms

A partly masked name doesn’t count as masked there. My planted-value test counts a partly flagged value as caught, so its scores can’t be compared with this column. The speed gap matters less to me with the GPU otherwise idle. My test doesn’t check for wrongly flagged text, so I don’t know how often my setup over-redacts. Presidio itself can call an LLM, including a local one, as one of its recognizers (docs).

OpenWrt client isolation misses the other band and wired ports

My guest network (its own VLAN and subnet) can talk to the internet but not my other networks. My IoT network for smart plugs and sensors can only talk to Home Assistant, my home automation server. The router’s firewall blocks the rest, but devices on the same subnet talk to each other directly through the access point (AP) or switch, and that traffic never reaches the firewall. A hacked smart plug could still scan the other devices on the IoT network and try to break into them. Client isolation is supposed to stop that.

I think that matters more now than it used to. Every IoT device and computer runs a mountain of software that updates constantly, from vendors with very different standards for vetting their dependency updates. Each update is a chance for a supply chain attack to ship malicious code, so I want each device to reach as little as possible.

If your IoT devices still share a network with your laptops and phones, start there. Most access points and routers can run a second network, often called a guest network, and moving IoT devices onto it keeps them away from everything else.

OpenWrt’s client isolation covered much less than I assumed. This is the usual setting on OpenWrt, the firmware my APs run:

# /etc/config/wireless
config wifi-iface 'guest_2g'
        option device 'radio0'            # the 2.4 GHz radio
        option network 'guest'
        option mode 'ap'
        option ssid 'Guest'
        option isolate '1'

LuCI, OpenWrt’s web UI, describes it as “Prevents client-to-client communication” (wireless.js). It only stops two clients on the same radio of the same AP from talking. A phone on the guest network’s 2.4 GHz band can still reach a laptop on its 5 GHz band, because each band is a separate Wi-Fi interface. Devices plugged into the AP’s wired ports aren’t covered either.

Bridge port isolation

Inside the AP, a Linux bridge connects each network’s Wi-Fi interfaces and wired ports, and it can mark any of them as isolated. An isolated port can only talk to ports that aren’t isolated (bridge(8)). Isolate every port clients use and leave the AP’s uplink to the router alone, and clients can reach the router but not each other.

For a wired port, set it in /etc/config/network, or from the port’s “Bridge port specific options” tab in LuCI:

# /etc/config/network
config device
        option name 'lan3'                # a wired port on the AP
        option isolate '1'

service network reload applies it, and drops the AP’s ports for a few seconds. To try it first, echo 1 > /sys/class/net/lan3/brport/isolated sets the same flag until the next reboot, and it works on a wireless interface’s port too (named like phy0-ap0).

For Wi-Fi, set bridge_isolate on each band’s wifi-iface (“Isolate Bridge Port” in LuCI 25.12) and run wifi reload. It needs OpenWrt 23.05.3 or later. The “Bridge port specific options” tab has no effect on Wi-Fi interfaces (openwrt#14671).

# /etc/config/wireless
config wifi-iface 'guest_2g'
        # ...
        option isolate '1'
        option bridge_isolate '1'

Keep both anyway. bridge_isolate alone also blocks two clients on the same radio, because OpenWrt already sends their traffic through the bridge for its multicast-to-unicast feature (netifd-wireless.sh). isolate '1' keeps that true if multicast-to-unicast is ever turned off, since the radio then forwards between its own clients without the bridge seeing it.

Isolating wired ports also depends on the AP’s switch chip, since not every chip’s driver supports it. My APs’ MediaTek chip supports it (mt7530.c), but I didn’t trust that until the test below showed the ports couldn’t reach each other. If you don’t know your AP’s chip, the test tells you.

A guest client on one AP can still reach a guest client on another AP, because that traffic arrives through the uplink, which isn’t isolated. The fix is the same flag one hop further out. My APs are daisy-chained, so I isolated each AP’s downlink port (the one feeding the next AP) and left every uplink alone. Clients still reach the router, and anything wired past it, but not each other. With APs on a switch instead, the switch ports facing the APs are the ones to isolate, as long as the switch supports it.

Testing isolation with the neighbor table

A failed ping proves nothing, because the other host’s firewall can drop ICMP, so read the neighbor (ARP) table instead. Run this against a target you know is up, from a machine that’s only on the network you’re testing. Put the two machines on ports you just isolated, and repeat it for each path you care about, like the other band, wired to Wi-Fi, and wired to wired.

sudo ip neigh flush to 192.0.2.20    # drop any entry cached before you enabled isolation
ping -c 3 192.0.2.20
sleep 10                             # gives the new ARP attempt time to fail
ip neigh show 192.0.2.20

FAILED or INCOMPLETE means the ARP request never got an answer, so the bridge dropped it. A MAC address in REACHABLE or STALE means the two hosts met at layer 2 and only the ping was refused. On macOS the blocked case reads (incomplete) in arp -n 192.0.2.20, and on Windows the address is missing from arp -a. The flush is sudo arp -d 192.0.2.20 on macOS and arp -d 192.0.2.20 from an admin prompt on Windows.

Containers sharing a macvlan parent have the same problem one layer down, and macvlan private mode is the fix there.

Keeping an LLM wiki in a git repo

Note-taking apps like Joplin and Obsidian never stuck for me. Writing a note is quick, but keeping notes current and linked to each other is ongoing work, and Andrej Karpathy’s LLM wiki gist says that upkeep is why people abandon their wikis. What has lasted is letting a coding agent (Claude Code) write my research notes as markdown docs in a git repo and maintain them. I wrote a bit about this recently before I knew Karpathy had named the pattern an LLM wiki.

The agent maintains a wiki for you. It condenses your source material into linked pages of facts, you change the pages by asking it rather than editing them yourself, and each new session reads them for context instead of starting from scratch. The sources themselves stay untouched (mine are web pages the docs link to and measurements from my own setup).

A session can’t reread hundreds of pages of source material every time, and models get worse as their input grows (Chroma’s context rot study), so it reads the condensed pages instead. A note app only stores notes, while the agent can answer questions from them, act on what they say, and ask me about what’s missing.

The agent reads an instructions file at the start of every session (AGENTS.md in the repo root). These lines from mine, shortened, tell a new session where the docs are and how to write them:

Decision docs live under `research/`, listed in `research/README.md`.

## Docs

- Each fact has one home. A new fact joins the doc that already covers its
  topic; start a new doc only when I ask for one.
- Add each fact as soon as you learn it, and reread the whole doc before
  committing.
- Say where each claim comes from. It was measured here, comes from a source
  you opened and link, or is marked untested.
- Drop history. State the current reality and its reasons; git keeps the rest.

The gist also keeps an index.md listing every page and a log.md of what changed. That README stands in for the index, and git log for the log.

He also has the agent lint the pages periodically for contradictions and orphans (pages nothing links to). I don’t schedule that, and rely on the reread after each change, which only covers the doc being edited.

Run a GitHub Actions workflow manually with workflow_dispatch

CI in my private repos ran twice for every change, once on the pull request and again on main after the merge, and GitHub counts Actions minutes in private repos against a monthly quota. I took the push trigger out and added workflow_dispatch, which lets me start the workflow by hand, so I can still run CI on main when I want to:

on:
  pull_request:
  workflow_dispatch:   # works alongside any other trigger; here it replaced push: branches: [main]

A manual run only works once the workflow file with workflow_dispatch is on the default branch (main here). After that, open the repo’s Actions tab, pick the workflow, click Run workflow above the list of runs, and choose main as the branch (GitHub’s docs). The GitHub CLI (gh) does the same from a terminal:

gh workflow run test.yml --ref main   # test.yml is the file in .github/workflows/, --ref the branch to run on

Dropping the run on main loses little test coverage, because a pull_request run tests a trial merge of the branch into main as main stood at that run, not the branch alone. The exception is two pull requests that each pass on their own and break main once both merge, which nothing catches until the next pull request’s CI runs. A manual run on main is the check for that after a few pull requests merge close together, or when a pull request fails and it isn’t clear whether main was already broken. GitHub’s merge queue catches that case before the merge, but it isn’t available for repos on a personal account.

SSH keys in the Mac's Secure Enclave without third-party tools

I wanted an SSH key that can’t be copied off my Mac and that nothing can use without Touch ID, so a process running as me (a coding agent, say) can’t log in to a server on its own. macOS Tahoe can keep the private key in hardware, in the Secure Enclave, using only built-in tools. I followed arianvp’s gist.

# creates the key in the Secure Enclave
# -l ssh is its label, -k p-256-ne a non-exportable P-256 key, -t bio Touch ID on every use
sc_auth create-ctk-identity -l ssh -k p-256-ne -t bio
# -w loads macOS's library that presents the enclave as a hardware security key (like a YubiKey)
# -K writes a reference to the key into the current directory, named after the label (id_ecdsa_sk_rk_ssh)
# it asks for a security-key PIN, but there isn't one, so a blank Enter answers it
cd ~/.ssh && ssh-keygen -K -w /usr/lib/ssh-keychain.dylib -N ""
ssh-copy-id -i ~/.ssh/id_ecdsa_sk_rk_ssh.pub user@server.example.com

That file holds no secret, so it needs no passphrase. Servers see an sk-ecdsa-sha2-nistp256@openssh.com key, the same type a FIDO security key uses.

Before changing your SSH config, check the key works on that server. -F /dev/null ignores the config, so no other key can be the one that logs you in:

ssh -F /dev/null -o IdentitiesOnly=yes -o SecurityKeyProvider=/usr/lib/ssh-keychain.dylib -i ~/.ssh/id_ecdsa_sk_rk_ssh user@server.example.com true

Then point ~/.ssh/config at it:

Host *
  SecurityKeyProvider /usr/lib/ssh-keychain.dylib
  IdentityFile ~/.ssh/id_ecdsa_sk_rk_ssh
  # without it, ssh logs in with any key sitting in ssh-agent instead, with no Touch ID prompt
  IdentitiesOnly yes

As a personal preference, I also share one connection per host to cut down the prompts. With these lines under Host *, Touch ID asks once per host and not again until the connection has sat idle for four hours, but while it’s open any local process can use it without a prompt:

  ControlMaster auto
  ControlPath ~/.ssh/cm-%C
  ControlPersist 4h

Downsides

  • The key can’t be backed up or moved, so authorize a second key on each server, or a dead Mac leaves you adding a new one from the console. The gist also shows an exportable variant (-k p-256) if you want a backup.
  • Touch ID has to be reachable. With the lid closed, macOS reports Touch ID is not available in closed clamshell mode and doesn’t fall back to the Mac’s password (Alex Haydock hit this).
  • The enclave makes only P-256 keys, and a server that doesn’t support sk-ecdsa keys won’t take it. OpenWrt 25.12 (router firmware) builds its SSH server without ECDSA (Config.in), so it still needs an ordinary ed25519 key file.
  • The Touch ID prompt doesn’t mention SSH. It names an internal macOS process instead (Serge Gatezh’s post has a screenshot). I hope Apple fixes that, and if not I may move to Secretive, an app that keeps keys in the Secure Enclave and shows a clearer prompt.

Setting up a game for coding agents

Kyle Kukshtel’s article on agentic game development has good recommendations for setting up a game so a coding agent can work on it, starting at its “Let’s Make a Game Legible To AI Agents” section. A lot of them aren’t intuitive if you don’t usually do game development:

  • Pull every random number from one seeded source, so any game state can be reproduced.
  • Build save and load early, so an agent can get back to the same state after each code change.
  • Make every change to game state a data object like {"type": "move", "unit": 3, "to": [4, 5]} instead of a function call, which is the command pattern. Logging the objects as the game runs lets you replay a bug from a saved state, and an agent can write its own list and play it back.
  • Run the simulation (the game’s rules) as its own library, so it can be tested without a game engine.

Giving the agent eyes through screenshots comes naturally if you usually do web development. The article adds using odiff to diff each screenshot against a target image of how it should look, which gives the agent a percentage of differing pixels to drive down.

Used HP Desktop Minis beat thin clients for a homelab in 2026

The best value I’ve found this year for a homelab server is a used HP Desktop Mini (the “DM” in the model names) from the G4 generation, which shipped with Intel 8th-gen Core chips. It’s a mini PC rather than a thin client, but it sells used for close to thin-client prices. I bought two, a ProDesk 400 G4 and an EliteDesk 800 G4, to replace the Dell Wyse 5070 and OptiPlex 3000 thin clients from my last post about them.

The thin clients are the cheaper, low-power tier:

  • The Dell Wyse 5070 ($43 with 8GB, + $15 for a power adapter) has a 4-core Celeron J4105 that scores 1,060 single-thread and 2,807 multi-thread on PassMark. It takes an M.2 SATA drive but no NVMe.
  • The Dell OptiPlex 3000 thin client ($84 with 16GB) has a 4-core Pentium Silver N6005 at 1,763 and 5,225. Its one NVMe slot officially takes only the short 2230 (30mm) size.

The HP Desktop Minis cost a little more and score 1.5 to 3.4 times as high as the thin clients on multi-thread:

  • The HP ProDesk 400 G4 DM ($85.49 with 16GB and no drive, + $31.73 for a 256GB NVMe and about $10 for a 65W power adapter) has a 6-core Core i5-8500T at 1,998 and 7,734, and one full-length 2280 (80mm) NVMe slot.
  • The HP EliteDesk 800 G4 DM ($109.99 with 8GB and a 512GB NVMe, + $15.98 for a 90W power adapter) has a 6-core Core i5-8500 at 2,428 and 9,499, and two 2280 NVMe slots.

Besides the speed, both i5s have AVX2, the vector instructions some software requires. The thin clients’ Celeron and Pentium Silver chips have no AVX at all (Intel confirms it for the N6005). That rules them out for the Frigate security camera recorder, for one, which crashes at startup with Illegal instruction on a CPU without AVX.

eBay sellers price RAM inconsistently, and a 16GB unit is often listed at or below the 8GB one, so sort by model and open each listing instead of filtering for 8GB to save money. The ProDesk 400 is HP’s budget line, with DDR4-2400 rather than 2666 and no vPro, Intel’s remote management that gives you a console on a headless box. If you want vPro, step up to the ProDesk 600 G4 or the EliteDesk 800 G4.

Most of these ship without a power adapter, and the right one depends on the CPU’s wattage. The ProDesk’s 35W i5-8500T runs on HP’s 65W adapter. The EliteDesk’s 65W i5-8500 needs the 90W adapter (19.5V, 4.62A). I bought the 65W one for the EliteDesk first, and it wouldn’t boot. There was no video, just the power LED blinking and the beeper going three long, three short. HP’s beep and blink code page lists that as code 3.3, a timeout during graphics initialization, so nothing about it points at the power adapter. On the 90W adapter it booted and passed MemTest86. Check the barrel too. Both of mine take the 7.4mm tip, and HP sells the same wattages with a 4.5mm blue tip. The model number won’t tell you the tip. The blue-tip 90W I bought by mistake says PPP012C-S, and HP sells 7.4mm 90W adapters under the same number, so go by the tip in the listing photo.

Dell’s OptiPlex 3060 and 7060 Micro are the same 8th-gen class, and so is Lenovo’s ThinkCentre M720q. The Lenovos list for a lot more than the HPs and Dells with similar hardware, though the M720q is the only one of these that takes a PCIe card, through a riser on its internal x8 slot (ServeTheHome’s review). When I checked listings in August, a 10th-gen i5-10500T with 16GB and 512GB (an HP ProDesk 600 G6 or EliteDesk 800 G6) ran about $200 delivered, and the cheapest 12th-gen equivalent, a Lenovo ThinkCentre M80q Gen 3, came to roughly $290 once matched on RAM. lowcostminipcs.com aggregates the eBay listings, but its prices leave out shipping.

Unlike the thin clients, the HPs have a fan, and they draw about twice the power at idle. ServeTheHome measured 11-12W on a six-core EliteDesk 800 G4 and 10-11W on a ProDesk 400 G4, against 4.9W at long idle in the Wyse 5070’s Energy Star listing. I haven’t put any of mine on a meter yet.

Getting a Victron solar system into Home Assistant was easier than I expected

I have a small off-grid Victron solar system, just a fun science project. I wanted data like the current battery level in Home Assistant, so I could trigger alerts and turn things on when the battery level is high. I figured getting the data in would mean running something new, like a script polling the gear or something over Bluetooth. Venus OS, Victron’s monitoring firmware, already runs a Modbus/TCP server, though, and Home Assistant’s built-in modbus integration reads it with one config block.

The hardware is a BMV-712 shunt (the battery monitor), SmartSolar MPPT chargers, and a Phoenix inverter, all reporting to Venus OS on a Raspberry Pi Zero 2 W. Victron ships Venus OS on its Cerbo GX monitoring box, and it works fine on the Pi with a powered USB hub for the VE.Direct-to-USB cables (VE.Direct is the serial port on each Victron device).

Only one of the Pi’s two micro-USB ports carries data, the one next to the mini-HDMI, and the corner port is power-only. The Pi also has no Ethernet, and its one data port can’t both power it and run devices. A SMAYS “Micro USB OTG to Ethernet Adapter with Powered Hub” handles all of that. It plugs into the data port, back-powers the Pi, and splits the single USB controller into a 10/100 Ethernet jack and three USB-A ports. Its limit is three ports on a tight power budget, so mine runs three VE.Direct-to-USB cables plus Ethernet and drops the fourth device. I’m switching to a DuPPa USB Quadport VE.Direct instead of adding a second hub, since it puts all four isolated ports on one USB device.

Keep the Pi on that Ethernet link. Venus OS on the Pi won’t join a WiFi network with Protected Management Frames (PMF, 802.11w) enabled, even in optional mode, because it builds wpa_supplicant without PMF support. The handshake never completes, and the access point logs a password mismatch even though the password is right. Turning PMF off on the access point fixes it, but Ethernet avoids the problem.

Turn on Modbus/TCP in Venus OS under Settings > Services > Modbus/TCP. None of this needs internet, so the Pi can stay offline if you don’t mind losing VRM, Victron’s cloud dashboard. Mine has no internet access, and Home Assistant reads it over the LAN.

Every register in my configuration.yaml comes from Victron’s attributes.csv. Unit ids (the slave: key) come from unitid2di.csv. Unit id 100 reads the system service, Venus OS’s summary of the whole system, and a VE.Direct-to-USB device’s unit id depends on the USB port it enumerates on:

modbus:
  - name: victron
    type: tcp
    host: 192.0.2.21     # Venus OS on the Pi, isolated IoT network
    port: 502
    sensors:
      - name: "Battery SOC"
        slave: 100         # system service, follows the battery monitor selected in Venus OS
        address: 843       # /Dc/Battery/Soc
        input_type: holding
        unit_of_measurement: "%"
        device_class: battery
        state_class: measurement
        precision: 0
        scan_interval: 30
      - name: "Battery Voltage"
        slave: 100
        address: 840       # /Dc/Battery/Voltage
        input_type: holding
        unit_of_measurement: "V"
        device_class: voltage
        state_class: measurement
        scale: 0.1
        precision: 1
        scan_interval: 30
      - name: "Battery Power"
        slave: 100
        address: 842       # /Dc/Battery/Power, signed
        input_type: holding
        data_type: int16
        unit_of_measurement: "W"
        device_class: power
        state_class: measurement
        scan_interval: 30
      - name: "Solar PV Power"
        slave: 100
        address: 850       # /Dc/Pv/Power
        input_type: holding
        unit_of_measurement: "W"
        device_class: power
        state_class: measurement
        scan_interval: 30
      - name: "MPPT State"
        slave: 238         # solarcharger on ttyUSB1, per unitid2di.csv
        address: 775       # /State: 3=bulk, 4=absorption, 5=float
        input_type: holding
        scan_interval: 30

Here are the Home Assistant automations that go with this:

# automations.yaml
- alias: Victron Battery Low
  trigger:
    - platform: numeric_state
      entity_id: sensor.battery_soc
      below: 30            # fires once on the downward crossing, not every poll
  action:
    - service: notify.mobile_app_phone
      data:
        title: "Battery low"
        message: "Solar battery at {{ states('sensor.battery_soc') }}%"

- alias: Victron Battery Critical
  trigger:
    - platform: numeric_state
      entity_id: sensor.battery_soc
      below: 20
  action:
    - service: notify.mobile_app_phone
      data:
        title: "Battery critical"
        message: "Solar battery at {{ states('sensor.battery_soc') }}%"
        data:
          channel: alarm_stream_max   # bypass Do Not Disturb (Android)
          ttl: 0
          priority: high

The HACS (Home Assistant Community Store) integration hass-victron auto-discovers every register as an entity. It also pins a newer pymodbus that disables Home Assistant’s built-in modbus, and that’s more to maintain than five sensors need. Victron’s first-party Bluetooth integration reads a shunt directly into Home Assistant, and it’s the better choice for a standalone shunt with no Venus OS device. Modbus added the least here, since the Pi already runs Venus OS.

Every Home Assistant notification opened the default dashboard

Tapping any Home Assistant notification on my Android phone opened the app on the default dashboard, until I set clickAction:

action: notify.mobile_app_your_phone   # your phone's notify service
data:
  message: Freezer is warming up
  data:   # the inner data holds the app's options
    # opens the sensor's details popup (more-info dialog)
    clickAction: entityId:sensor.freezer_temperature

The value is templated server-side like any other field, so an automation that triggers on several entities can open whichever one tripped with clickAction: 'entityId:{{ trigger.entity_id }}'.

clickAction also takes a view on the default dashboard like /lovelace/freezer, where freezer is the view’s path, or a full URL, and the notification docs list the other targets. On iOS the key for a path or URL is url, and opening an entity takes entity_id: sensor.freezer_temperature in the same inner data with no url set.