other·ongoing·

When your internet drops, your lights should still work

Mobile app for a homeowner to control smart breakers from the phone — and keep them running when the home internet drops. No server of ours in the control path.

0
servers between the phone and the breaker
2
transports (cloud + LAN fallback)
v1 shipped
list + toggle + total draw

The challenge

A homeowner wanted a single app to run the smart breakers in the house — lights, water pump, water heater. The internet connection at home drops for hours at a time, sometimes in the middle of the night. The vendor's own app could flip switches when the link was up, but it had two problems: it showed no total consumption for the house, and it went dark with the link. The homeowner needed the breakers to stay reachable even when the cloud could not be reached.

What we built

We built a Flutter app that talks straight to the vendor's cloud platform from the device — with no server of ours in the control path — and signs every call with the homeowner's vendor credentials, injected at build time instead of living in the source tree. When the home internet drops, the app switches to the vendor's encrypted local protocol over Wi-Fi and keeps controlling the breakers inside the LAN. Total house consumption is computed from head breakers only, so the sum never double-counts child breakers. The same screens handle both transports; the user does not need to know which one is active. We do run a small backend for other jobs — the meter's history, the solar-battery rules, and signing the cloud calls in the web build — but nothing of ours sits between a switch and the thing that flips it.

Tech stack

FlutterTuya Cloud OpenAPI (HMAC-SHA256 signing, app-side)Tuya v3.5 LAN protocol (AES-GCM, TCP 6668)Clean Architecture (domain / data / device / app)BLoC + Freezed 3.x + fpdartget_it + injectableFirebase Auth

What this gets you

  • Turn the lights, the water pump, and the water heater on or off from the phone, anywhere in the house.
  • Keep controlling the breakers even when the home internet drops — the app switches to an encrypted local channel.
  • Skip the cost of a custom backend in the control path: the app talks straight to the platform the breakers already use.
  • See the total home draw as one number, not a stack of duplicates you have to add up yourself.
  • Keep the vendor credentials out of the source tree, so a secret never lands in the repository.

The challenge

The homeowner wanted one app to run every breaker in the home. The vendor’s app could already do this over the cloud, but two things were missing for this house.

Constraint Why it mattered
Home internet drops for hours at a time The owner still needs lights and the pump at night
No budget for a custom server We had to ship inside the vendor’s existing platform
Brand-name smart-home apps ignore total consumption The owner could see each breaker but never what the house actually drew
Switches can flip from outside by accident or by rule Toggles had to stay predictable and reversible

What we built

Capability How
One app for Android and iOS Flutter, single codebase
Direct integration with the smart-breaker platform Tuya Cloud OpenAPI, calls signed from the app
Local control when the internet drops Vendor’s LAN protocol v3.5 over Wi-Fi, encrypted session
Total home draw without double counting Domain rule: sum head breakers only, never their children
Credentials that don’t land in the repo Injected at build time from a gitignored .env, never written in the source

Results

  • Lights and pump controllable from anywhere in the house
  • Breakers stay reachable during internet outages
  • One mobile app replaces the vendor app for the homeowner’s daily use
  • Total home consumption shown as a single number
  • Vendor credentials injected at build time; no secret in the source tree

What’s next

The next round of work is already on the roadmap: let the owner edit the breaker hierarchy inside the app, propagate an off command from a parent breaker to its children, and add charts for power use over time. The longer-term plan — automating the water heater when the battery is low, or switching the pump when a stored condition fires — needs an always-on piece, and that decision is still open with the client.

Building a connected product that has to keep working when the link drops? Book an intro call. We’ll tell you honestly whether we can help.

Have a similar project?

We help startups build the right thing, the right way. Let's talk about yours.