# Cleanups

Another weekend has come and gone, with a lot of paperwork and tyding up taking up all our time and the saving grace of watching Ralph Breaks the Internet in an actual theatre. Dubbed (which is sadly becoming the norm here unless you go after dinner, which is not always viable for kids), but still fun. But I digress…

## Archive Follow-up

I cleaned up and streamlined the Archives, not only fixing an idiotic date-related bug but (most importantly) making smart cropping nearly ten times faster by doing some things through PIL image processing primitives. There are still a few things to figure out (the original smartcrop.py tried to do too much), but once I’m happy with the code I’ll put it up somewhere.

More importantly, site performance is great, and for good measure I cleaned up the Azure Application Insights dashboard I used while measuring the performance impact of my changes:

I’ve also (re)built a little Python daemon for providing real-time data to Application Insights (I’ve started porting bits of the Azure SDKs across to Python until there is official support), and will write about that sometime soon, hopefully.

Other than back-end fixes and a number of cleanups to navigation and suchlike, I’ve yet to tackle cleaning up the CSS, but I suspect it will take a while to get round to that…

## Interim Automation Update

On the HomeKit front, I finally managed to tame the Xiaomi Aqara DJT11LM motion sensors to a fair degree, thanks to a set of cascading updates on zigbee2mqtt and Node-RED.

The unvarnished truth is that I found out that there was a new, less crashy HomeKit plugin for it, and spent entirely too long upgrading everything and debugging the broken Node-RED flows. Upgrading the runtimes was trivial thanks to Docker, but the brittleness of Node-RED configurations is a constant challenge.

Still, it was easy enough to grab all the sensor data and send it to an Azure IoT Hub for later processing:

I’m still annoyed at the utter inability of the Mediaroom STB to report its power state correctly (or just go to sleep properly via HDMI-CEC), but that’s something to pursue later as well.

And now, to go off into the dark lands of PowerPoint to cobble together a deck for an unplanned session tomorrow…