---
title: "STS — Smart Transfer Switch"
headline: "STS: automatic transfer switch for solar and grid"
description: "Ali Ahmed built STS, an automatic transfer switch for solar and grid: switched from a phone, on a schedule, and confirmed by the device every time."
canonical_url: https://alioahmed.com/work/sts
type: case-study
role: "Head of Energy Systems & Product Engineering"
date_label: "2026 – present"
status: live
date_modified: 2026-11-20
author:
  name: "Ali Ahmed"
  url: https://alioahmed.com/
  orcid: https://orcid.org/0009-0007-4265-3295
key_figures:
  - "Confirmed switches verified by sensor, not by command"
  - "Reconciled devices recovered to desired state after an outage"
  - "Deferred manual override holds until the next transition"
  - "Interlocked never two live supplies (Industrial)"
entities:
  - name: "WattEY STS"
    type: SoftwareApplication
    url: https://sts.wattey.bijlibachao.pk/
  - name: "Wattey Energy"
    type: Organization
    url: https://watteyenergy.pk/
    same_as:
      - https://www.linkedin.com/company/bijli-bachao-pk/
      - https://www.facebook.com/p/BijliBachaoPk-100077909401599/
  - name: "Engr. Reyyan Niaz Khan"
    type: Person
    url: https://watteyenergy.pk/team/reyyan-niaz-khan
    same_as:
      - https://www.linkedin.com/in/engr-reyyan-niaz-khan/
  - name: "STS control-plane rules"
    type: DefinedTermSet
  - name: "UL 1008 — Transfer Switch Equipment"
    type: DefinedTerm
    url: https://webstore.ansi.org/standards/ul/ul1008ed2022
  - name: "IEC 60947-6-1 — Transfer Switching Equipment (ATSE)"
    type: DefinedTerm
    url: https://webstore.iec.ch/en/publication/90494
  - name: "MQTT — ISO/IEC 20922"
    type: DefinedTerm
    url: https://www.iso.org/standard/69466.html
    same_as:
      - https://www.wikidata.org/wiki/Q10322548
      - https://en.wikipedia.org/wiki/MQTT
  - name: "Next.js"
    type: SoftwareApplication
    url: https://nextjs.org/
    same_as:
      - https://www.wikidata.org/wiki/Q56062435
      - https://en.wikipedia.org/wiki/Next.js
  - name: "Amazon Web Services"
    type: Organization
    url: https://aws.amazon.com/
    same_as:
      - https://www.wikidata.org/wiki/Q456157
      - https://en.wikipedia.org/wiki/Amazon_Web_Services
  - name: "UN Sustainable Development Goal 7: Affordable and Clean Energy"
    type: DefinedTerm
    url: https://sdgs.un.org/goals/goal7
    same_as:
      - http://metadata.un.org/sdg/7
  - name: "UN Sustainable Development Goal 9: Industry, Innovation and Infrastructure"
    type: DefinedTerm
    url: https://sdgs.un.org/goals/goal9
    same_as:
      - http://metadata.un.org/sdg/9
person_same_as:
  - https://www.linkedin.com/in/alioahmed/
  - https://github.com/alioahmed
  - https://orcid.org/0009-0007-4265-3295
  - https://x.com/Alioahmed_
  - https://about.me/alioahmed
  - https://dev.to/alioahmed
  - https://medium.com/@alioahmed
  - https://hashnode.com/@alioahmed
  - https://substack.com/@alioahmed
  - https://huggingface.co/alioahmed
  - https://bsky.app/profile/alioahmed.bsky.social
  - https://www.kaggle.com/alioahmed
  - https://www.producthunt.com/@alioahmed
  - https://www.patreon.com/cw/alioahmed
  - https://www.goodreads.com/user/show/202106301-ali-ahmed
  - https://fueler.io/alioahmed
  - https://gitlab.com/alioahmed
  - https://linktr.ee/alioahmed
  - https://topmate.io/alioahmed
related:
  - https://alioahmed.com/work/wattey
  - https://alioahmed.com/work/solar-performance-cloud
  - https://alioahmed.com/work/electricity-sub-billing
  - https://alioahmed.com/work/wattey-energy
full_corpus: https://alioahmed.com/llms-full.txt
site_index: https://alioahmed.com/llms.txt
---

# STS — Smart Transfer Switch

> Ali Ahmed designed and built STS, the Smart Transfer Switch, at Wattey Energy (formerly BijliBachao.pk), founded by Engr. Reyyan Niaz Khan. A controller fitted to a building’s existing solar/WAPDA changeover lets the owner switch by phone, on a daily schedule or automatically, and a switch is reported done only when the device’s own sensor confirms the new source.

**Canonical URL:** https://alioahmed.com/work/sts  
**Role:** Head of Energy Systems & Product Engineering — 2026 – present  
**Summary:** Ali Ahmed built STS, an automatic transfer switch for solar and grid: switched from a phone, on a schedule, and confirmed by the device every time.

## Key figures

- **Confirmed** — switches verified by sensor, not by command
- **Reconciled** — devices recovered to desired state after an outage
- **Deferred** — manual override holds until the next transition
- **Interlocked** — never two live supplies (Industrial)

### Two products measure. STS acts.

Measuring tells a site where its electricity went. Control decides where it comes from. With Wattey Solar Performance Cloud and WattEY, STS completes one account of a site’s electricity, the job an energy management system does.

Wattey Solar Performance Cloud: What the site’s own solar produces, string by string. (906 strings · 94 sites)

WattEY: What the site draws from the grid, and what it costs under the tariff. (19 organisations · 1.92 GWh)

STS: Which source carries the load, switched on time and confirmed. (Every switch confirmed)

Until the switching is recorded, neither measurement can be attributed to the right source.

Figures as of 25 August 2026, from the Wattey Energy hub. I built all three products.

### The changeover is still a lever on a wall.

Pakistan’s net-metering capacity rose from about 4 GW in 2024 to 5.3 GW by April 2025, and load-shedding still runs two to eight hours a day. Most of that solar sits behind the meter on homes and small businesses, where someone walks to a panel and flips the changeover by hand. (Renewables First, Pakistan Electricity Review 2025 (via pv magazine); Ember, Global Electricity Review 2025)

STS was built for the hard version of this problem: a grid that drops for hours every day, and connections that fail in the middle of a command. Every decision on this page starts from that.

The moments people go looking for a better switch: The sun is up, and the load is still on the grid; Nobody switched back at sunset; A back-feed scare at the panel; One site became ten.

### Without STS, and with it

- Walk to the panel and flip a lever → One tap on a phone, from anywhere
- Forget to switch, and waste solar or pay for the grid → A daily schedule that switches on its own
- No idea what is on when you are away → Live status, read from the device
- “Did it actually switch?” means going to look → Every switch confirmed by the device itself
- Someone has to be on site → Many sites from one screen
- A wrong switch can bridge two supplies → On the industrial unit, the equipment makes that impossible

### Fitted once. Then it runs itself.

- Fit the controller: An electrician wires a small controller onto the existing solar/WAPDA changeover, once. The wiring stays as it is.
- Claim it with a code: The device comes online by itself. The installer hands over a single-use code, and the device is bound to its owner.
- Control it from a phone: Tap Solar or WAPDA, see the live source, set the daily switching times. The app installs from the browser, no app store.
- Leave it: The schedule runs every day. After an outage it catches up to where it should be. Open the app only when you want to.

### The app, as owners use it.

Three screens from the STS app, redrawn with sample data: the owner’s devices, one-tap switching, and the daily schedule.

Every device, online or offline, at a glance.

One tap, then the device confirms the switch.

Two times a day, and it holds position in between.

No app store, on purpose. The app installs from the browser on Android and iPhone, so a fix reaches every phone the moment it ships, with no review queue between a fault and its remedy.

### Confirm. Success means measured, not sent

The shortcut: “The command was accepted, so report success.”

Reporting the command as success would demo identically and pass every test, and it would report an intention as a fact. A contactor can stick, a message can drop, a device can reboot mid-command. STS keeps the operation open until the device’s own input line shows the new source is live. If that does not happen within 30 seconds, it stops and tells the owner, rather than pretending.

### Catch up. A schedule is a state to hold

The shortcut: “The device was offline at switching time, so it missed it. It will get the next one.”

Load-shedding and dropped connections are normal here. If a device was offline at switching time, it does not stay on the wrong supply all day: when it returns, STS moves it to the source the schedule says it should be on now. If it missed both switches, it goes straight to the later one instead of switching twice. On the industrial unit, no schedule runs until the wiring has been checked at the device, because a schedule switches with nobody watching.

### Defer. A person’s choice comes first

The shortcut: “The schedule says solar, so put it back on solar.”

Someone who switches by hand has a reason the system cannot see: maintenance, a fault, an unusual load. Automation that instantly reverts a person is worse than none, because then nobody trusts either. STS honours the manual change until the next scheduled time, then the schedule resumes.

### Interlock. Two supplies are never live together

The shortcut: “The app will never send both commands, so that is enough.”

On STS Industrial, the transfer switch latches in one position, Solar or WAPDA, never both. The software never drives both selector coils at once and drops the other first, and a manual selector on the unit locks remote control out entirely. Bridging two live supplies is not a bug report to fix in the next release; it is a fault on someone’s premises, and back-feed is a documented, sometimes fatal hazard to line workers.

### Where each rule lives.

Each guarantee sits at the level that can keep it. The most important one sits lowest.

- Platform: The source that should be live, the schedule, and the manual override
- Platform: Who may switch it, a one-time claim code, then ownership
- Device: The source that is live, read from its own input line, never assumed from the command
- Equipment: One source at a time, the industrial switch latches in one position, with a manual selector that locks remote control out

### Why not just use what exists?

Each option people use today covers part of the job. None of them covers all of it.

- A manual changeover lever: Depends on a person being there, and confirms nothing.
- A basic remote relay: Fires the command and assumes it worked.
- A generator ATS: Built to start and stop a generator, not to run solar every day.
- The inverter’s own transfer: Tied to one inverter, with no view across sites.
- A smart-home Wi-Fi switch: Not transfer equipment, and no interlock between two supplies.
- STS: confirmed by the device, scheduled with catch-up, honours manual changes, many sites in one app, and an interlocked latching switch on the industrial unit.

### One app, three kinds of hardware.

- STS Controller: Switches up to four circuits independently, each one schedulable, with a cap on how many run at once. For homes and shops that want per-circuit control.
- STS Transfer Switch: A dedicated Solar/WAPDA changeover, with its own sensor confirming which supply is live.
- STS Industrial: Built around a CNC Electric YCQ6 PC-class automatic transfer switch: it rests on Solar or WAPDA, never both, and is never driven with both coils on. Its manual selector locks remote control out. Fully schedulable, every switch confirmed.
- Built on: Dingtian DT-R industrial relay controllers, MQTT (ISO/IEC 20922), Next.js installable web app, AWS.

### Designed against the standards for this kind of device.

A transfer switch has a real standards home. STS was designed against it, so a facility engineer can check the design against rules they already use.

- UL 1008 (Transfer Switch Equipment): The industrial unit is designed to its intent.
- IEC 60947-6-1 (Automatic transfer switching equipment (ATSE)): Aligned to its model: the load is connected to one source at a time, which is how STS Industrial behaves. The industrial unit is built around a CNC Electric YCQ6, a PC-class automatic transfer switch its maker lists under this standard, printed on its nameplate.
- ISO/IEC 20922 (MQTT, the messaging standard for connected devices): Devices and the platform talk over it, not over a private protocol.
- The STS controller and platform are aligned, not certified or Listed. The transfer switch inside STS Industrial is CNC Electric’s own IEC 60947-6-1 product.

### Who it is for.

- Homes: “Am I actually on solar, or quietly paying the grid?” Solar from morning, grid from sunset, set once and left running.
- Shops, offices and branches: “I can’t babysit the changeover.” Switch from home before closing, and see every branch on the right source.
- Factories: “I need a hard interlock and switching I can defend to an inspector.” Solar by day, grid overnight, and the two supplies can never be live together.
- Installers and operators: “I need sites I can see and control, not hardware I can’t.” Register a device, hand over a code, and manage every device from one dashboard.
- Worries from our buyer research; situations written by the Wattey team as examples. No named customers.

### What I built, and what the team did.

- My part: The device model and claim-by-code ownership: one owner, many devices; one operator, many customers’ sites
- My part: The confirmation protocol that reads the source back before a switch is called done
- My part: The schedule that holds a state and catches up after an outage
- My part: The rules for when a manual change wins over the schedule
- My part: The installable phone app, and the record of every switch, schedule run and change
- The team’s part: Wattey Energy’s engineers handled installation, rollout and training at client sites. Wattey Energy was founded by Engr. Reyyan Niaz Khan.
- Strip out the supplies and the skill is not electricity. It is control of equipment under four hard conditions, solved in production: Equipment you cannot see: the truth is in the device, not the last command; A network you cannot trust: outages are normal, so state must catch up; People who can overrule it: manual intent needs defined precedence; One rule that cannot fail: it sits below the software.
- The same problem, in other teams: Energy management and DER control, Smart metering, EV charging and load control, IoT device management, Industrial automation.

## FAQ

### What is STS?
STS, the Smart Transfer Switch, is an automatic transfer switch for buildings with solar and a grid connection. A controller on the existing changeover moves the building between solar and the WAPDA grid by phone, on a daily schedule or automatically, and confirms each switch from the device’s own sensors.

### What did Ali Ahmed build?
The product and its control layer: the device and ownership model, the confirmation protocol, the schedule with catch-up after outages, the rules for manual changes, and the installable app. He leads it as Head of Energy Systems & Product Engineering at Wattey Energy. Wattey Energy’s engineers handle installation at client sites.

### What is the hardest problem in a system like this?
That you cannot see the thing you are controlling. Every other difficulty follows from it: you cannot trust that a command was carried out, you cannot assume a device was awake when it was needed, and you cannot tell whether an unexpected state came from a fault or from a person. Confirming from the device, catching up to the schedule, and giving manual changes defined precedence each answer one of those.

### Does it need new wiring?
No. STS fits onto an existing solar/WAPDA changeover. An electrician installs the controller once, and the wiring stays as it is.

### What happens if the internet or power drops?
When the device is back, it moves to the source the schedule says it should be on now, including a switch it missed while it was down.

### Can I still switch by hand?
Always. STS honours a manual change and will not override it until the next scheduled time, then the schedule resumes. On STS Industrial, the manual selector on the unit locks remote control out entirely.

### Can one person manage many devices or sites?
Yes. One owner can hold several devices, and one installer or operator can manage many customers’ sites from a single dashboard. Each device is claimed with a single-use code and bound to its owner, so everyone sees only what is theirs.

### Does the app come from an app store?
No. It is an installable web app that goes onto Android and iPhone straight from the browser and opens full-screen. That was a release decision: a fix reaches every phone the moment it ships, with no app-store review in the way.

### Is STS a static transfer switch?
No. STS is an automatic transfer switch (ATS), the kind that moves a building between solar and the grid. The solid-state static transfer switch that shares the acronym is a different product, used in data centres.

### Is STS certified?
The transfer switch inside STS Industrial is a CNC Electric YCQ6, which its maker lists under IEC 60947-6-1. The STS controller and platform are not certified or Listed: they are designed to the intent of UL 1008 and aligned to the IEC 60947-6-1 model, and the telemetry runs on MQTT, an ISO/IEC 20922 standard.

### How does STS relate to WattEY and Wattey Solar Performance Cloud?
Wattey Solar Performance Cloud measures what the site’s solar produces. WattEY measures what the site draws from the grid and what it costs. STS controls which of the two carries the load. Ali built all three.

---
Rendered from the structured content at https://alioahmed.com/work/sts. Facts trace to the canonical bio; render, don't reword.
