HA GLaDOS and OPNSense

Published At: 2025-05-25 13:12:07 UTC

Site updates, GLaDOS voice for home assistant, OPNSense and traffic shaping

Site updates up first

Continued working on images upload integration - turns out it was working all along... when I went to explain how it works, I immediately remembered... r2 on dev mode won’t be using remote storage. So the image was being uploaded successfully (to the dev r2) which explains the successful console.log and then the requests to get the image from r2.tomalle.com were failing since the asset wasn't uploaded to the production r2.

Image alt text editing added (and I think I now understand how to do stuff like that myself) thanks to the blog post here https://angelika.me/2023/02/26/how-to-add-editing-image-alt-text-tiptap/. I'll probably open source the repo for the site once I have checked the security up a bit more, at the moment I'm not super confident in any of the auth stuff.

Added click-to-copy on all <code> tags, which is as simple as:

useEffect(() => {  
  const addCopyEventListeners = () => {  
    for (const codeElement of document.querySelectorAll(  
      "div.TipTapHtml code:not(.copy-code-listener)",  
    )) {  
      codeElement.classList.add("copy-code-listener");  
      codeElement.addEventListener("click", () => {  
        navigator.clipboard  
          .writeText(codeElement.textContent || "")  
          .then(() => {  
            toast.success("Copied to clipboard!");  
          })  
          .catch((err) => {  
            console.error("Failed to copy: ", err);  
            toast.error("Failed to copy code to clipboard.");  
          });  
      });  
    }  
  };  
  
  addCopyEventListeners();  
});

OPNSense QOS/Traffic Shaping/Bufferbloat

A few weeks ago, I set up a new router, previously, I had been running an Ubiquiti EdgeRouter 8 pro (image below). It was good, but definitely showing its age when I set up QOS for out gigabit download connection, couldn't handle more than 2-300 mbps. The replacement I chose was OPNSense running on a mini pc, in particular the "GMKtec G2Plus Nucbox G2 Red", non-referral Amazon link here https://www.amazon.com.au/dp/B0D5CGS8FR. This was just the best for the $ at the time that had 2 RJ45 ports and an Intel N150, all for $240 AUD, but at the time of writing is back to $300 AUD.

EdgeRouter 8 Pro

Initially, it took me a while to find the docs I was looking for (for traffic shaping, as I had only heard of it as "QOS" or "Buffer bloat" before that https://docs.opnsense.org/manual/how-tos/shaper_bufferbloat.html), but generally, the setup was quite easy, and the hardware is definitely overkill. I considered virtualising with Proxmox, but at the end of the day, $240 is very cheap for the performance and as the router is mission critical it’s not really a toy that I can be playing around and experimenting with.

GLaDOS voice for home assistant (Part 1)

Ah yes, the dream that all normal humans have had after playing Portal and Portal 2, "when can I put GLaDOS in my house?". Thankfully due to the advancements in technology that's now possible. The repo here: https://github.com/dnhkng/GLaDOS contains the "piper" training/configs and the fantastic guide here: https://github.com/domesticatedviking/TextyMcSpeechy/blob/413a6edc7ca11cc1aa05eea2f7c5e7db3b834c6a/docs/using_custom_voices_in_home_assistant_os.md contains the information on how to set it up on Home Assistant. So far I've got this all working, and when I tested it out it was fantastic. Next step is to get HA compatible audio I/O hardware around the house and change from using Google Assistant to HA assistant.