

I don’t know how to do this with Ubuntu Server or Home Assistant OS direct installation. With Ubuntu Desktop I’ve found how to solve both problems: edit /etc/systemd/nf and change lid switch behavior to lock, which turns off the screen but leaves the computer running.

Second is that closing the lid will put the machine to sleep, which defeats the point of a server. First is that the screen will always stay on, which wastes power.

This laptop’s Core i5-3320M CPU launched ten years ago, but as a x86_64 capable CPU designed for power-saving laptop usage, it should suit Home Assistant well. Now it shall be my Home Assistant server, which is a robot brain of sorts. I pulled out a refurbished Dell Latitude E6230 I had originally intended to use as robot brain.

A lot of people use a Raspberry Pi, but in these times of hardware scarcity a Raspberry Pi is rarer and more valuable than an old laptop. I wanted to solve these problems and, given my good experience with Home Assistant, I was willing to give it dedicated hardware. I encountered some problems running Home Assistant Operating System (HAOS) as a virtual machine on a TrueNAS CORE server, which is based on FreeBSD and its bhyve hypervisor.
