<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="/feeds.xsl" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:base="https://chameth.com/">
    <title>Chameth.com - posts like infinite-avatars, sense-api but not debugging-beyond-the-debugger, why-you-should-be-using-https</title>
    <subtitle>Personal homepage of Chris Smith</subtitle>
    <link href="https://chameth.com/feeds/posts/like/infinite-avatars,sense-api/unlike/debugging-beyond-the-debugger,why-you-should-be-using-https/" rel="self"/>
    <link href="https://chameth.com/"/>
    <icon>https://chameth.com/favicon.png</icon>
    <updated>2026-08-27T00:00:00Z</updated>
    <id>https://chameth.com/</id>
    <author>
        <name>Chris Smith</name>
    </author>
    <entry>
        <title>Building a family of single-user services</title>
        <link href="https://chameth.com/building-a-family-of-single-user-services/"/>
        <updated>2026-08-27T00:00:00Z</updated>
        <id>https://chameth.com/building-a-family-of-single-user-services/</id>
        <content xml:lang="en" type="html">&lt;p&gt;Last month I &lt;a href=&#34;https://chameth.com/tracking-pbs-without-the-dark-patterns/&#34;&gt;made and wrote about&lt;/a&gt; a personal service
to track my workouts and record personal bests. Since then, things have escalated. I now have eight different
services running in the same “family”:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Collegiate Room&lt;/td&gt;
&lt;td&gt;Simple weather overview for my current location&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;German Mall&lt;/td&gt;
&lt;td&gt;LLM broker for use by other services&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gloss White&lt;/td&gt;
&lt;td&gt;Weight tracking&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Olive Crosses&lt;/td&gt;
&lt;td&gt;Central service hub&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pompei Band&lt;/td&gt;
&lt;td&gt;Workout and personal best tracking&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Speed Carp&lt;/td&gt;
&lt;td&gt;Spaced repetition system&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tiger Island&lt;/td&gt;
&lt;td&gt;Reading history and library tracking&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Typical Horse&lt;/td&gt;
&lt;td&gt;Location history and analytics&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The names are all anagrams of something related to their function. Finding those anagrams brings me an unreasonable
amount of joy. Unscrambling them is an exercise left to the reader. On top of those eight, I currently have four other
service ideas sat in my todo list. It’s going to be a big family.&lt;/p&gt;
&lt;h3 id=&#34;a-postmortem-on-the-previous-hodge-podge&#34;&gt;A postmortem on the previous hodge-podge&lt;/h3&gt;
&lt;p&gt;Most of this functionality isn’t new to me. When I started out playing around with LLMs, I created a “personal data
aggregator” that just kept getting things bolted on. I &lt;a href=&#34;https://chameth.com/an-app-can-be-a-ready-meal/#what-ive-made&#34;&gt;said at the time&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;My biggest just-for-me project is a web app that I started to help me aggregate film recommendations. It’s since morphed into a general personal data aggregation service: it deals with data from GitHub, Todoist, Letterboxd, TMDB, Healthkit, and others. It also lets me make re-orderable lists, store recipes, and more. Parts of this could definitely be open sourced, and I might carve them out at some point, but it’s mostly a glorious hodge-podge of things specific to me. Having all these services in one place lets me make quick and dirty automations, for example: when I create a Todoist note on my phone or watch, I often forget to set the due date, so it doesn’t show up in the “Today” view. It was literally a few lines of code to plumb things together so any inbox task without a due date gets set to today automatically.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In a twist that &lt;em&gt;nobody&lt;/em&gt; could see coming, it turns out that a “glorious hodge-podge” is actually quite hard to maintain
and very annoying to work with. It didn’t help that it had a fairly extensive Svelte frontend and I really am not a fan
of JavaScript. I ended up using it less and less just because it wasn’t fun to use or work on, and I didn’t want to
waste the limited LLM tokens on doing massive refactors or reworks.&lt;/p&gt;
&lt;p&gt;I’ve got almost two decades of professional software development experience under my belt, so you’d think I would
have learnt the lessons on how to write maintainable software. Hell, my CV even mentions that as something I’m
particularly good at. So what went wrong?&lt;/p&gt;
&lt;p&gt;There were a few factors. One of the obvious things to blame is that it was written mostly with LLMs.
Most of that blame isn’t very honest, though. In the year or so since, LLMs have definitely got better at writing
good code; but I was manually reviewing all the code at the time, and telling it quite carefully what to implement
and how to do it. So the buck really stops with me.&lt;/p&gt;
&lt;p&gt;I think it’s actually more because it was my &lt;em&gt;first&lt;/em&gt; larger project using LLMs. It’s a bit like learning a new
programming language. I don’t think the first sizable project I’ve written in any language has ever been any
good. You can read and learn as much as you want, but you need to actually run into some problems headfirst to
get a grip on how the language works. Or at least I do. LLM coding agents are basically the same deal.&lt;/p&gt;
&lt;p&gt;What the LLMs actually did was mask several problems. The architecture wasn’t right for how the service developed.
It started out as a single-purpose app and gradually got things bolted on, without any major changes. Everything
ended up in horizontal slices: a massive database layer with every query used by every part of the app, a massive
HTTP layer, and so on. Working on a single feature became a tap dance all over the source tree. This sort of
friction is normally quite apparent when you’re writing code by hand, and at some point it hurts enough that
you throw in the towel and do some refactoring. But the LLM will happily plod on without exposing that pain,
so the project needed a more active kind of architecture management that it just didn’t get.&lt;/p&gt;
&lt;p&gt;The other problem they covered up was how brittle and unmaintainable the JavaScript frontend was. I’m not
even sure how I ended up with a Svelte frontend in hindsight. It’s my preferred framework, but I still only
reach for it as a last resort when there’s no other way to avoid using one. It seems like there were lots of
ways to avoid it here, but I seem to have… well… avoided them. Anyway, each feature got its own slew of
Svelte components, without much thought to reusability, shared patterns, or anything sensible. Some of them
were just thin wrappers around data supplied by Go, others had vast swathes of logic in them, with no real
rhyme or reason as to which way that would fall. It’s the same issue as before: a human would look at it,
say “WTF?” and suggest tidying it up; instead, the LLM just gets on with what you tell it to do.&lt;/p&gt;
&lt;p&gt;There’s also a big non-LLM factor: one of the primary reasons all of this unrelated functionality got
tossed into the same app was that I’d previously worked on a few projects with a microservice architecture
and really didn’t like it. My conclusion was they only really worked in large environments where you can
dedicate people or teams to working on all the boilerplate that happens from maintaining lots of
interconnected projects. Dumping everything and the kitchen sink into one badly architected monolith was,
perhaps, not the best rebound from that.&lt;/p&gt;
&lt;h3 id=&#34;pompei-band-and-beyond&#34;&gt;Pompei Band and beyond&lt;/h3&gt;
&lt;p&gt;When I wanted to implement &lt;del&gt;Strava at home&lt;/del&gt; my PB tracking app, it seemed fairly natural to build it out
as a new service, rather than bolt it on to the slowly decomposing hodge-podge that was giving off a funny
smell. Then when I wanted a weather dashboard, why not do it in the same style as Pompei Band? The same
serving architecture, the same page layout… I could even come up with a similar weird two-word name!&lt;/p&gt;
&lt;p&gt;Then wouldn’t it be nice if the weather dashboard knew where I was, so it could show the local weather?
I could just build that functionality in, but it’d also be a good opportunity to carve out the location
history feature from my old service and make a new, shinier one. Then basically every time I even thought
about going near the old service, I mentally sketched out a replacement service.&lt;/p&gt;
&lt;figure class=&#34;image right&#34;&gt;
  &lt;picture&gt;
      &lt;source srcset=&#34;https://chameth.com/building-a-family-of-single-user-services/oc.avif&#34; type=&#34;image/avif&#34;/&gt;
      &lt;source srcset=&#34;https://chameth.com/building-a-family-of-single-user-services/oc.webp&#34; type=&#34;image/webp&#34;/&gt;
      &lt;img src=&#34;https://chameth.com/building-a-family-of-single-user-services/oc.png&#34; alt=&#34;A screenshot of Olive Crosses, showing links to other services with icons based on their two-word names&#34; loading=&#34;lazy&#34; width=&#34;1230&#34; height=&#34;619&#34;/&gt;
  &lt;/picture&gt;
  &lt;figcaption&gt;&lt;p&gt;Olive Crosses showing links to the other services&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;At one point I had the thought that it’d be nice if the services could all link to one another, but I
didn’t want to have to touch every service whenever I added a new one. So I made a “hub” service, which
maintains the One True Catalogue, and provides a bit of JavaScript the others can all embed to add a
navigation sidebar.&lt;/p&gt;
&lt;p&gt;So after complaining about microservices and JavaScript, it sounds like I have landed on microservices
(or at least miniservices) and JavaScript? Sort of yes, but sort of no. Each service is still its own
thing and makes sense independent of the others. There are some cross-service dependencies, but they’re
very simple and don’t have the same cognitive or boilerplate overhead as a login service that talks to
an authentication service that queries a user manager and so on. And as for the JavaScript, it’s almost
exclusively used for progressive enhancement and a few limited client-side visual things like
maps and graphs. All of the logic lives in Go, which is a lot easier to maintain and test, and all of
the pages are simple Go templates.&lt;/p&gt;
&lt;p&gt;Having these services built in a way that I actually like has motivated me to play around a lot more
with new features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;My workout tracking app pulls photos from my private &lt;a href=&#34;https://immich.app&#34;&gt;Immich&lt;/a&gt; server that were
taken during workouts, and shows them alongside. Now I can see all my obligatory end-of-run selfies
in one place.&lt;/li&gt;
&lt;li&gt;The location history app can detect trips away from home, and get an LLM to automatically title them.
My most recent, very exotic, trip has the title “A fortnight in Milton Keynes and Coventry”. Each
trip gets its own little map, and in the future I want to pull in images like with workouts.&lt;/li&gt;
&lt;li&gt;My weight tracking app now exports weigh-ins to Garmin, as it doesn’t fully integrate with Apple
Health (it will export its own weights, but not import others, like the ones from my Withings scales).
Stupid walled gardens, but thankfully I can fix it myself.&lt;/li&gt;
&lt;li&gt;My book tracking app automatically cleans up the titles of books from the nonsense provided by Amazon
to something more palatable. “Killing Eve: Long Shot: A twist on obsession, betrayal and revenge from
Luke Jennings, author of the TV sensation Killing Eve” becomes “Long Shot (Killing Eve #5)”. It does
this by passing the title to an LLM with a bunch of rules.&lt;/li&gt;
&lt;li&gt;The hub generates me a snippet of Tailscale configuration that defines the minimal grants needed to
allow the intra-service dependencies to work.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The LLM integrations were inspired by my friend &lt;a href=&#34;https://dataforce.org.uk/&#34;&gt;Shane&lt;/a&gt; who recently
demonstrated an inventory tracking app he’d made, which used Haiku to process images of boxes and
describe the contents. I’ve dabbled with LLM integration before, and always disliked the process
of fiddling with the prompts, and debugging when the LLM gave a nonsensical response. So I built
German Mall, which makes it a lot easier. It lets me define a “workflow” consisting of a system
prompt, initial message, and expected response format. I can browse past runs, tweak the prompt,
rerun them to see the change, all without touching the services using them. Quick iteration loops
are the best. German Mall also provides markdown documentation for each workflow, so integrating
it downstream is simply a case of pointing a coding agent at the right documentation endpoint.&lt;/p&gt;
&lt;figure class=&#34;image full&#34;&gt;
  &lt;picture&gt;
      &lt;source srcset=&#34;https://chameth.com/building-a-family-of-single-user-services/gm.avif&#34; type=&#34;image/avif&#34;/&gt;
      &lt;source srcset=&#34;https://chameth.com/building-a-family-of-single-user-services/gm.webp&#34; type=&#34;image/webp&#34;/&gt;
      &lt;img src=&#34;https://chameth.com/building-a-family-of-single-user-services/gm.png&#34; alt=&#34;A screenshot of German Mall, showing the workflow configuration for tidying book titles: a form with fields for description, system prompt, user template, output schema, model, max tokens and temperature.&#34; loading=&#34;lazy&#34; width=&#34;1482&#34; height=&#34;1080&#34;/&gt;
  &lt;/picture&gt;
  &lt;figcaption&gt;&lt;p&gt;The “tidy book titles” workflow in German Mall&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;It’s not all fun and games: having a bunch of services all following the same pattern means
you need to do cross-cutting maintenance on them now and then. But that’s surprisingly easy with LLMs.
I put all the projects in a common folder, and I launch cross-cutting tasks from that folder. Usually
I’ll make the change in one project, and then the cross-cutting task is simply “Look at commit XYZ in
./foo, make the same change to the other projects”.&lt;/p&gt;
&lt;p&gt;I’ve also ended up with a shared library used by all the projects to cut down on some boilerplate.
That’s normally something I’d resist, especially with personal projects, just because the extra overhead
of working in a separate project, managing releases of it, and so on, is a bit annoying. But, again,
LLMs can do almost all of that grunt work. They effectively reduce the “cost” of maintaining separate
services to a negligible level, leaving me to focus on the more fun aspects like coming up with new names.&lt;/p&gt;
</content>
    </entry>
    <entry>
        <title>10 Weeks with an Apple Watch 10</title>
        <link href="https://chameth.com/10-weeks-with-an-apple-watch-10/"/>
        <updated>2025-09-09T00:00:00Z</updated>
        <id>https://chameth.com/10-weeks-with-an-apple-watch-10/</id>
        <content xml:lang="en" type="html">&lt;figure class=&#34;image right&#34;&gt;
  &lt;picture&gt;
      &lt;source srcset=&#34;https://chameth.com/10-weeks-with-an-apple-watch-10/watch.avif&#34; type=&#34;image/avif&#34;/&gt;
      &lt;source srcset=&#34;https://chameth.com/10-weeks-with-an-apple-watch-10/watch.webp&#34; type=&#34;image/webp&#34;/&gt;
      &lt;img src=&#34;https://chameth.com/10-weeks-with-an-apple-watch-10/watch.jpg&#34; alt=&#34;An Apple Watch 10 being worn, with a blue analogue clock on the display, and icons/data shown in the corners&#34; loading=&#34;lazy&#34; width=&#34;500&#34; height=&#34;644&#34;/&gt;
  &lt;/picture&gt;
  &lt;figcaption&gt;&lt;p&gt;My watch. Yes, I am available for wrist modelling opportunities.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Around ten weeks ago&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:1&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; I picked up an Apple Watch 10, and have been wearing
it almost constantly since. It’s not my first Apple Watch — I had a Series 5
for a bit back in 2020 — but it’s the first time I’ve actually stuck with it.
Ten weeks seems like an apt time to reflect on it.&lt;/p&gt;
&lt;p&gt;Firstly, why did I even bother? Well, for a couple of years I’d been wearing
a Xiaomi Smart Band 7, mainly to monitor my sleep stats and set alarms that
won’t wake up everyone else nearby. Its battery life was fantastic — with
notifications and other things turned off, I got about a month of use between
charges — but actually using it felt like trying to order food via the medium
of interpretive dance.&lt;/p&gt;
&lt;p&gt;My biggest gripe was the screen lock. If I didn’t have the screen locked then
I’d periodically trigger it during the night when I moved around
and it came in contact with my chest or leg. With the lock enabled you had to
deliberately swipe up from bottom to top to enable interaction, but it
didn’t work reliably. When I wanted to adjust an alarm, I’d be stood swiping
repeatedly trying to get it to respond. When you finally get it unlocked, the
whole interface is just &lt;em&gt;fiddly&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;The other issue was the data quality. There were some nights when I’d been
woken up, sometimes even getting up and moving around, and it just didn’t show
it in the data. If it can’t even get whether I’m asleep right, can I trust
anything else it says?&lt;/p&gt;
&lt;p&gt;I spent a while researching the best devices for sleep tracking. The Oura ring
came highly recommended, but it was expensive and required a subscription to
do anything useful. No thanks! The Apple Watch was consistently rated pretty
well, and I reasoned I could pick up a refurbished older unit. I’ve been
&lt;a href=&#34;https://chameth.com/apple-google-aligned-incentives/&#34;&gt;using an iPhone as my daily driver&lt;/a&gt; for
a while, so it’d fit right into my begrudged walled garden.&lt;/p&gt;
&lt;p&gt;The Series 10 has a significant advantage, though: it charges much quicker than
all the previous generations. On a 30-minute charge, the Series 10 can go from
0 to 60%; the 9 can only make it to 40%, and my old 5 a measly 30%. Shorter
charge times means I’m far less likely to leave it on charge and wander off
without it. In some ways the daily charging is more convenient than monthly: the
wireless charger sits on my desk, and I plop the watch on it for a little while
in the evening; I don’t need to dig out the weird pogo-pin connector that has
vanished sometime in the last four weeks, then carefully arrange it so it stays
attached.&lt;/p&gt;
&lt;h3 id=&#34;how-a-watch-maybe-saved-my-life&#34;&gt;How a watch maybe saved my life&lt;/h3&gt;
&lt;p&gt;One of the big features of the Apple Watch, like many other wearable devices,
is health and fitness tracking. I didn’t think much about this, beyond the
sleep data I wanted, at first. I’ve never had a particularly good relationship
with exercise&lt;sup id=&#34;fnref:2&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:2&#34; role=&#34;doc-noteref&#34;&gt;2&lt;/a&gt;&lt;/sup&gt;, but I do like some good statistics. I started going for
walks more often to get more data and see the graphs of VO2 max and HR recovery
gradually inch up. That wasn’t the most profound effect on my health, though…&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;The recent versions of the Apple Watch have a feature that monitors for sleep
apnea, a disorder where you don’t breathe properly during your sleep. I knew
I wasn’t sleeping great — that’s why I was paying attention to sleep tracking
data — but was still a bit surprised to get a notification from Apple Health
after wearing the watch for 30 days. It gives you a graph to print and take to
your doctor. So I diligently booked an appointment and a few weeks later went
to see my GP.&lt;/p&gt;
&lt;p&gt;The appointment went about as you’d expect: talking about referral to a sleep
centre for a study, and so on. Towards the end, the doctor took my blood
pressure (sleep apnea can be caused by, and can cause high blood pressure, in
a lovely little vicious cycle). I don’t think either of us expected anything;
it was just one of those standard checks for a related problem. After taking
the reading, the doctor looked at me and said, “I can’t let you leave with a
BP like this”. Yikes!&lt;/p&gt;
&lt;p&gt;Blood pressure readings are split into stages: normal is under 120 mmHg&lt;sup id=&#34;fnref:3&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:3&#34; role=&#34;doc-noteref&#34;&gt;3&lt;/a&gt;&lt;/sup&gt;
over 80 mmHg&lt;sup id=&#34;fnref:4&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:4&#34; role=&#34;doc-noteref&#34;&gt;4&lt;/a&gt;&lt;/sup&gt;, stage 1 is up to 140/90, stage 2 is up to 180/120,
and above is simply called “crisis”. Guess where I was? Also, fun fact:
depending on how exactly you count and attribute things, hypertension comes out
as the single largest cause of death in humans. It doesn’t kill you outright,
but contributes to strokes, coronary artery disease, heart failure, and lots
of other lovely things you don’t want on your CV.&lt;/p&gt;
&lt;p&gt;After doing a few more readings, it settled down to just under the “crisis”
stage and into the “holy crap, start treatment immediately” stage instead.
I won’t labour on much more about this, but things are definitely moving in
the right direction now&lt;sup id=&#34;fnref:5&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:5&#34; role=&#34;doc-noteref&#34;&gt;5&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;While the Apple Watch didn’t literally save my life, it triggered the chain of
events that led to this diagnosis and treatment. Who knows what would have
happened had it remained undetected? Probably nothing good. Also, go check your
blood pressure! It’s simple to do and simple to treat if there is an issue,
but so many people are walking around with hypertension and not even realising.&lt;/p&gt;
&lt;aside class=&#34;update raised-box&#34;&gt;
  &lt;h5 class=&#34;plain-header&#34;&gt;Update 2025-09-09:&lt;/h5&gt;
  &lt;p&gt;Just a couple of hours after I published this post, Apple announced that they’re
adding hypertension notifications in the new Series 11 watch. It looks like
it will also be supported in Series 9 and Series 10 watches. They expect it to
notify more than one million people of unknown hypertension in the first year.&lt;/p&gt;
&lt;/aside&gt;
&lt;h3 id=&#34;building-gates-in-the-walled-garden&#34;&gt;Building gates in the walled garden&lt;/h3&gt;
&lt;p&gt;Even though the watch is arguably a life-saver, not everything is rosy.
It’s an Apple product, so you’re firmly locked in a walled garden, jealously
guarded by people wearing black turtlenecks. Fortunately, there are a few ways
to make it less painful.&lt;/p&gt;
&lt;p&gt;All the health and fitness data is stored in Apple Health. You can export data
as a big messy file, but it’s a very manual process to do so and the data format
is gnarly. Luckily, there’s an app for that!
&lt;a href=&#34;https://www.healthyapps.dev/&#34;&gt;Health Auto Export&lt;/a&gt; can, well, automatically
export health data. It does what it says on the tin. It can send the data to
Home Assistant, over MQTT, or dump it in some cloud file services, but I just
have it post it all to a REST endpoint on a service I wrote. Then I dump it all
in a database and can do whatever I want with it!&lt;sup id=&#34;fnref:6&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:6&#34; role=&#34;doc-noteref&#34;&gt;6&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;Another tool that’s more useful on the watch itself is Apple Shortcuts. This
is their no-code “if-this-then-that”-type thing. You can make automations or
shortcuts that run a number of tasks. I have a whole slew of them I access
via a complication&lt;sup id=&#34;fnref:7&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:7&#34; role=&#34;doc-noteref&#34;&gt;7&lt;/a&gt;&lt;/sup&gt; on my watch face: one which prompts for input and adds an
item to my to-do list (swiping to write letters is surprisingly not horrible),
one which lets me select from a bunch of pre-written ones (“charge kindle”,
“take laundry out in 1 hour”, type things), one to log my weight into Apple
Health, one which can open and close the blinds in my room, and so on. It’s
a surprisingly robust and easy-to-use system and offers just enough freedom
that I’m not constantly grating on the edge of the walled garden.&lt;/p&gt;
&lt;p&gt;Shortcuts being able to initiate arbitrary web requests is the real killer
feature for me. Anything I can’t do on the watch itself, I can just farm off
to a web server and connect it up with a shortcut. No need to learn Swift or
pay Apple for the privilege of being a developer! For a lot of things, like
controlling the blinds or adding to-do items, I already had a HTTP endpoint
available and exposed over Tailscale&lt;sup id=&#34;fnref:8&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:8&#34; role=&#34;doc-noteref&#34;&gt;8&lt;/a&gt;&lt;/sup&gt;. Adding it to the watch was just a case
of entering the right things in the Shortcuts app.&lt;/p&gt;
&lt;h3 id=&#34;daily-nitty-gritty&#34;&gt;Daily nitty-gritty&lt;/h3&gt;
&lt;p&gt;There are lots of other little bits and pieces that come up when using the watch
daily. I don’t think I can bundle them up into a pleasing narrative arc, so
instead please enjoy some disjointed paragraphs of observations.&lt;/p&gt;
&lt;p&gt;The Apple Watch has a lot of nagging abilities. It can notify you about your
fitness “rings”, prompt you to stand up every hour, count how many seconds
you wash your hands for, etc. I think I’d dislike these just on general
principle, but the way it does them is &lt;em&gt;so&lt;/em&gt; condescending it’s painful. I think
there’s probably a cultural divide issue here, but there is no way in British
English to say “Great job! You washed your hands for 30 seconds!” without
it sounding like you’re being amazingly sarcastic or like you’re talking to a
young child. So I turned all of that nonsense off. It’s meant to be a tool
not a wannabe life coach.&lt;/p&gt;
&lt;p&gt;You can access Maps directly on the watch and even do navigation. It works
really well. The navigation mode has some nice haptic feedback: it does a short
pulse as you’re approaching a turn, and then a long pulse at the actual turn.
I like it a lot more than having to dig out my phone or have the directions
read out. You get one pulse, glance down and see where you need to go, then it
reminds you a little later when it’s time to do it. It’s a delightful user
experience.&lt;/p&gt;
&lt;p&gt;Watchfaces aren’t quite so delightful. There’s a limited number of built-in
ones, and some are “exclusive” to the Ultra Series, and you can’t use them on
a peasant watch like a Series 10. Annoyingly, there’s not one that does
exactly what I want: a plain analogue clock with an inset date and four
complication slots around the outside. Instead, I have to use one of the slots
to show the date. There are third-party watchfaces, but they have issues.
Firstly, there’s no actual API for making watchfaces&lt;sup id=&#34;fnref:9&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:9&#34; role=&#34;doc-noteref&#34;&gt;9&lt;/a&gt;&lt;/sup&gt;, so what they do is
bodge it horribly by using a photo background that has fake widgets on it.
On top of that they’re almost universally subscription-based. Again, no
thanks&lt;sup id=&#34;fnref:10&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:10&#34; role=&#34;doc-noteref&#34;&gt;10&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;The issue I had with the Smart Band triggering when I was sleeping is solved
trivially on an Apple Watch, by virtue of it having a physical button in the
crown. When you put it in sleep mode, you have to double-press the crown to
unlock it before it’ll do anything else. It hasn’t misfired once while I’ve
been using it.&lt;/p&gt;
&lt;figure class=&#34;image right&#34;&gt;
  &lt;picture&gt;
      &lt;source srcset=&#34;https://chameth.com/10-weeks-with-an-apple-watch-10/sleep.avif&#34; type=&#34;image/avif&#34;/&gt;
      &lt;source srcset=&#34;https://chameth.com/10-weeks-with-an-apple-watch-10/sleep.webp&#34; type=&#34;image/webp&#34;/&gt;
      &lt;img src=&#34;https://chameth.com/10-weeks-with-an-apple-watch-10/sleep.png&#34; alt=&#34;A graph showing sleep phases over time. There&amp;#39;s a noticeable transition form patchy data to more smooth data.&#34; loading=&#34;lazy&#34; width=&#34;284&#34; height=&#34;597&#34;/&gt;
  &lt;/picture&gt;
  &lt;figcaption&gt;&lt;p&gt;Sleep data; spot when I swapped devices!&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Finally, a special mention for the gesture controls. If you raise the watch
it reliably wakes up (switching from a low refresh rate, dimmed screen to
an active, brighter one); you can then double-tap your index finger and thumb
together and it will scroll down or page through whatever you’re looking at.
The killer feature for this is navigating recipes: you can advance to the next
step in a recipe while your hands are covered in flour. It’s also handy for
reading notifications: when one pops up, you can double-tap to expand it, then,
when it gets to the bottom, it’ll outline the default button (often “Dismiss”)
and you can double-tap again to click it.&lt;/p&gt;
&lt;h3 id=&#34;the-verdict&#34;&gt;The verdict&lt;/h3&gt;
&lt;p&gt;I normally don’t like writing an actual labelled conclusion, but it feels
like one is needed here! Overall, I’m happy with the watch. The daily
charging doesn’t bother me, the data gathered seems reliable, the health
monitoring has obviously paid dividends already, and the walled garden isn’t
&lt;em&gt;too&lt;/em&gt; chafing. It’s a straight upgrade over my old Smart Band, and I think
it was worth the cost.&lt;/p&gt;
&lt;p&gt;The original reason for getting the watch was better sleep tracking, though,
so how well did it do? I’m much happier with the data: it seems to more
accurately represent when I was awake in the night, and overall the sleep
phases just seem to make more sense. You can see in the graph that the old
data switched frequently between phases, and they didn’t quite line up for
some reason; towards the right when the Apple Watch is supplying the data
instead there’s a much more consistent pattern of sleep phases that repeat
over the course of the night.&lt;/p&gt;
&lt;p&gt;I’m not going to advocate that you go out and buy one, though. I know my
requirements and usage aren’t typical, and I’ve also not got experience with
any recent Android Wear alternatives or the new version of the Pebble watch
that’s coming soon. You should definitely get your blood pressure checked,
though!&lt;/p&gt;
&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;
&lt;hr/&gt;
&lt;ol&gt;
&lt;li id=&#34;fn:1&#34;&gt;
&lt;p&gt;OK, it’s more like 14 now, it’s taken a while for this post to make its
way from my brain into text. &lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:1&#34; role=&#34;doc-backlink&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:2&#34;&gt;
&lt;p&gt;Exercise for the sake of exercising just seems so overwhelmingly
tedious and boring to me. And other types of exercise generally require
social interaction, coordinating with people, and so on. &lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:2&#34; role=&#34;doc-backlink&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:3&#34;&gt;
&lt;p&gt;Who decided to use “millimetres of mercury displaced” as a unit? You
can’t just put random chemical symbols in units! That’s not how this works! &lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:3&#34; role=&#34;doc-backlink&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:4&#34;&gt;
&lt;p&gt;Blood pressure readings have two parts: systolic (the pressure when the
heart is beating) and diastolic (the pressure between those beats). They’re
generally presented with the systolic reading on top and the diastolic reading
below, and read as “X over Y”. Now you know what some of the random numbers
they shout in medical shows mean! Yay learning! &lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:4&#34; role=&#34;doc-backlink&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:5&#34;&gt;
&lt;p&gt;No thanks to how much salt is in everything. I’m pretty sure I’ve had at
least twice the recommended daily amount of salt in a single serving before.
Don’t even get me started on the things that are “low salt” but are still full
of sodium from other sources. I don’t have a problem with ionic compounds, I
have a problem with sodium! &lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:5&#34; role=&#34;doc-backlink&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:6&#34;&gt;
&lt;p&gt;This mainly looks like drawing graphs that are slightly different to
the graphs in the Apple Health graphs, for reasons I’m not sure I can explain.
Making graphs is fun, OK? &lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:6&#34; role=&#34;doc-backlink&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:7&#34;&gt;
&lt;p&gt;Complications are basically just home screen widgets, but with a fancy
name because they’re on a watch. &lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:7&#34; role=&#34;doc-backlink&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:8&#34;&gt;
&lt;p&gt;Tailscale actually causes me some problems here: everything works fine
when the watch is connected to my phone, as the phone handles the Tailscale
part, but if I’m not carrying my phone the watch will try to connect over
WiFi directly and doesn’t understand anything about Tailscale. It happens
infrequently enough that I’ll just live with it; it’s not much worse than
having no signal on a phone. &lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:8&#34; role=&#34;doc-backlink&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:9&#34;&gt;
&lt;p&gt;Yay walled gardens… &lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:9&#34; role=&#34;doc-backlink&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:10&#34;&gt;
&lt;p&gt;I don’t object to subscribing to things in general, but it has to be
something that’s worth the ongoing cost and offers something in return for
the subscription. A watchface doesn’t need enough ongoing maintenance to
justify subscribing to it, it’s just a cash grab. &lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:10&#34; role=&#34;doc-backlink&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</content>
    </entry>
    <entry>
        <title>Making a font of my handwriting</title>
        <link href="https://chameth.com/making-a-font-of-my-handwriting/"/>
        <updated>2025-08-08T00:00:00Z</updated>
        <id>https://chameth.com/making-a-font-of-my-handwriting/</id>
        <content xml:lang="en" type="html">&lt;p&gt;Recently I’ve been on a small campaign to try to make my personal website
more… personal. Little ways to make it obvious it’s &lt;em&gt;mine&lt;/em&gt; and &lt;em&gt;personal&lt;/em&gt;,
not just another piece of the boring corporate dystopia that is most of
the web these days. I don’t quite want to fully regress to the Geocities era
and fill the screen with animated under construction GIFs, but I do want to
capture some of that vibe.&lt;/p&gt;
&lt;p&gt;I’d added some bits and pieces along those lines: floating images in articles
now look like they’re stuck to the page with sellotape, related post
links have a wavy border that animates when you hover over them, and so on.
Next, I wanted to change the heading fonts from a monospace font to something
cursive, to resemble handwriting. Less terminal output, more handwritten letter.
I couldn’t find one I liked, though. So why not make my own? It can’t be that
hard, right?&lt;/p&gt;
&lt;h3 id=&#34;failing-to-do-it-myself&#34;&gt;Failing to do it myself&lt;/h3&gt;
&lt;p&gt;I set out to try to make the font myself using open source tools. After doing
a bit of research, it seemed like the general approach was to create vectors of
each character and then import them into a font editor. That seems to mean
either Adobe Illustrator and FontLab (if you have too much money) or Inkscape
and FontForge (if you like open source). I fall firmly into the latter category,
so I grabbed my graphics tablet and opened Inkscape.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;I wrote out my first three letters: capital A, B and C. Saved them in Inkscape,
and attempted to import them into FontForge. Then I remembered one crucial
thing that had slipped my mind: I absolutely loathe using FontForge. It’s a bit
like when you open an old version of GIMP and get a bunch of weird looking
windows floating all over the place; it feels like you’re fighting against the
tool to do even the most basic operations. The difference is I have cause to
edit images a &lt;em&gt;lot&lt;/em&gt; more than I edit fonts, and GIMP has actually significantly
improved their UI over the years.&lt;/p&gt;
&lt;p&gt;Here are the rough steps I went through with FontForge:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Launch Font Forge. It shows a weird bit of art in one window, and an open
file dialog in another.&lt;/li&gt;
&lt;li&gt;I don’t want to open a file, so I close that dialog. The program exits.&lt;/li&gt;
&lt;li&gt;Relaunch Font Forge, and realise that within the “Open Font” dialog is a
“New” button. Click it.&lt;/li&gt;
&lt;li&gt;Get to the standard font-editing UI. Right-click on the “A” looking for
a way to import an SVG. Don’t see one.&lt;/li&gt;
&lt;li&gt;Click around a bit, exploring the menus. Everything feels a bit off.
You can’t open one menu then hover over the next to see its content, like
basically every UI toolkit in existence. I think FontForge has eschewed QT
and GTK in favour of doing things itself.&lt;/li&gt;
&lt;li&gt;Find the “Import” option in the File menu. Hope it’s for a single glyph not
the whole font.&lt;/li&gt;
&lt;li&gt;A file picker opens. Again it’s all a bit off from normal desktop
conventions. Try to resize it, and just get blank grey space at the bottom.&lt;/li&gt;
&lt;li&gt;Type the absolute path I want to go to in the text field.&lt;/li&gt;
&lt;li&gt;Get a dialog saying “Not a bdf file /home/chris/etc”. Press OK.&lt;/li&gt;
&lt;li&gt;Get a dialog saying “Could not find a bitmap font in”. Press OK.&lt;/li&gt;
&lt;li&gt;Press Ctrl+L to see if that lets me enter a path. Click everything in the
dialog to try to find a way to enter a path. Get annoyed. Give up. Click
through folder-by-folder to get to where I want to be.&lt;/li&gt;
&lt;li&gt;Get to the folder and don’t see any files. Change the format to “SVG”.
Double-click the newly-visible SVG file.&lt;/li&gt;
&lt;li&gt;Get a dialog saying “You must select a glyph before you can import an image
into it”. Press OK.&lt;/li&gt;
&lt;li&gt;The import dialog goes away, having not imported.&lt;/li&gt;
&lt;li&gt;Select the glyph in the main tool area, then repeat the File→Import dance.&lt;/li&gt;
&lt;li&gt;It’s actually there now! Open the glyph in the editor and see it’s
a complete mess of Bézier curves. I can’t click what I want without
accidentally moving a handle for an adjacent curve.&lt;/li&gt;
&lt;li&gt;Rage-quit.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I’m sure FontForge is less anger inducing once you’re used to it. And you
definitely could use it to build a font like this if you had much more patience
than me. I’d had enough of death-by-a-thousand-paper-cuts though.&lt;/p&gt;
&lt;p&gt;I briefly tried Inkscape’s built-in support for making an SVG font. It annoyed
me a lot less, but it’s fiddly: it seemed like each glyph had to be a single
path, so you had to convert the glyphs to paths, then merge them correctly.
If you merge them incorrectly then the wrong bits of your letters end up
filled (like the inside of the ‘B’). Path manipulation is getting towards the
limit of my knowledge of vector editing, and it took a bit of trial and error
for each letter that had more than a single stroke. I didn’t fancy doing that
for every letter.&lt;/p&gt;
&lt;p&gt;I’m usually a big advocate of open source, but this was one of those painful
times when it feels like it just falls short. Clunky, painful UI and processes
where commercial tools just let you get on with your work.&lt;/p&gt;
&lt;h3 id=&#34;you-can-exchange-money-for-goods-and-services&#34;&gt;You can exchange money for goods and services&lt;/h3&gt;
&lt;p&gt;When I’d been looking for open source tutorials, I found many mentions of
a closed source, hosted tool: &lt;a href=&#34;https://www.calligraphr.com/en/&#34;&gt;Calligraphr&lt;/a&gt;.
It has a free version with limitations (no ligatures, no variations, 75
glyphs per font), and a pro version for £8/month. I’d normally balk at the
idea of a subscription for this, but they have the perfect answer: you can
make a one-time payment, and your account automatically downgrades back to free
after a month. It’s not a hidden option, either, it’s the most prominent button
on the upgrade page. That made me happy to give them £8 to play around with
the service for a month.&lt;/p&gt;
&lt;p&gt;Calligraphr works by having you print templates, write out the letters, then
scan them in. It does some magical processing to extract the glyphs, provides
tools to tidy them up, align them, etc, and then produces a TTF file for you.
You can see some of my completed templates here:&lt;/p&gt;
&lt;figure class=&#34;image full&#34;&gt;
  &lt;picture&gt;
      &lt;source srcset=&#34;https://chameth.com/making-a-font-of-my-handwriting/template.avif&#34; type=&#34;image/avif&#34;/&gt;
      &lt;source srcset=&#34;https://chameth.com/making-a-font-of-my-handwriting/template.webp&#34; type=&#34;image/webp&#34;/&gt;
      &lt;img src=&#34;https://chameth.com/making-a-font-of-my-handwriting/template.jpg&#34; alt=&#34;Eight scanned template sheets, filled in with handwritten letters and ligatures&#34; loading=&#34;lazy&#34; width=&#34;1166&#34; height=&#34;841&#34;/&gt;
  &lt;/picture&gt;
  &lt;figcaption&gt;&lt;p&gt;Most of the templates I used for the font&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Calligraphr has a nice UI to generate the templates, allowing you to select
which glyphs to include. I added the “minimal English”, “basic punctuation”
and “Ligatures” sets. That gave me four pages to fill out, and I did them all
twice. That let me filter out versions that didn’t work well, and have
variants for some letters so the font wasn’t too repetitive. Later on, I went
back and added some custom ligatures based on blog post titles that didn’t look
quite right: “Re”, “To”, “ers”, “ey”, “hy”, “ra”, “re” and “ty”. Ligatures like
this help it look more natural: when we write we don’t just stamp out identical
letters regardless of their surroundings, instead they will connect to their
neighbours, or overlap slightly, or even share a stroke.&lt;/p&gt;
&lt;p&gt;I filled these templates in with a Sharpie, as I wanted a fairly informal,
scrap-booky look, and it would also give good solid shapes that should be easy
to pick out of the template. I scanned them with the “Scan Document” function
on my iPhone, and uploaded the PDFs to Calligraphr.&lt;/p&gt;
&lt;h3 id=&#34;iterating-and-tweaking&#34;&gt;Iterating and tweaking&lt;/h3&gt;
&lt;p&gt;The Calligraphr UI allows you to preview the font, but I found it a lot more
useful to just download a copy and use it on a local copy of my website.
That let me test it with real text, and see how it’d look at the different font
sizes I use on the site.&lt;/p&gt;
&lt;p&gt;The first version was not great. Despite the guidelines on the template, I
apparently wasn’t good at sticking to them. Some letters were floating way off
the baseline, and some were sunken below. When those opposites met it looked
terrible. Fortunately Calligraphr has a pretty easy tool to slide each letter up
and down, and scale it up or down if needed, and you can see it next to other
letters as you do it. It took a little bit of time to go through all the
variants of all the letters, but the next version looked a lot better.&lt;/p&gt;
&lt;p&gt;Another tweak I ended up doing was reducing the spacing between letters. The
defaults Calligraphr uses are probably good for a blocky font, but I wanted to
put the letters close together to give it more of a joined-up look.
Again, this is an easy tool to use, you just drag the sides in or out as
desired. While these tweaking steps were probably as fiddly as some of the
Inkscape steps I refused to do earlier, they’re a lot more rewarding as you
see things improving with each one. It’s a lot easier for me to commit time
and effort to improving something that’s already working reasonably, than put
that time and energy into an unknown.&lt;/p&gt;
&lt;p&gt;Later, I noticed that occasionally there would be a huge gap in a title. Not
“the kerning is slightly off” but “there’s enough room to park a bus”. It took
me a while to figure out what was happening: a couple of glyphs
hadn’t been isolated perfectly and had picked up a few pixels from the template
lines at the edge of their boxes. That meant the glyph had a width that covered
the actual written glyph, a big gap, and then the rogue marks. At first, I fixed
this by just adjusting the width, but that left the little pixels floating
awkwardly down-sentence. The proper fix was to use the editing tool and simply
delete them, and then Calligraphr snapped the width back to what it should be.&lt;/p&gt;
&lt;p&gt;These iterations took a while to do, but I just dipped in and out occasionally
over the course of a week, so it didn’t actually feel like too much work. I
quite enjoy the process of refining things, too.&lt;/p&gt;
&lt;h3 id=&#34;result-and-a-surprise&#34;&gt;Result and a surprise&lt;/h3&gt;
&lt;p&gt;If you’re viewing this post on my website&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:1&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;, you can see the font in the
headers, captions, and a few other places. Here’s how it compares to my actual
handwriting:&lt;/p&gt;
&lt;figure class=&#34;image full&#34;&gt;
  &lt;picture&gt;
      &lt;source srcset=&#34;https://chameth.com/making-a-font-of-my-handwriting/sample.avif&#34; type=&#34;image/avif&#34;/&gt;
      &lt;source srcset=&#34;https://chameth.com/making-a-font-of-my-handwriting/sample.webp&#34; type=&#34;image/webp&#34;/&gt;
      &lt;img src=&#34;https://chameth.com/making-a-font-of-my-handwriting/sample.jpg&#34; alt=&#34;A hand-written line of text saying &amp;#39;Hello World! This is Chris Hand&amp;#39; above the same line of text in the Chris Hand font&#34; loading=&#34;lazy&#34; width=&#34;763&#34; height=&#34;194&#34;/&gt;
  &lt;/picture&gt;
  &lt;figcaption&gt;&lt;p&gt;My handwriting vs my handwriting font&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;It’s not close enough to forge documents, but I think it definitely gets
across my style, and that’s exactly what I wanted. It’s surprisingly legible
even at smaller font sizes — I think the weight of the Sharpie helps here — and
at £8 and a bit of manual work was a lot more economical than spending days
wresting with open source tools.&lt;/p&gt;
&lt;p&gt;A few weeks after I put the finishing touches on the font, I got an e-mail
from Calligraphr. As my account had lapsed back to the free version, I was
no longer eligible for the “server-side backup” feature. So what did they do?
They e-mailed me an exported copy! It’s a JSON file with the properties of each
glyph and a base64 encoded image. Not only can I re-upload this to Calligraphr
if I resubscribe, I can probably hook something up to edit it should I ever
need to. I’m blown away by how pro-user Calligraphr’s business practices are.
They’re up-front about pricing, don’t try to get you stuck on an auto-renewing
subscription, and automatically export your data. It’s like a breath of fresh
air compared to the barrage of dark patterns that other websites foist on us.
If you want to make this kind of font, I’d definitely recommend them just
because of how &lt;em&gt;nice&lt;/em&gt; they are.&lt;/p&gt;
&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;
&lt;hr/&gt;
&lt;ol&gt;
&lt;li id=&#34;fn:1&#34;&gt;
&lt;p&gt;And I haven’t changed everything since writing this post… &lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:1&#34; role=&#34;doc-backlink&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</content>
    </entry>
    <entry>
        <title>Coming around on LLMs</title>
        <link href="https://chameth.com/coming-around-on-llms/"/>
        <updated>2025-05-28T00:00:00Z</updated>
        <id>https://chameth.com/coming-around-on-llms/</id>
        <content xml:lang="en" type="html">&lt;figure class=&#34;image right&#34;&gt;
  &lt;picture&gt;
      &lt;source srcset=&#34;https://chameth.com/coming-around-on-llms/claude-hello.avif&#34; type=&#34;image/avif&#34;/&gt;
      &lt;source srcset=&#34;https://chameth.com/coming-around-on-llms/claude-hello.webp&#34; type=&#34;image/webp&#34;/&gt;
      &lt;img src=&#34;https://chameth.com/coming-around-on-llms/claude-hello.png&#34; alt=&#34;A screenshot of the Claude web UI with the prompt &amp;#39;Say &amp;#34;Hello!&amp;#34;&amp;#39;. The response is &amp;#34;Hello!&amp;#34;&#34; loading=&#34;lazy&#34; width=&#34;176&#34; height=&#34;172&#34;/&gt;
  &lt;/picture&gt;
  &lt;figcaption&gt;&lt;p&gt;Claude says hi.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;For a long time I’ve been a sceptic of LLMs and how they’re being used and
marketed. I tried ChatGPT when it first launched, and was totally underwhelmed.
Don’t get me wrong: I find the technology damn impressive, but I just couldn’t
see any use for it.&lt;/p&gt;
&lt;p&gt;Recently I’ve seen more and more comments along the lines of “people who
criticise LLMs haven’t used the latest models”, and a good number of developers
that I respect have said they use coding models in some capacity. So it seemed
like it was time to give them another shake.&lt;/p&gt;
&lt;p&gt;The first decision to make was which model to try. OpenAI are no longer the
only player in the game, every tech company of a certain size is now also
somehow an AI company&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:1&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;. I looked a bit at some benchmarks, and then mostly
ignored them and went with the only company that I didn’t outright hate:
Anthropic, and their model Claude.&lt;/p&gt;
&lt;h3 id=&#34;initial-impressions&#34;&gt;Initial impressions&lt;/h3&gt;
&lt;p&gt;The latest Claude models do feel a lot more “capable” than the earlier ChatGPT
versions I remember, but they also still have a lot of the same problems. At
their heart, they’re still text-prediction models, and still seem to be trained
to predict text that will please the user rather than be factually accurate or
useful.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;One of the improvements that people kept mentioning was the ability for models
to access the web directly. I’ve seen it kick in a bit naturally, and asked
for it explicitly sometimes, and it’s… nothing special? Are people just really
bad at searching the web? Maybe they should try &lt;a href=&#34;https://kagi.com/&#34;&gt;Kagi&lt;/a&gt;? I
feel like about 80% of the time I could have found the information just as
quickly myself, about 10% of the time it searched and then hallucinated an
answer, and the remaining 10% it found something quicker than I otherwise
would have. Those aren’t great results, especially when you consider how
much cheaper and simpler just searching the web is.&lt;/p&gt;
&lt;p&gt;There is another way to trigger web searches in Claude: using “research mode”.
When you enable it, it splits off into different models: a “lead researcher” to
come up with a plan, and then some minions that execute it. It ends up doing
hundreds of web queries in the span of a few seconds. Suddenly I understand why
things like &lt;a href=&#34;https://anubis.techaro.lol/&#34;&gt;Anubis&lt;/a&gt; need to exist. I’ve not used
the “please launch a DoS attack” button since.&lt;/p&gt;
&lt;p&gt;What did impress me, though, was its ability to churn out reasonable-ish
code. It can hack together a bash script as well as I can, and do it far
faster than I’d be able to. Sometimes they even work. That made me wonder
what it would be like doing actual coding with it. Anthropic have a CLI tool
called &lt;code&gt;claude-code&lt;/code&gt;, so I paid them lots of money and gave it a spin.&lt;/p&gt;
&lt;h3 id=&#34;coding-with-claude&#34;&gt;Coding with Claude&lt;/h3&gt;
&lt;p&gt;The first thing I notice about &lt;code&gt;claude-code&lt;/code&gt; is that I really like the
interface. It’s basically an input box in a terminal. It doesn’t force me to
use a certain IDE or do things in a certain way. By default it asks before
making any changes, showing you a side-by-side diff of what it’s doing and
allowing you to provide feedback. If I had to design a way to interact with
a coding agent from scratch, I can’t think of many things I’d improve.&lt;/p&gt;
&lt;figure class=&#34;image full&#34;&gt;
  &lt;picture&gt;
      &lt;source srcset=&#34;https://chameth.com/coming-around-on-llms/code-session.avif&#34; type=&#34;image/avif&#34;/&gt;
      &lt;source srcset=&#34;https://chameth.com/coming-around-on-llms/code-session.webp&#34; type=&#34;image/webp&#34;/&gt;
      &lt;img src=&#34;https://chameth.com/coming-around-on-llms/code-session.png&#34; alt=&#34;A screenshot of claude-code. I ask it for the permalink for the latest post, and it gives a wrong answer. After prompting it again it gets it right.&#34; loading=&#34;lazy&#34; width=&#34;1121&#34; height=&#34;554&#34;/&gt;
  &lt;/picture&gt;
  &lt;figcaption&gt;&lt;p&gt;A simple example of a claude-code session&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The power in &lt;code&gt;claude-code&lt;/code&gt; versus just using the web UI is that it can use
tools. It can query &lt;code&gt;git&lt;/code&gt;, run &lt;code&gt;grep&lt;/code&gt; commands, even use &lt;code&gt;sed&lt;/code&gt; if it wants to
change something in lots of files at once. It’s very good at figuring out its
way around a codebase, even without any explicit instructions. You can see in
the screenshot that with a little prompting it managed to get the permalink
to this post; I didn’t tell it where the posts were stored, or how to work out
the latest, I just told it when it was wrong. If I’d run &lt;code&gt;/init&lt;/code&gt; before it
would have probably picked up on the fact that my posts have custom permalinks,
and noted it in &lt;code&gt;CLAUDE.md&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;But how good is it at actually writing code? It’s like having a keen but not
particularly thorough Junior Engineer at your beck and call. If you give it
a clearly defined task and guidance on how to implement it (and maybe some
feedback as it suggests changes), it’s more than capable of doing it. If you
don’t give it enough guidance it tends to go more off the rails. I tried
having it generate a simple application from scratch with minimal technical
guidance and no review of what it was doing, and it made such a mess of it I
decided it was quicker to throw it away and start again by hand.&lt;/p&gt;
&lt;h3 id=&#34;the-man-behind-the-curtain&#34;&gt;The man behind the curtain&lt;/h3&gt;
&lt;p&gt;Even with sufficient guidance, at times it’s &lt;em&gt;really&lt;/em&gt; obvious that it’s an
LLM generating pleasing-token-strings and not something that genuinely
understands what it’s doing. It will spit out code like this:&lt;/p&gt;
&lt;pre class=&#34;chroma-chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;chroma-line&#34;&gt;&lt;span class=&#34;chroma-cl&#34;&gt;&lt;span class=&#34;chroma-k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-nx&#34;&gt;err&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-o&#34;&gt;!=&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-kc&#34;&gt;nil&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;chroma-line&#34;&gt;&lt;span class=&#34;chroma-cl&#34;&gt;&lt;span class=&#34;chroma-w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;chroma-k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-nx&#34;&gt;err&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-o&#34;&gt;==&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-nx&#34;&gt;sql&lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;chroma-nx&#34;&gt;ErrNoRows&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;chroma-line&#34;&gt;&lt;span class=&#34;chroma-cl&#34;&gt;&lt;span class=&#34;chroma-w&#34;&gt;       &lt;/span&gt;&lt;span class=&#34;chroma-k&#34;&gt;return&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-kc&#34;&gt;nil&lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-nx&#34;&gt;err&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;chroma-line&#34;&gt;&lt;span class=&#34;chroma-cl&#34;&gt;&lt;span class=&#34;chroma-w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;chroma-line&#34;&gt;&lt;span class=&#34;chroma-cl&#34;&gt;&lt;span class=&#34;chroma-w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;chroma-k&#34;&gt;return&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-kc&#34;&gt;nil&lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-nx&#34;&gt;err&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;chroma-line&#34;&gt;&lt;span class=&#34;chroma-cl&#34;&gt;&lt;span class=&#34;chroma-p&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Why’s that check for &lt;code&gt;sql.ErrNoRows&lt;/code&gt; there? It’s entirely pointless. There was
no instruction to check for it, none of the existing code checked for it, but
I assume it comes up quite a bit in the training data. But it didn’t
&lt;em&gt;understand&lt;/em&gt; why, so it put the check in, and returned the exact same thing as
if it hadn’t.&lt;/p&gt;
&lt;p&gt;It also occasionally tries to “cheat” or solve problems the wrong way. It
sometimes feels a bit like you’re asking for wishes from a Monkey Paw. “Stop
the unit tests failing”, you’ll say; Claude will respond with a request to
delete the failing test. The man behind the curtain isn’t particularly well
hidden, and the training data and pattern matching often shows through.&lt;/p&gt;
&lt;p&gt;This lack of understanding also makes it very hard to get Claude to use
comments in a sensible way. It absolutely loves doing nonsense like this:&lt;/p&gt;
&lt;pre class=&#34;chroma-chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;chroma-line&#34;&gt;&lt;span class=&#34;chroma-cl&#34;&gt;&lt;span class=&#34;chroma-c1&#34;&gt;// render form
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;chroma-line&#34;&gt;&lt;span class=&#34;chroma-cl&#34;&gt;&lt;span class=&#34;chroma-kd&#34;&gt;function&lt;/span&gt; &lt;span class=&#34;chroma-nx&#34;&gt;renderForm&lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;chroma-p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;chroma-line&#34;&gt;&lt;span class=&#34;chroma-cl&#34;&gt;    &lt;span class=&#34;chroma-c1&#34;&gt;// ...
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;chroma-line&#34;&gt;&lt;span class=&#34;chroma-cl&#34;&gt;&lt;span class=&#34;chroma-p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Even with explicit instructions to avoid useless comments, or comments that only
explain what the code does (not why it does it), or other prompts. Again, I’m
chalking it up to a mixture of training data that does that, and lack of any
actual understanding about why a human developer may want a comment to exist.
Of course, there are plenty of flesh-and-blood devs out there that also don’t
comment effectively, so maybe I shouldn’t give Claude too much of a hard time
on this.&lt;/p&gt;
&lt;h3 id=&#34;-and-yet-&#34;&gt;… and yet …&lt;/h3&gt;
&lt;p&gt;So with all those problems, it sounds like it’s just not worth it, right?
Well, not quite. I feel like programming mostly consists of two distinct tasks:
thinking how to implement things; actually implementing them; and then debugging
why you’re off-by-one somewhere. Letting an LLM do the thinking is a big no-go
for me: it’s evidently not good at it, and frankly that’s one of the things
I most like about programming. Having let it loose on small projects, I shudder
to think what the codebases of all the “vibe coded” projects that are popping up
are like.&lt;/p&gt;
&lt;p&gt;For the second stage, though, it’s actually quite nice. If I’ve thought through
how I want something to be implemented, I can feed those steps to Claude and have
it churn out the otherwise not-too-interesting code. This requires far less
time and concentration on my part than writing code, to the extent that I can
be thinking about the next feature, or doing something else at the same time. I
don’t feel like I’m going to end up deskilling myself this way, as I’ve already
formed the idea of what I want to code, I’m just using the LLM to spit it out
faster than I can type it.&lt;/p&gt;
&lt;p&gt;A lot of the most boring bits of coding like implementing CRUD-y operations can
be summarised as “Look at this file/function. Do the same thing but slightly
differently elsewhere”. Claude is great at this, especially when explicitly
prompted like that. You’re basically playing to its pattern-matching strengths,
rather than asking it to come up with anything novel. Most of my prompts tend
to be prefixed with “Look at @some_file.go and @other_file.go.” to cue up the
patterns I want it to use, and I find this works well.&lt;/p&gt;
&lt;p&gt;As for debugging, it’s a mixed bag. It’s sometimes amazingly insightful, and
sometimes just runs around in circles trying the wrong things over and over.
It’s worth asking the question, but I definitely wouldn’t rely on it over my
own abilities.&lt;/p&gt;
&lt;h3 id=&#34;the-future&#34;&gt;The future&lt;/h3&gt;
&lt;p&gt;I’m probably going to carry on using &lt;code&gt;claude-code&lt;/code&gt;, at least for personal
projects. I’ve got so much done that I just wouldn’t have been
&lt;em&gt;bothered&lt;/em&gt; to do if I was doing it all by hand. I very much enjoy being in
the more “diffuse thinking” mindset, planning how things are going to work,
rather than being stuck in the mines digging out SQL queries. After all, who
wouldn’t want an over-eager assistant to work on all their hobby projects?&lt;/p&gt;
&lt;p&gt;Work is a slightly different matter: a private project or even an open source
project that disclaims any liability is different to something I’m being
paid to deliver, and bear responsibility for fixing if it’s not done correctly.
I’m not saying I won’t use it at all, but if I do it’ll be much more constrained
than I would in personal projects.&lt;/p&gt;
&lt;p&gt;As for non-code usages: I’m not sold. My sceptic hat is still firmly in place.
I don’t think chat is a particularly good interface for many things, and
hallucinations are still a big problem despite what people say. I hate the tide
of AI slop that’s taking over the Internet, and how LLM-powered chat
agents are being forced into every random product. You’re definitely not going
to be seeing any AI-generated blog posts from me!&lt;/p&gt;
&lt;p&gt;One topic I’ve not gone into here is the ethical concerns about using LLMs. They
obviously exist, and I do have thoughts, but that’s a topic for another day.&lt;/p&gt;
&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;
&lt;hr/&gt;
&lt;ol&gt;
&lt;li id=&#34;fn:1&#34;&gt;
&lt;p&gt;I’m surprised it’s not gone more mainstream: why’s there
no Tesco Value LLM model, yet? &lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:1&#34; role=&#34;doc-backlink&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</content>
    </entry>
    <entry>
        <title>Home Automation Without the Megacorps</title>
        <link href="https://chameth.com/home-automation-without-megacorps/"/>
        <updated>2025-05-21T00:00:00Z</updated>
        <id>https://chameth.com/home-automation-without-megacorps/</id>
        <content xml:lang="en" type="html">&lt;p&gt;I first experimented with home automation in 2016, by picking up a Samsung
“SmartThings” hub. It was terrible. The UI to configure things was slow and
clunky, firmware updates were applied whether you wanted them or not, and
everything stopped working if their cloud services stopped. You were also locked
into whatever integrations they deigned to support, of course. After that broke
for the umpteenth time I scaled back and for years the closest I got to home
automation was a couple of Hue bulbs.&lt;/p&gt;
&lt;p&gt;Recently I’ve been building it out again, though. This time using off-the-shelf
components that interop using Zigbee, open-source software, and some code I
wrote myself. It’s great; it runs entirely locally and has had basically zero
downtime. The Zigbee ecosystem lets me integrate all sorts of things without
having to spend lots of money on “smart” alternatives. I think I’ve spent less
on this incarnation than I did on the original SmartThings hub all those years
ago (even without adjusting for inflation!).&lt;/p&gt;
&lt;h3 id=&#34;my-current-setup&#34;&gt;My current setup&lt;/h3&gt;
&lt;p&gt;I run everything on a Raspberry Pi 4, with a Sonoff USB Zigbee adapter based
on the CC2652P chipset&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:1&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;. Interfacing with the Zigbee stack is handled by
&lt;a href=&#34;https://www.zigbee2mqtt.io/&#34;&gt;zigbee2mqtt&lt;/a&gt; (z2m for short), an open-source project that
basically bridges your devices to an MQTT broker&lt;sup id=&#34;fnref:2&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:2&#34; role=&#34;doc-noteref&#34;&gt;2&lt;/a&gt;&lt;/sup&gt;. When a device reports some
data, it will send a new message over MQTT; when you want to make a device do
something you just post a message back. It’s incredibly lightweight, but
supports a huge array of devices out of the box. And as it’s just using MQTT,
it’s trivial to integrate with other software or build on top of.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;I know a lot of people building out this kind of home automation use
&lt;a href=&#34;https://www.home-assistant.io/&#34;&gt;Home Assistant&lt;/a&gt;, but I don’t get on with it
terribly well. It felt incredibly sluggish, and the entire project is just a
bit… much. I want a binary or package or docker image I can just run, not an
entire operating system. That’s not how computers are meant to work! In contrast,
z2m is simple to set up, super light weight and responsive.&lt;/p&gt;
&lt;p&gt;Anyway. z2m exposes Zigbee devices over MQTT, so I wrote some code in Go to
connect to the MQTT broker, and listen to the messages. It’s grown a bit beyond
this now, and I’m skipping some boring bits like error handling and JSON
parsing, but at first I had something like:&lt;/p&gt;
&lt;pre class=&#34;chroma-chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;chroma-line&#34;&gt;&lt;span class=&#34;chroma-cl&#34;&gt;&lt;span class=&#34;chroma-k&#34;&gt;for&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;chroma-line&#34;&gt;&lt;span class=&#34;chroma-cl&#34;&gt;&lt;span class=&#34;chroma-w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;chroma-nx&#34;&gt;message&lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-nx&#34;&gt;topic&lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-nx&#34;&gt;err&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-o&#34;&gt;:=&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-nx&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;chroma-nf&#34;&gt;ReadSlices&lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;()&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;chroma-line&#34;&gt;&lt;span class=&#34;chroma-cl&#34;&gt;&lt;span class=&#34;chroma-w&#34;&gt;    
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;chroma-line&#34;&gt;&lt;span class=&#34;chroma-cl&#34;&gt;&lt;span class=&#34;chroma-w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;chroma-k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-nb&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;chroma-nx&#34;&gt;topic&lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-o&#34;&gt;==&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-s&#34;&gt;&amp;#34;zigbee2mqtt/desk-button&amp;#34;&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;chroma-line&#34;&gt;&lt;span class=&#34;chroma-cl&#34;&gt;&lt;span class=&#34;chroma-w&#34;&gt;        &lt;/span&gt;&lt;span class=&#34;chroma-k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-nx&#34;&gt;strings&lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;chroma-nf&#34;&gt;Contains&lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;chroma-nx&#34;&gt;message&lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-s&#34;&gt;&amp;#34;single&amp;#34;&lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;chroma-line&#34;&gt;&lt;span class=&#34;chroma-cl&#34;&gt;&lt;span class=&#34;chroma-w&#34;&gt;            &lt;/span&gt;&lt;span class=&#34;chroma-nx&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;chroma-nf&#34;&gt;Publish&lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;chroma-kc&#34;&gt;nil&lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;[]&lt;/span&gt;&lt;span class=&#34;chroma-nb&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;chroma-s&#34;&gt;&amp;#34;{\&amp;#34;state\&amp;#34;: \&amp;#34;TOGGLE\&amp;#34;}&amp;#34;&lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;),&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;chroma-s&#34;&gt;&amp;#34;zigbee2mqtt/room-lights/set&amp;#34;&lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;chroma-line&#34;&gt;&lt;span class=&#34;chroma-cl&#34;&gt;&lt;span class=&#34;chroma-w&#34;&gt;        &lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;chroma-line&#34;&gt;&lt;span class=&#34;chroma-cl&#34;&gt;&lt;span class=&#34;chroma-w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;chroma-p&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;chroma-line&#34;&gt;&lt;span class=&#34;chroma-cl&#34;&gt;&lt;span class=&#34;chroma-p&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;chroma-w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I think I actually made this harder to read by trying to simplify it here, but
hopefully you can follow that it was relatively straight forward to listen
for a particular action to happen (in this case me “single”-pressing on the
device called “desk-button”) and then make another device do something in
response (toggling the state of the “room-lights” device).&lt;/p&gt;
&lt;p&gt;So what actually are these devices? At present in z2m I have the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Some generic buttons&lt;/li&gt;
&lt;li&gt;An air quality sensor (USB powered), and a separate temperature sensor (battery powered)&lt;/li&gt;
&lt;li&gt;A light switch&lt;/li&gt;
&lt;li&gt;Some 240V relay modules, that I use to turn non-smart devices on and off&lt;/li&gt;
&lt;li&gt;Some USB relay modules, for the same purpose&lt;/li&gt;
&lt;li&gt;Some “smart” plugs that I mostly use to monitor power usage&lt;/li&gt;
&lt;li&gt;A motorised blind roller&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I think all of these are either Tuya or Moes branded, and were all sourced from
AliExpress. You can get the same things from Amazon or elsewhere, but they tend
to be 3-4x more expensive for the same product.&lt;/p&gt;
&lt;p&gt;One of the cool things about Zigbee devices is that the powered ones work
together to create a mesh network, so you don’t have to worry about network
repeaters or signal strength like you do with Wi-Fi networks. z2m even makes
a map showing the connections:&lt;/p&gt;
&lt;figure class=&#34;image full&#34;&gt;
  &lt;picture&gt;
      &lt;source srcset=&#34;https://chameth.com/home-automation-without-megacorps/zigbee-map.avif&#34; type=&#34;image/avif&#34;/&gt;
      &lt;source srcset=&#34;https://chameth.com/home-automation-without-megacorps/zigbee-map.webp&#34; type=&#34;image/webp&#34;/&gt;
      &lt;img src=&#34;https://chameth.com/home-automation-without-megacorps/zigbee-map.png&#34; alt=&#34;A &amp;#34;map&amp;#34; showing how Zigbee devices connect to one another&#34; loading=&#34;lazy&#34; width=&#34;1093&#34; height=&#34;651&#34;/&gt;
  &lt;/picture&gt;
  &lt;figcaption&gt;&lt;p&gt;The network map produced by z2m. You can see how all the powered devices form a mesh that the lower power ones can connect to.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h3 id=&#34;some-interesting-automations&#34;&gt;Some interesting automations&lt;/h3&gt;
&lt;figure class=&#34;image right&#34;&gt;
  &lt;picture&gt;
      &lt;source srcset=&#34;https://chameth.com/home-automation-without-megacorps/relay.avif&#34; type=&#34;image/avif&#34;/&gt;
      &lt;source srcset=&#34;https://chameth.com/home-automation-without-megacorps/relay.webp&#34; type=&#34;image/webp&#34;/&gt;
      &lt;img src=&#34;https://chameth.com/home-automation-without-megacorps/relay.jpg&#34; alt=&#34;A Zigbee relay and some wago connectors wired up in a project box&#34; loading=&#34;lazy&#34; width=&#34;325&#34; height=&#34;500&#34;/&gt;
  &lt;/picture&gt;
  &lt;figcaption&gt;&lt;p&gt;A Zigbee relay spliced into the power cable for the fan&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;So what do I actually do with all of this? Some of it is just what I’ll call
“laziness automation”: I want to be able to turn on the lights without getting
up and walking to the light switch. So there’s a Zigbee button on my desk that
does it. Then there are some less manual automations: my blinds are
automatically closed at sunset&lt;sup id=&#34;fnref:3&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:3&#34; role=&#34;doc-noteref&#34;&gt;3&lt;/a&gt;&lt;/sup&gt;, for example. It feels a bit trivial, but it’s
surprisingly nice just not to have to think about that at all.&lt;/p&gt;
&lt;p&gt;Another nice quality of life automation is the light I have above my monitor.
It’s USB powered, and I now have it going through a Zigbee USB relay that lets
it be toggled on and off. Then I have a small agent running on my desktop that
turns the light on when the computer is unlocked, and off when it locks or
shuts down. I keep meaning to make a “film mode” that detects when I’m watching
a film, and turning all the lights and blinds down, but I haven’t got around
to it yet.&lt;/p&gt;
&lt;p&gt;The most complex automation is probably for a window fan. It’s not smart in
any way, so I cut the power cable and inserted a Zigbee relay. The whole thing
is housed in a little project box to keep it secure. The relay basically acts
as a switch: the live wire leading to the fan runs to the “normally open”&lt;sup id=&#34;fnref:4&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:4&#34; role=&#34;doc-noteref&#34;&gt;4&lt;/a&gt;&lt;/sup&gt;
contact, while the upstream power goes to “common”. When the relay is told to
turn the fan on, the two get connected and the fan gets power. Oh, it’s also
not actually a window fan, but I designed and 3D printed some adapters so that
it sits right in the window.&lt;/p&gt;
&lt;p&gt;So now we have a window fan that can be turned off and on automatically. But I don’t
want to have to press a button to do that. I’m lazy, remember? Instead, I made
it so that the Go code constantly monitors the temperature reported by the air
quality sensor, and queries the free &lt;a href=&#34;https://openweathermap.org/&#34;&gt;OpenWeatherMap API&lt;/a&gt;
to get the rough temperature outside. It can then turn the fan on if the room is
too hot, and outside is cool enough to make a difference (there’s no point in
blowing hotter air in!).&lt;/p&gt;
&lt;figure class=&#34;image left&#34;&gt;
  &lt;picture&gt;
      &lt;source srcset=&#34;https://chameth.com/home-automation-without-megacorps/fan-graph.avif&#34; type=&#34;image/avif&#34;/&gt;
      &lt;source srcset=&#34;https://chameth.com/home-automation-without-megacorps/fan-graph.webp&#34; type=&#34;image/webp&#34;/&gt;
      &lt;img src=&#34;https://chameth.com/home-automation-without-megacorps/fan-graph.png&#34; alt=&#34;A graph of room temperature, slowly rising to 23.5 degrees, then sharply dropping to 19, rising to 20, dropping to 19 again, etc&#34; loading=&#34;lazy&#34; width=&#34;540&#34; height=&#34;500&#34;/&gt;
  &lt;/picture&gt;
  &lt;figcaption&gt;&lt;p&gt;A graph of room temperature, showing the effect of the fan being turned on and off&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;I don’t want it to do that all the time though. The room doesn’t need to be
cooled if I’m not around. There are various Zigbee presence sensors you can get,
but the cheaper ones seem to be of dubious quality. Instead, I wrote some code
to guess whether I’m present. It uses the state of the monitor light
as a proxy for “is the computer in use”, and then makes some guesses based on
the last time the computer was used and the current time (if I turn the computer
off at midnight it probably means I’m going to sleep; if I turn it off at 2pm
it probably means I’m going out somewhere).&lt;/p&gt;
&lt;p&gt;You can see in the graph that the fan has a decent impact on temperature. I
coded it to cool the room to 19 degrees, but then not turn on again until it
was above 20. This prevents it flip-flopping on and off constantly. You can
clearly see the pattern in the graph, as it actively cools and then slowly
the room warms back up. This arrangement is much better than being woken up at
5am because it’s painfully cold. Trust me.&lt;/p&gt;
&lt;h3 id=&#34;bonuses-metrics-and-3d-printer&#34;&gt;Bonuses: metrics and 3D printer&lt;/h3&gt;
&lt;p&gt;One of the things my custom Go code does is collate all the various stats
reported by the Zigbee devices, and inserts them into a &lt;a href=&#34;https://victoriametrics.com/&#34;&gt;VictoriaMetrics&lt;/a&gt;
database. I originally hosted this on the Pi itself, and it performed fine, but
I’ve since moved it onto a server so that I can use it for some other things
as well.&lt;/p&gt;
&lt;p&gt;I set up Grafana to point to VM, and can create dashboards showing power usage,
what devices are turned on when, and a bunch of environmental conditions. This
also makes it easy to spot how good the data coming from the devices are. For
example, the air quality sensor reports a figure for the amount of Carbon Dioxide
in the air, as well as the amount of Volatile Organic Compounds (VOCs). The
graphs are basically identical, but on a different scale. It turns out this
particular device has no actual way of detecting CO₂, so it just “calculates”
it from the VOCs figure. Useful to know if you want to actually use that data.&lt;/p&gt;
&lt;p&gt;Recently I came across &lt;a href=&#34;https://github.com/torbenconto/bambulabs_api&#34;&gt;a go library for interacting with Bambu Lab printers&lt;/a&gt;,
so I’ve also hooked that into my automation. It exports metrics about the
printer, so I now have a way of seeing what’s going on when I’m not physically
present&lt;sup id=&#34;fnref:5&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:5&#34; role=&#34;doc-noteref&#34;&gt;5&lt;/a&gt;&lt;/sup&gt;. I even added a HTTP endpoint (exposed over &lt;a href=&#34;https://tailscale.com/&#34;&gt;Tailscale&lt;/a&gt;) that
shows pictures from the built-in camera.&lt;/p&gt;
&lt;p&gt;On the automation front, I’ve made it automatically turn off the printer’s light
when it finishes a print, and also added push notifications via &lt;a href=&#34;https://pushover.net/&#34;&gt;PushOver&lt;/a&gt;
whenever the state changes. No longer will I be sat in another room blissfully
unaware it ran out of filament seconds after I walked out the door!&lt;/p&gt;
&lt;h3 id=&#34;was-it-worth-it&#34;&gt;Was it worth it?&lt;/h3&gt;
&lt;p&gt;These days you could probably just buy some kind of ‘smart home’ hub that works
well enough, and do most of what I’ve done with a lot less effort and no coding.
I’m still of the opinion that for something so essentially &lt;em&gt;local&lt;/em&gt;, it should
itself be managed entirely locally. I don’t trust companies like Google or
Amazon not to kill their products, or change or remove an API I rely on.&lt;/p&gt;
&lt;p&gt;Obviously the “Not Invented Here” approach of coding everything yourself doesn’t
suit everyone, but as someone who enjoys coding and enjoys having things work
&lt;em&gt;just so&lt;/em&gt; it works very well for me.&lt;/p&gt;
&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;
&lt;hr/&gt;
&lt;ol&gt;
&lt;li id=&#34;fn:1&#34;&gt;
&lt;p&gt;It turns out the chipset is important. I initially used a similar Sonoff
dongle that used a CC2531 chipset, and its performance wasn’t great. It often
failed to pair with new devices, and dropped links to existing ones. The
&lt;a href=&#34;https://www.zigbee2mqtt.io/advanced/zigbee/02_improve_network_range_and_stability.html&#34;&gt;zigbee2mqtt docs&lt;/a&gt;
do explicitly advise against the CC2531 chips for that reason. At the time they
recommended CC2652Ps, so that’s what I went with. If you’re starting new I’d
go with whatever their latest recommendation was. &lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:1&#34; role=&#34;doc-backlink&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:2&#34;&gt;
&lt;p&gt;MQTT is basically a network protocol for publishing and subscribing to
arbitrary messages. A broker is the thing that sits in the middle and routes
the messages. I use &lt;a href=&#34;https://mosquitto.org/&#34;&gt;Mosquitto&lt;/a&gt; but any will do. &lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:2&#34; role=&#34;doc-backlink&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:3&#34;&gt;
&lt;p&gt;They originally also re-opened at sunrise but that was a terrible
mistake. Who knew the sun rose so early?! &lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:3&#34; role=&#34;doc-backlink&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:4&#34;&gt;
&lt;p&gt;“open” meaning “there’s a gap so it doesn’t work” not
“open for business”. This confusion in terminology also extends to drawbridges. &lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:4&#34; role=&#34;doc-backlink&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:5&#34;&gt;
&lt;p&gt;I use the printer in LAN mode, which means there’s no way to monitor it
from a phone, even if you’re connected to the same network still. &lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:5&#34; role=&#34;doc-backlink&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</content>
    </entry>
</feed>
