DIY Gauge Monitor Tells Me When to Order Heating Oil

My house runs on heating oil. If you’re a homeowner facing high heating costs this winter, I’m right there with you! The oil companies I use don’t offer automatic delivery, so every winter I have to deal with the ordeal of checking my oil tank regularly, making sure it doesn’t run empty, and deciding when to refill.

I have a Wyze Cam v2 mounted near the oil tank, which lets me check the gauge every once in a while without going down to the basement. It’s convenient, but tedious. Admittedly I’ve let the tank run dry more than once before, and that experience was very unpleasant.

I am tired of this ordeal and this winter I decided to automate it. My first thought was to capture a daily snapshot, then send it to an LLM to read the oil level, check prices from a few suppliers, and let it advise whether it’s a good time to refill. This is feasible but perhaps over-engineered.

Then I remembered reading this article by Tom Nardi on Hackaday about Thingino, open-source firmware that runs on many IP cameras (including my Wyze Cam) and lets you run your own scripts. An idea came to me: what if I simply run everything on the camera itself? Take a snapshot every day, use straightforward image processing to read the oil level, scrape supplier websites for current prices, and send me an email recommending when it’s a good time to refill. Because the scene is static and the lighting can be controlled, a simple image processing algorithm should be able to read the gauge reliably. And this is exactly what I did: a smart gauge monitor built entirely on the Wyze Cam.

To begin, I installed Thingino on the camera using its microSD installer. It’s pretty straightforward. Then I asked Codex to help me test the basic building blocks: taking a picture, sending an email, and getting current prices from suppliers’ websites. Thingino gives you a small Linux environment with SSH access, so I could just copy the program onto the camera. Codex wrote it in Go and cross-compiled it for the camera’s MIPS processor. A few shell scripts handle the picture taking, cron runs it on a schedule, and curl handles the web requests and email.

As the oil tank lives in the basement, which is normally dark, the camera needs decent and stable lighting to take a good picture. Initially I thought about installing a Wi-Fi power socket and having the script switch a lamp on and off. Then I discovered an easier option: the Wyze Cam’s built-in USB-A port can be switched on and off in software. I happened to have a USB-powered LED lamp, so I simply plugged it into the USB-A port. Now the script turns the lamp on, waits a few seconds, takes three pictures two seconds apart, and turns the lamp off. That solved the lighting problem elegantly. I had to experiment with the placement of the lamp a bit: putting it off to the side of the gauge, at some distance, gave the best result, since it kept the glare on the gauge cover away from the red disc.

The gauge of the tank has a red disc, which stands out from the rest of the image, so finding its position is not hard. Specifically, the program crops the image around the gauge and looks for pixels where the red channel is much brighter than either green or blue. The disc produces a broad horizontal band of these pixels. Its vertical center gives the indicator position. I marked the full, 3/4, 1/2, 1/4, and empty lines once on a reference image, and the program simply interpolates between them. Because everything is static, this simple algorithm is sufficiently robust. If the program can’t find a clear red band, or the three pictures don’t agree, it reports the reading as unreadable rather than guessing.

The script also keeps a history of recent readings in order to calculate the daily consumption, which lets it predict how many days the remaining oil will last.

Once the script could reliably read the gauge, my next task was a heuristic that tells me when to refill. Here is my mental model:

  • I have a standard 275-gallon tank (the actual capacity marked on the tank is 266 gallons).
  • If the tank’s head room is less than 150 gallons, don’t refill, as I’d be paying a short-delivery surcharge.
  • If the remaining oil can’t last more than a week at the recent daily consumption, recommend refilling immediately.
  • Otherwise, base the recommendation on whether the price is likely to rise or drop in the next 7 days.

Algorithmically, the recommendations are:

  • DO NOT BUY: not enough room in the tank for a 150-gallon delivery.
  • BUY NOW: a week or less of oil left.
  • BUY: there’s room for a delivery, I have more than a week of oil, and prices are trending up.
  • WAIT: can wait a week and prices are either flat or falling.
  • CHECK MANUALLY: insufficient readings to estimate consumption, or the gauge couldn’t be read.

The price prediction is not perfect: it’s based only on recent price history. The program follows the cheapest supplier’s prices over the last two weeks, estimates the trend, and projects it a week ahead. If the projected change is 10 cents per gallon or more, the price counts as rising or falling; anything smaller counts as flat. For example, in the past couple of weeks the heating oil price has been dropping, so unless my oil level is very low and can’t last a week, the recommendation is WAIT.

There is obviously no claim that this will find the market bottom, but at least it’s data-driven and helps me answer a narrow question: is there a reason to buy today, or can I check again tomorrow?

So now, every morning around 10 a.m., I get an email telling me the current tank level, daily consumption, recommended action, and current supplier prices, along with the captured image and a chart showing the oil level over the last 14 days. Below is the email I received on November 20. So far, I have to say I am very happy to have this ordeal automated, all by a cheap old camera!

Note: I usually share the source code for all my projects. For this one though, Codex wrote all the code, and the part that reads the gauge depends heavily on the specific camera, the gauge, the lighting, and where the marks fall in the image. Therefore instead of sharing the code, I describe the approach I used and believe it’s sufficient for reproduction in the age of LLMs.

Announcing OpenSprinkler Firmware 2.2.1(7) and OpenGarage Firmware 1.2.6

We’re releasing two firmware updates together: OpenSprinkler 2.2.1(7) and OpenGarage 1.2.6. The two products share much of their underlying design, so a feature built for one often makes its way to the other. Here is what’s new.

OpenSprinkler Firmware 2.2.1(7)

Firmware 2.2.1(7) is now available for OpenSprinkler v3, v4 and OpenSprinkler Pi. This release adds one of the most requested watering features, lets v4 read analog sensors without extra hardware, broadens wired Ethernet support, and makes your controller easier to find on your network.

Cycle and Soak

If you have clay soil, a slope, or sprinklers that put down water faster than the ground can absorb it, you have probably seen the result: puddles, runoff onto the sidewalk, and water you paid for flowing down the street. The fix is to water in short bursts with breaks in between, so each round has time to soak in before the next one starts.

This is called Cycle and Soak, and it is a standard feature on many other sprinkler controllers. It has long been missing from OpenSprinkler. Firmware 2.2.1(7) closes that gap.

You set two values for each zone:

  • Maximum cycle: the longest the zone may run at one time.
  • Minimum soak: the shortest break before the zone runs again.

OpenSprinkler then splits the zone’s watering time into even cycles automatically. For example, 17 minutes with a 5-minute maximum cycle becomes 4 cycles of 4 minutes 15 seconds. While one zone soaks, other zones can water, helping make efficient use of the available time. Because the settings belong to each zone, your steep front bed can use short cycles while your flat back lawn waters in one go.

Before: one continuous 17-minute run. After: four 4:15 cycles separated by soaks.

How is this different from Program Repeat?

OpenSprinkler has long had Repeat, which reruns an entire program at a fixed interval, such as every 45 minutes. It can roughly imitate Cycle and Soak, but it isn’t the same thing:

  • Repeat works on the whole program. Every zone in the program runs again each time, with the same timing. You have to work out the split yourself. And when Weather or Sensor Adjustments scale the program, every repeat gets longer or shorter while the number of repeats stays fixed, so the split you worked out no longer fits.
  • Cycle and Soak works on each zone. You set the total watering time as usual, and the firmware handles the splitting and scheduling, with different settings for different zones. The firmware recalculates the cycles after Weather or Sensor Adjustments, keeping each cycle within the maximum you set.

They also work well together. Use Repeat for when to water, for example several short sessions spread through a hot day. Use Cycle and Soak for how each zone receives its water within a session.

Cycle and Soak applies to programs and Run-Once. For a manually started zone, you can choose whether to apply it. Zones that use it show a circular-arrow indicator on the homepage.


Onboard Analog Sensors on v4

Previously, analog sensor support on OpenSprinkler v3 and v4 required the Sensor Expander. With 2.2.1(7), OpenSprinkler v4 can read analog sensors directly through its built-in sensor ports SN1–SN4. No Sensor Expander is needed. Set a port to Analog, add an Onboard Analog sensor in Edit Sensors, and you get the same features as Sensor Expander inputs:

  • live readings and logging;
  • built-in conversions for popular sensors such as SMT50, SMT100, VH400, THERM200 and AquaPlumb, plus linear and piecewise-linear options for others;
  • automatic program adjustment based on the readings.
Set Sensor 1 to Analog under Edit Options, then select Onboard Analog and SN1 in Add a Sensor

The ports read 0–3.3 V, which suits common irrigation sensors such as the SMT50 and VH400.

The Sensor Expander remains useful in these situations:

  • You need many sensors. The expander provides 16 analog inputs, compared with four built-in ports.
  • Your built-in ports are already in use by digital sensors, such as a rain sensor, flow meter or program switch.
  • You use a v3 controller, which still needs the Sensor Expander for analog inputs.

CH390 Wired Ethernet Support

Many users prefer wired Ethernet for reliability or in locations where WiFi is weak. Until now, OpenSprinkler v3.3–3.4 and v4 supported the W5500 Ethernet module. Firmware 2.2.1(7) adds support for the CH390, a newer, smaller, lower-cost Ethernet controller. It has a simpler design and needs far fewer peripheral components than the W5500.

CH390 wired Ethernet module for OpenSprinkler, with an RJ45 jack and pin header

This release also improves Ethernet recovery and the automatic fallback from wired to WiFi, for all supported Ethernet modules.


Custom Hostnames

On OpenSprinkler v3 and v4, you can now give your controller an easy-to-remember hostname, such as garden-os, and open it at http://garden-os (some routers require http://garden-os.lan). This is more convenient than using its numeric IP address, which is assigned dynamically by default and can change. Set it under Edit Options → Network. If you have several controllers, giving each one a descriptive name is especially handy. If you leave it empty, the controller uses a default name based on its MAC address.


Other Improvements and Fixes

  • More reliable cloud (OTC) connections and recovery after outages.
  • Fixed a crash when saving programs through the cloud connection on wired v3 controllers.
  • Fixed sequential zones opening together when they were queued in the same second.
  • Firmware updates. The updater can now show formatted release notes.
  • Chip temperature monitoring on v4 through the System Internal sensor.
  • Clearer Remote Extension behavior. A controller in Remote Extension mode no longer starts automatic watering or queries weather, but still accepts commands from the main controller.

Follow the firmware update instructions and check the 2.2.1(7) release notes.

OpenGarage Firmware 1.2.6

Firmware 1.2.6 is now available for OpenGarage. It brings one-click updates and smarter WiFi for mesh networks, and keeps your garage door working when the network is down.

One-Click Firmware Updates

Following OpenSprinkler firmware 2.2.1(6), OpenGarage now gets one-click firmware updates too. Updating used to mean finding the right .bin file, downloading it and uploading it by hand. Now you open the update page, pick a release, read its release notes, and click Install Update: your browser downloads and checks the firmware, then uploads it to OpenGarage. To get this feature, update to 1.2.6 manually once. After that, future releases install directly from the update page.

OpenGarage 1.2.6 Firmware Update page with One-Click Firmware Update and Manual Firmware Update panels

Prefer to do it yourself? Manual upload is still there, and it also works in WiFi setup (AP) mode.

Smarter WiFi for Mesh Networks

Many homes now have mesh systems or several access points sharing one network name. Older firmware could stay stuck on a distant access point with a weak signal.

1.2.6 picks the strongest access point for your network, and moves to a better one if the signal stays weak. Reconnection is smarter too: after a router reboot or outage, OpenGarage keeps retrying at sensible intervals until it’s back online.

This is on by default (Advanced → WiFi AP Selection: Automatic), and you can switch it off if you prefer. Switching it off disables AP selection and roaming, but automatic reconnection remains active. This time OpenGarage is first: we plan to bring the same improvement to OpenSprinkler in a future release.

Keeps Working When WiFi Doesn’t

Your garage door shouldn’t depend on your internet connection. In 1.2.6, OpenGarage keeps door sensing, the event log, the physical button and automation running while WiFi is down.

If you rely on auto-close to shut a door left open, it now does its job even during a WiFi or internet outage. Closing at a scheduled time also works, as long as the clock has synchronized at least once since startup.

Security Improvements

Firmware uploads are now protected: OpenGarage checks an upload for your device key before it accepts any of it.

Saved passwords, keys and cloud tokens are no longer shown in Edit Options. Leave a field blank to keep the current value, type a new value to replace it, or tick Clear to remove it.

Better Security+ Support

On Security+ 2.0, door status now shows up faster after a restart; on Security+ 1.0, the light and lock status and controls now work correctly while the safety beam is blocked.

Other Updates

  • More reliable MQTT. Status reporting is more reliable, and old commands stored by the broker are no longer replayed when OpenGarage reconnects.
  • Blynk is no longer supported. Blynk’s legacy app was discontinued long ago and is no longer available in app stores. Very few devices still use our Blynk server, so we’ve decided to retire the legacy service. OpenThings Cloud (OTC) provides a more complete remote-access experience: you can use your device’s built-in web interface remotely, just as you do locally, with no port forwarding needed.

Follow the firmware update instructions and check the 1.2.6 release notes.