Hi, I'm Cosmin

Software tester by day, tinkerer by night. I write about test automation, 3D printing, microcontrollers, and making my home smarter one hack at a time.

Software Testing

One line of modular arithmetic vs a 502 storm

Jul 14, 2026

Four parallel Playwright workers turned a discovery-first test suite into a denial-of-service tool — GET /orders returned 502s within a minute. The fix used no lock server or reservation service: lazy worker-scoped fixtures to stagger the load, and one line of Euclidean modulo to fan workers out across distinct entities.

11 min read

A naive test-data finder is a load test in disguise: it pages the whole list and fires a per-entity GET for every row, all at once. pagedFind makes every cost dimension of the search an explicit, named bound — and its counters tell you where the funnel died when it misses.

11 min read

A living reference for adapting the ESP32 local inverter control build to other brands: what transfers as-is, what changes per brand, where to find register maps, and the quirks that bite.

9 min read

My heat pump was invisible to the inverter and my EV charger was confusing it. Moving one CT clamp fixed the first problem with zero software; a small Home Assistant automation driving the part 1 ESP32 fixed the second.

12 min read

Hardcoded entity IDs go stale the moment someone reshapes your shared test environment. I banned them: every spec names the shape of data it needs, and a ScenarioResolver finds a real entity at fixture time.

11 min read

Security said no to TOTP, no to service accounts, no to disabling MFA. So I built a solution that uses OAuth2 refresh tokens to maintain Playwright browser sessions in CI/CD—without ever triggering push notification MFA after the initial setup. Here's the COSMIC Auth Pattern.

19 min read
Testing Series 5% 2 of 41 posts live · #02 shipped 9 Jul
Theme v2.2.2 Like card retired · Share stays

last reading: · 5 days ago

Taking back your inverter: local control with an ESP32 (part 1)

Wire a cheap ESP32 and RS485 transceiver to a Growatt SPH5000 inverter, flash ESPHome, and get a local Modbus web UI for monitoring and control — no cloud, no app.

// Read inverter registers via Modbus RTU
#include <ModbusMaster.h>

ModbusMaster node;
node.begin(1, Serial2);

uint8_t result = node.readHoldingRegisters(0x0006, 2);
if (result == node.ku8MBSuccess) {
  float power = node.getResponseBuffer(0) / 10.0;
  Serial.printf("Current power: %.1f W\n", power);
}
"The best home automation is the one where you own every byte of data flowing through your network."

The ESP32 reads holding registers over RS485, parses the response, and publishes structured data to MQTT. From there, Home Assistant picks it up and I can build dashboards, automations, and alerts all running locally.

read the full build →